	.file	"1003949.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"usage: %s <port>"
.LC1:
	.string	"socket"
.LC2:
	.string	"setsockopt"
.LC3:
	.string	"bind"
.LC4:
	.string	"listen"
.LC5:
	.string	"select"
.LC6:
	.string	"read"
.LC7:
	.string	"-- connection accepted --\n"
.LC8:
	.string	"-- connection closed --\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, 304
	mov	DWORD PTR -292[rbp], edi
	mov	QWORD PTR -304[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -280[rbp], 1
	cmp	DWORD PTR -292[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -304[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, rax
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L2:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -276[rbp], eax
	cmp	DWORD PTR -276[rbp], -1
	jne	.L3
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L3:
	mov	WORD PTR -256[rbp], 2
	mov	rax, QWORD PTR -304[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -254[rbp], ax
	mov	edi, 0
	call	htonl@PLT
	mov	DWORD PTR -252[rbp], eax
	lea	rdx, -280[rbp]
	mov	eax, DWORD PTR -276[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	cmp	eax, -1
	jne	.L4
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L4:
	lea	rcx, -256[rbp]
	mov	eax, DWORD PTR -276[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L5
	lea	rsi, .LC3[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L5:
	mov	eax, DWORD PTR -276[rbp]
	mov	esi, 4096
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L6
	lea	rsi, .LC4[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L6:
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -240[rbp]
	mov	rdi, rdx
#APP
# 64 "the_stack_data/1003949.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -272[rbp], edx
	mov	DWORD PTR -268[rbp], eax
	mov	rax, QWORD PTR -240[rbp]
	or	rax, 1
	mov	QWORD PTR -240[rbp], rax
	mov	eax, DWORD PTR -276[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	mov	esi, eax
	movsx	rax, esi
	mov	rdi, QWORD PTR -240[rbp+rax*8]
	mov	eax, DWORD PTR -276[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	or	rdi, rax
	mov	rdx, rdi
	movsx	rax, esi
	mov	QWORD PTR -240[rbp+rax*8], rdx
	mov	eax, DWORD PTR -276[rbp]
	lea	edi, 1[rax]
	lea	rax, -240[rbp]
	mov	r8d, 0
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	call	select@PLT
	cmp	eax, -1
	jne	.L7
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L7:
	mov	rax, QWORD PTR -240[rbp]
	and	eax, 1
	test	rax, rax
	je	.L8
	lea	rax, -112[rbp]
	mov	edx, 100
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -264[rbp], eax
	cmp	DWORD PTR -264[rbp], 0
	je	.L19
	cmp	DWORD PTR -264[rbp], -1
	jne	.L11
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L11:
	mov	eax, DWORD PTR -264[rbp]
	movsx	rdx, eax
	lea	rax, -112[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
.L8:
	mov	eax, DWORD PTR -276[rbp]
	lea	edx, 63[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 6
	cdqe
	mov	rsi, QWORD PTR -240[rbp+rax*8]
	mov	eax, DWORD PTR -276[rbp]
	cdq
	shr	edx, 26
	add	eax, edx
	and	eax, 63
	sub	eax, edx
	mov	edx, 1
	mov	ecx, eax
	sal	rdx, cl
	mov	rax, rdx
	and	rax, rsi
	test	rax, rax
	je	.L6
	mov	eax, DWORD PTR -276[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -260[rbp], eax
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -264[rbp]
	movsx	rdx, eax
	lea	rax, -112[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
.L13:
	lea	rcx, -112[rbp]
	mov	eax, DWORD PTR -260[rbp]
	mov	edx, 100
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -264[rbp], eax
	cmp	DWORD PTR -264[rbp], 0
	jg	.L14
	cmp	DWORD PTR -264[rbp], -1
	jne	.L15
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L15:
	mov	eax, DWORD PTR -260[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	jmp	.L6
.L19:
	nop
	mov	eax, DWORD PTR -276[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"1003949.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: %s <port>\000"
	.align	2
.LC1:
	.ascii	"socket\000"
	.align	2
.LC2:
	.ascii	"setsockopt\000"
	.align	2
.LC3:
	.ascii	"bind\000"
	.align	2
.LC4:
	.ascii	"listen\000"
	.align	2
.LC5:
	.ascii	"select\000"
	.align	2
.LC6:
	.ascii	"read\000"
	.align	2
.LC7:
	.ascii	"-- connection accepted --\012\000"
	.align	2
.LC8:
	.ascii	"-- connection closed --\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 280
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #288
	str	r0, [fp, #-280]
	str	r1, [fp, #-284]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-276]
	ldr	r3, [fp, #-280]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-284]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L22+4
	mov	r0, #1
	bl	errx
.L2:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-268]
	ldr	r3, [fp, #-268]
	cmn	r3, #1
	bne	.L3
	ldr	r1, .L22+8
	mov	r0, #1
	bl	err
.L3:
	mov	r3, #2
	strh	r3, [fp, #-252]	@ movhi
	ldr	r3, [fp, #-284]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-250]	@ movhi
	mov	r0, #0
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-248]
	sub	r3, fp, #276
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-268]
	bl	setsockopt
	mov	r3, r0
	cmn	r3, #1
	bne	.L4
	ldr	r1, .L22+12
	mov	r0, #1
	bl	err
.L4:
	sub	r3, fp, #252
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-268]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r1, .L22+16
	mov	r0, #1
	bl	err
.L5:
	mov	r1, #4096
	ldr	r0, [fp, #-268]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r1, .L22+20
	mov	r0, #1
	bl	err
.L6:
	sub	r3, fp, #236
	str	r3, [fp, #-264]
	mov	r3, #0
	str	r3, [fp, #-272]
	b	.L7
.L8:
	ldr	r3, [fp, #-264]
	ldr	r2, [fp, #-272]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-272]
	add	r3, r3, #1
	str	r3, [fp, #-272]
.L7:
	ldr	r3, [fp, #-272]
	cmp	r3, #31
	bls	.L8
	ldr	r3, [fp, #-236]
	orr	r3, r3, #1
	str	r3, [fp, #-236]
	ldr	r3, [fp, #-268]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	mov	r2, r3
	lsl	r3, r2, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r1, [r3, #-232]
	ldr	r3, [fp, #-268]
	rsbs	r0, r3, #0
	and	r3, r3, #31
	and	r0, r0, #31
	rsbpl	r3, r0, #0
	mov	r0, #1
	lsl	r3, r0, r3
	orr	r1, r1, r3
	lsl	r3, r2, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	str	r1, [r3, #-232]
	ldr	r3, [fp, #-268]
	add	r0, r3, #1
	sub	r1, fp, #236
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	bl	select
	mov	r3, r0
	cmn	r3, #1
	bne	.L9
	ldr	r1, .L22+24
	mov	r0, #1
	bl	err
.L9:
	ldr	r3, [fp, #-236]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L10
	sub	r3, fp, #108
	mov	r2, #100
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-260]
	ldr	r3, [fp, #-260]
	cmp	r3, #0
	beq	.L21
	ldr	r3, [fp, #-260]
	cmn	r3, #1
	bne	.L13
	ldr	r1, .L22+28
	mov	r0, #1
	bl	err
.L13:
	ldr	r2, [fp, #-260]
	sub	r3, fp, #108
	mov	r1, r3
	mov	r0, #1
	bl	write
.L10:
	ldr	r3, [fp, #-268]
	add	r2, r3, #31
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #5
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-232]
	ldr	r3, [fp, #-268]
	rsbs	r1, r3, #0
	and	r3, r3, #31
	and	r1, r1, #31
	rsbpl	r3, r1, #0
	mov	r1, #1
	lsl	r3, r1, r3
	and	r3, r3, r2
	cmp	r3, #0
	beq	.L6
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-268]
	bl	accept
	str	r0, [fp, #-256]
	ldr	r3, .L22+32
	ldr	r3, [r3]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L22+36
	bl	fwrite
	b	.L15
.L16:
	ldr	r2, [fp, #-260]
	sub	r3, fp, #108
	mov	r1, r3
	mov	r0, #1
	bl	write
.L15:
	sub	r3, fp, #108
	mov	r2, #100
	mov	r1, r3
	ldr	r0, [fp, #-256]
	bl	read
	str	r0, [fp, #-260]
	ldr	r3, [fp, #-260]
	cmp	r3, #0
	bgt	.L16
	ldr	r3, [fp, #-260]
	cmn	r3, #1
	bne	.L17
	ldr	r1, .L22+28
	mov	r0, #1
	bl	err
.L17:
	ldr	r0, [fp, #-256]
	bl	close
	ldr	r3, .L22+32
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L22+40
	bl	fwrite
	b	.L6
.L21:
	nop
	ldr	r0, [fp, #-268]
	bl	close
	mov	r3, #0
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	stderr
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
