	.file	"320936.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Create server socket error: %s\n"
.LC1:
	.string	"Bind server socket failed"
.LC2:
	.string	"Listen failed"
	.align 8
.LC3:
	.string	"Waiting to accept a connection..."
.LC4:
	.string	"Accepted socket fd = %d\n"
.LC5:
	.string	"Read data: %s\n"
.LC6:
	.string	"DOWN"
.LC7:
	.string	"END"
.LC8:
	.string	"%d"
.LC9:
	.string	"and then "
.LC10:
	.string	"Read error"
.LC11:
	.string	"Write error\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1136
	mov	DWORD PTR -1124[rbp], edi
	mov	QWORD PTR -1136[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -1056[rbp], 0
	mov	QWORD PTR -1048[rbp], 0
	mov	WORD PTR -1056[rbp], 2
	mov	edi, 8888
	call	htons@PLT
	mov	WORD PTR -1054[rbp], ax
	mov	edi, 2130706433
	call	htonl@PLT
	mov	DWORD PTR -1052[rbp], eax
	mov	DWORD PTR -1100[rbp], 0
	mov	DWORD PTR -1096[rbp], 0
	mov	DWORD PTR -1092[rbp], 0
	mov	BYTE PTR -1109[rbp], 1
	mov	DWORD PTR -1108[rbp], 1024
	mov	edx, 6
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -1088[rbp], eax
	cmp	DWORD PTR -1088[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, 0
	jmp	.L17
.L2:
	lea	rdx, -1109[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 1
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	lea	rdx, -1109[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 1
	mov	rcx, rdx
	mov	edx, 9
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rdx, -1109[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 1
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rdx, -1109[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 1
	mov	rcx, rdx
	mov	edx, 15
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rdx, -1108[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 7
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rdx, -1108[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 8
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	lea	rcx, -1056[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	jmp	.L5
.L4:
	lea	rdx, -1109[rbp]
	mov	eax, DWORD PTR -1088[rbp]
	mov	r8d, 1
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 6
	mov	edi, eax
	call	setsockopt@PLT
	mov	eax, DWORD PTR -1088[rbp]
	mov	esi, 128
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L5
.L6:
	mov	QWORD PTR -1072[rbp], 0
	mov	QWORD PTR -1040[rbp], 0
	mov	QWORD PTR -1032[rbp], 0
	lea	rdx, -1024[rbp]
	mov	eax, 0
	mov	ecx, 126
	mov	rdi, rdx
	rep stosq
	mov	rdx, rdi
	mov	BYTE PTR [rdx], al
	add	rdx, 1
	mov	QWORD PTR -1064[rbp], 0
.L16:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -1088[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -1084[rbp], eax
	mov	eax, DWORD PTR -1084[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -1096[rbp], 0
	mov	eax, DWORD PTR -1084[rbp]
	mov	DWORD PTR -1064[rbp], eax
	mov	WORD PTR -1060[rbp], 1
.L12:
	lea	rax, -1040[rbp]
	mov	edx, 1025
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -1064[rbp]
	mov	edx, 15000
	mov	esi, 1
	mov	rdi, rax
	call	poll@PLT
	mov	DWORD PTR -1080[rbp], eax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1084[rbp]
	mov	edx, 99
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -1072[rbp], rax
	cmp	QWORD PTR -1072[rbp], 0
	jle	.L19
	mov	BYTE PTR -16[rbp], 0
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1040[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L9
	mov	DWORD PTR -1100[rbp], 1
	jmp	.L8
.L9:
	lea	rax, -1040[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rax, -1040[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	je	.L20
	mov	DWORD PTR -1104[rbp], 0
	lea	rdx, -1104[rbp]
	lea	rax, -1040[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], 1
	je	.L11
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L17
.L11:
	mov	eax, DWORD PTR -1104[rbp]
	add	DWORD PTR -1096[rbp], eax
	jmp	.L12
.L19:
	nop
	jmp	.L8
.L20:
	nop
.L8:
	cmp	QWORD PTR -1072[rbp], -1
	jne	.L13
	lea	rdi, .LC10[rip]
	call	perror@PLT
.L13:
	lea	rax, -1040[rbp]
	mov	edx, 1025
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	edx, DWORD PTR -1096[rbp]
	lea	rax, -1040[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	WORD PTR -1060[rbp], 4
	lea	rax, -1064[rbp]
	mov	edx, 15000
	mov	esi, 1
	mov	rdi, rax
	call	poll@PLT
	mov	DWORD PTR -1080[rbp], eax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1084[rbp]
	mov	edx, 99
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -1092[rbp], eax
	cmp	DWORD PTR -1092[rbp], -1
	jne	.L14
	lea	rdi, .LC11[rip]
	call	perror@PLT
	jmp	.L5
.L14:
	mov	eax, DWORD PTR -1084[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -1100[rbp], 0
	jne	.L21
	jmp	.L16
.L21:
	nop
.L5:
	mov	eax, DWORD PTR -1088[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L17:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"320936.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Create server socket error: %s\012\000"
	.align	2
.LC1:
	.ascii	"Bind server socket failed\000"
	.align	2
.LC2:
	.ascii	"Listen failed\000"
	.align	2
.LC3:
	.ascii	"Waiting to accept a connection...\000"
	.align	2
.LC4:
	.ascii	"Accepted socket fd = %d\012\000"
	.align	2
.LC5:
	.ascii	"Read data: %s\012\000"
	.align	2
.LC6:
	.ascii	"DOWN\000"
	.align	2
.LC7:
	.ascii	"END\000"
	.align	2
.LC8:
	.ascii	"%d\000"
	.align	2
.LC9:
	.ascii	"and then \000"
	.align	2
.LC10:
	.ascii	"Read error\000"
	.align	2
.LC11:
	.ascii	"Write error\012\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1120
	str	r0, [fp, #-1112]
	str	r1, [fp, #-1116]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, .L22+4
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #8
	strh	r2, [r3, #2]	@ movhi
	ldr	r0, .L22+8
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-1048]
	mov	r3, #0
	str	r3, [fp, #-1092]
	mov	r3, #0
	str	r3, [fp, #-1088]
	mov	r3, #0
	str	r3, [fp, #-1084]
	mov	r3, #1
	strb	r3, [fp, #-1101]
	mov	r3, #1024
	str	r3, [fp, #-1100]
	mov	r2, #6
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1080]
	ldr	r3, [fp, #-1080]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L22+12
	bl	perror
	mov	r3, #0
	b	.L17
.L2:
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #9
	mov	r2, #1
	str	r2, [sp]
	mov	r2, #1
	mov	r1, #6
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #9
	mov	r2, #1
	str	r2, [sp]
	mov	r2, #9
	mov	r1, #1
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #9
	mov	r2, #1
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #9
	mov	r2, #1
	str	r2, [sp]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #7
	mov	r1, #1
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #8
	mov	r1, #1
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-1080]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L22+16
	bl	perror
	b	.L5
.L4:
	sub	r3, fp, #1088
	sub	r3, r3, #4
	sub	r3, r3, #9
	mov	r2, #1
	str	r2, [sp]
	mov	r2, #1
	mov	r1, #6
	ldr	r0, [fp, #-1080]
	bl	setsockopt
	mov	r1, #128
	ldr	r0, [fp, #-1080]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L22+20
	bl	perror
	b	.L5
.L6:
	mov	r3, #0
	str	r3, [fp, #-1076]
	mov	r3, #0
	str	r3, [fp, #-1036]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L22+24
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #1056
	sub	r3, r3, #4
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
.L16:
	ldr	r0, .L22+28
	bl	puts
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-1080]
	bl	accept
	str	r0, [fp, #-1072]
	ldr	r1, [fp, #-1072]
	ldr	r0, .L22+32
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-1088]
	ldr	r3, [fp, #-1072]
	str	r3, [fp, #-1060]
	sub	r3, fp, #4
	sub	r3, r3, #1056
	mov	r2, #1
	strh	r2, [r3, #4]	@ movhi
.L12:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r2, .L22+36
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #1056
	sub	r3, r3, #4
	ldr	r2, .L22+40
	mov	r1, #1
	mov	r0, r3
	bl	poll
	str	r0, [fp, #-1068]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #99
	mov	r1, r3
	ldr	r0, [fp, #-1072]
	bl	read
	str	r0, [fp, #-1076]
	ldr	r3, [fp, #-1076]
	cmp	r3, #0
	ble	.L19
	mov	r3, #0
	strb	r3, [fp, #-12]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r1, r3
	ldr	r0, .L22+44
	bl	printf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r1, .L22+48
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	mov	r3, #1
	str	r3, [fp, #-1092]
	b	.L8
.L9:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r1, .L22+52
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	mov	r3, #0
	str	r3, [fp, #-1096]
	sub	r2, fp, #1088
	sub	r2, r2, #4
	sub	r2, r2, #4
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r1, .L22+56
	mov	r0, r3
	bl	__isoc99_sscanf
	str	r0, [fp, #-1064]
	ldr	r3, [fp, #-1064]
	cmp	r3, #1
	beq	.L11
	ldr	r0, .L22+60
	bl	puts
	mov	r3, #0
	b	.L17
.L11:
	ldr	r3, [fp, #-1096]
	ldr	r2, [fp, #-1088]
	add	r3, r2, r3
	str	r3, [fp, #-1088]
	b	.L12
.L19:
	nop
	b	.L8
.L20:
	nop
.L8:
	ldr	r3, [fp, #-1076]
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L22+64
	bl	perror
.L13:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r2, .L22+36
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r2, [fp, #-1088]
	ldr	r1, .L22+56
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #4
	sub	r3, r3, #1056
	mov	r2, #4
	strh	r2, [r3, #4]	@ movhi
	sub	r3, fp, #1056
	sub	r3, r3, #4
	ldr	r2, .L22+40
	mov	r1, #1
	mov	r0, r3
	bl	poll
	str	r0, [fp, #-1068]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #99
	mov	r1, r3
	ldr	r0, [fp, #-1072]
	bl	write
	str	r0, [fp, #-1084]
	ldr	r3, [fp, #-1084]
	cmn	r3, #1
	bne	.L14
	ldr	r0, .L22+68
	bl	perror
	b	.L5
.L14:
	ldr	r0, [fp, #-1072]
	bl	close
	ldr	r3, [fp, #-1092]
	cmp	r3, #0
	bne	.L21
	b	.L16
.L21:
	nop
.L5:
	ldr	r0, [fp, #-1080]
	bl	close
	mov	r3, #0
.L17:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC12
	.word	8888
	.word	2130706433
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	1021
	.word	.LC3
	.word	.LC4
	.word	1025
	.word	15000
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
