	.file	"22976.c"
	.intel_syntax noprefix
	.text
	.globl	argv0
	.bss
	.align 8
	.type	argv0, @object
	.size	argv0, 8
argv0:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%s: "
	.text
	.globl	err
	.type	err, @function
err:
.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, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L2
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L2:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR argv0[rip]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -208[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	err, .-err
	.section	.rodata
.LC1:
	.string	"socket() failed"
.LC2:
	.string	"setsockopt() failed"
.LC3:
	.string	"bind() failed"
.LC4:
	.string	"listen() failed"
.LC5:
	.string	"Listening on port %u\n"
.LC6:
	.string	"accept() failed"
.LC7:
	.string	"read() failed"
.LC8:
	.string	"quit"
.LC9:
	.string	"write() failed"
.LC10:
	.string	"close(client_sd) failed"
.LC11:
	.string	"close(listen_sd) failed"
	.text
	.globl	run_server
	.type	run_server, @function
run_server:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1104
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -1091[rbp], 0
	mov	WORD PTR -1088[rbp], 30000
	movzx	eax, WORD PTR -1088[rbp]
	add	eax, 10
	mov	WORD PTR -1086[rbp], ax
	mov	DWORD PTR -1076[rbp], 10
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -1072[rbp], eax
	cmp	DWORD PTR -1072[rbp], -1
	jne	.L5
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	err
.L5:
	mov	DWORD PTR -1084[rbp], 1
	mov	DWORD PTR -1068[rbp], 4
	mov	ecx, DWORD PTR -1068[rbp]
	lea	rdx, -1084[rbp]
	mov	eax, DWORD PTR -1072[rbp]
	mov	r8d, ecx
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	test	eax, eax
	je	.L6
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	err
.L6:
	movzx	eax, WORD PTR -1088[rbp]
	mov	WORD PTR -1090[rbp], ax
	jmp	.L7
.L10:
	lea	rax, -1056[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -1056[rbp], 2
	mov	edi, 2130706433
	call	htonl@PLT
	mov	DWORD PTR -1052[rbp], eax
	movzx	eax, WORD PTR -1090[rbp]
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -1054[rbp], ax
	lea	rcx, -1056[rbp]
	mov	eax, DWORD PTR -1072[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	je	.L23
	movzx	eax, WORD PTR -1090[rbp]
	add	eax, 1
	mov	WORD PTR -1090[rbp], ax
.L7:
	movzx	eax, WORD PTR -1090[rbp]
	cmp	ax, WORD PTR -1086[rbp]
	jbe	.L10
	jmp	.L9
.L23:
	nop
.L9:
	movzx	eax, WORD PTR -1090[rbp]
	cmp	ax, WORD PTR -1086[rbp]
	jbe	.L11
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	err
.L11:
	mov	edx, DWORD PTR -1076[rbp]
	mov	eax, DWORD PTR -1072[rbp]
	mov	esi, edx
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L12
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	err
.L12:
	movzx	eax, WORD PTR -1090[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L13
.L19:
	mov	eax, DWORD PTR -1072[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -1080[rbp], eax
	cmp	DWORD PTR -1080[rbp], 0
	jns	.L18
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	err
.L18:
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1080[rbp]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -1064[rbp], rax
	cmp	QWORD PTR -1064[rbp], 0
	jns	.L15
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	err
.L15:
	cmp	QWORD PTR -1064[rbp], 0
	jle	.L18
	lea	rax, -1040[rbp]
	mov	edx, 4
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L17
	mov	BYTE PTR -1091[rbp], 1
	jmp	.L13
.L17:
	mov	rdx, QWORD PTR -1064[rbp]
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1080[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	QWORD PTR -1064[rbp], rax
	je	.L18
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	err
	jmp	.L18
.L13:
	movzx	eax, BYTE PTR -1091[rbp]
	xor	eax, 1
	test	al, al
	jne	.L19
	mov	edi, 3
	call	sleep@PLT
	mov	eax, DWORD PTR -1080[rbp]
	mov	edi, eax
	call	close@PLT
	test	eax, eax
	je	.L20
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	err
.L20:
	mov	eax, DWORD PTR -1072[rbp]
	mov	edi, eax
	call	close@PLT
	test	eax, eax
	je	.L24
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	err
.L24:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run_server, .-run_server
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR argv0[rip], rax
	mov	eax, 0
	call	run_server
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"22976.c"
	.text
	.comm	argv0,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s: \000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	err
	.syntax unified
	.arm
	.fpu softvfp
	.type	err, %function
err:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L3+4
	ldr	r3, [r3]
	ldr	r2, .L3+8
	ldr	r2, [r2]
	ldr	r1, .L3+12
	mov	r0, r3
	bl	fprintf
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r3, .L3+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	vfprintf
	ldr	r3, .L3+4
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #10
	bl	fputc
	mov	r0, #1
	bl	exit
.L4:
	.align	2
.L3:
	.word	.LC1
	.word	stderr
	.word	argv0
	.word	.LC0
	.size	err, .-err
	.section	.rodata
	.align	2
.LC2:
	.ascii	"socket() failed\000"
	.align	2
.LC3:
	.ascii	"setsockopt() failed\000"
	.align	2
.LC4:
	.ascii	"bind() failed\000"
	.align	2
.LC5:
	.ascii	"listen() failed\000"
	.align	2
.LC6:
	.ascii	"Listening on port %u\012\000"
	.align	2
.LC7:
	.ascii	"accept() failed\000"
	.align	2
.LC8:
	.ascii	"read() failed\000"
	.align	2
.LC9:
	.ascii	"quit\000"
	.align	2
.LC10:
	.ascii	"write() failed\000"
	.align	2
.LC11:
	.ascii	"close(client_sd) failed\000"
	.align	2
.LC12:
	.ascii	"close(listen_sd) failed\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	run_server
	.syntax unified
	.arm
	.fpu softvfp
	.type	run_server, %function
run_server:
	@ args = 0, pretend = 0, frame = 1080
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1088
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-1079]
	sub	r3, fp, #4
	sub	r3, r3, #1072
	ldr	r2, .L26+4
	strh	r2, [r3]	@ movhi
	sub	r3, fp, #4
	sub	r3, r3, #1056
	sub	r3, r3, #14
	sub	r2, fp, #4
	sub	r2, r2, #1072
	ldrh	r2, [r2]	@ movhi
	add	r2, r2, #10
	strh	r2, [r3]	@ movhi
	mov	r3, #10
	str	r3, [fp, #-1064]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1060]
	ldr	r3, [fp, #-1060]
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L26+8
	bl	err
.L6:
	mov	r3, #1
	str	r3, [fp, #-1072]
	mov	r3, #4
	str	r3, [fp, #-1056]
	sub	r3, fp, #1056
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r2, [fp, #-1056]
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-1060]
	bl	setsockopt
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r0, .L26+12
	bl	err
.L7:
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #2
	sub	r2, fp, #4
	sub	r2, r2, #1072
	ldrh	r2, [r2]	@ movhi
	strh	r2, [r3]	@ movhi
	b	.L8
.L11:
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r0, .L26+16
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-1044]
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #2
	ldrh	r3, [r3]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #1040
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #1040
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-1060]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	beq	.L24
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #2
	ldrh	r2, [r3]
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #2
	add	r2, r2, #1
	strh	r2, [r3]	@ movhi
.L8:
	sub	r3, fp, #4
	sub	r2, r3, #1072
	sub	r2, r2, #2
	sub	r3, fp, #4
	sub	r3, r3, #1056
	sub	r3, r3, #14
	ldrh	r2, [r2]
	ldrh	r3, [r3]
	cmp	r2, r3
	bls	.L11
	b	.L10
.L24:
	nop
.L10:
	sub	r3, fp, #4
	sub	r2, r3, #1072
	sub	r2, r2, #2
	sub	r3, fp, #4
	sub	r3, r3, #1056
	sub	r3, r3, #14
	ldrh	r2, [r2]
	ldrh	r3, [r3]
	cmp	r2, r3
	bls	.L12
	ldr	r0, .L26+20
	bl	err
.L12:
	ldr	r1, [fp, #-1064]
	ldr	r0, [fp, #-1060]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r0, .L26+24
	bl	err
.L13:
	sub	r3, fp, #4
	sub	r3, r3, #1072
	sub	r3, r3, #2
	ldrh	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26+28
	bl	printf
	b	.L14
.L20:
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-1060]
	bl	accept
	str	r0, [fp, #-1068]
	ldr	r3, [fp, #-1068]
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L26+32
	bl	err
.L19:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	ldr	r0, [fp, #-1068]
	bl	read
	str	r0, [fp, #-1052]
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L26+36
	bl	err
.L16:
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	ble	.L19
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #4
	ldr	r1, .L26+40
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L18
	mov	r3, #1
	strb	r3, [fp, #-1079]
	b	.L14
.L18:
	ldr	r2, [fp, #-1052]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1068]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-1052]
	cmp	r3, r2
	beq	.L19
	ldr	r0, .L26+44
	bl	err
	b	.L19
.L14:
	ldrb	r3, [fp, #-1079]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L20
	mov	r0, #3
	bl	sleep
	ldr	r0, [fp, #-1068]
	bl	close
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	ldr	r0, .L26+48
	bl	err
.L21:
	ldr	r0, [fp, #-1060]
	bl	close
	mov	r3, r0
	cmp	r3, #0
	beq	.L25
	ldr	r0, .L26+52
	bl	err
.L25:
	nop
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC13
	.word	30000
	.word	.LC2
	.word	.LC3
	.word	2130706433
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	run_server, .-run_server
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r2, .L30
	str	r3, [r2]
	bl	run_server
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	argv0
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
