	.file	"338465.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"%s -p port\n"
	.text
	.type	usage, @function
usage:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	usage, .-usage
	.section	.rodata
.LC1:
	.string	"client socket failed"
.LC2:
	.string	"connect failed"
	.text
	.type	connect_client, @function
connect_client:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -32[rbp], 2
	mov	edi, 2130706433
	call	htonl@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	jns	.L3
	lea	rsi, .LC1[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L3:
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L4
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L4:
	call	pause@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	connect_client, .-connect_client
	.section	.rodata
.LC3:
	.string	"invalid -p %s"
.LC4:
	.string	"p:"
.LC5:
	.string	"socket failed"
.LC6:
	.string	"bind failed"
.LC7:
	.string	"listen failed"
.LC8:
	.string	"fork failed"
.LC9:
	.string	"accept4 failed"
.LC10:
	.string	"%d"
.LC11:
	.string	"checkfd"
.LC12:
	.string	"/usr/local/bin/checkfd"
.LC13:
	.string	"waitpid failed"
.LC14:
	.string	"not exited"
.LC15:
	.string	"exit code %d"
.LC16:
	.string	"passed\n"
	.text
	.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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -68[rbp], 0
	jmp	.L7
.L11:
	cmp	DWORD PTR -60[rbp], 112
	jne	.L8
	mov	rax, QWORD PTR optarg[rip]
	lea	rcx, -40[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	strtol@PLT
	mov	DWORD PTR -68[rbp], eax
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L27
	mov	rax, QWORD PTR optarg[rip]
	mov	rdx, rax
	lea	rsi, .LC3[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L8:
	mov	rax, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
	jmp	.L7
.L27:
	nop
.L7:
	mov	rcx, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR -84[rbp]
	lea	rdx, .LC4[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], -1
	jne	.L11
	cmp	DWORD PTR -68[rbp], 0
	jg	.L12
	mov	rax, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	usage
.L12:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], 0
	jns	.L13
	lea	rsi, .LC5[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L13:
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -32[rbp], 2
	mov	eax, DWORD PTR -68[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -56[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L14
	lea	rsi, .LC6[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L14:
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, 0
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L15
	lea	rsi, .LC7[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L15:
	call	fork@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L16
	lea	rsi, .LC8[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L16:
	cmp	DWORD PTR -52[rbp], 0
	jne	.L17
	mov	eax, DWORD PTR -68[rbp]
	mov	edi, eax
	call	connect_client
	call	abort@PLT
.L17:
	mov	eax, DWORD PTR -56[rbp]
	mov	ecx, 524288
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	accept4@PLT
	mov	DWORD PTR -48[rbp], eax
	cmp	DWORD PTR -48[rbp], 0
	jns	.L18
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -64[rbp], eax
	jmp	.L19
.L18:
	mov	DWORD PTR -64[rbp], 0
.L19:
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
	lea	rcx, -40[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	cmp	DWORD PTR -64[rbp], 0
	je	.L20
	mov	eax, DWORD PTR -64[rbp]
	lea	rdx, .LC9[rip]
	mov	esi, eax
	mov	edi, 1
	mov	eax, 0
	call	errc@PLT
.L20:
	call	fork@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jns	.L21
	lea	rsi, .LC8[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L21:
	cmp	DWORD PTR -52[rbp], 0
	jne	.L22
	mov	edx, DWORD PTR -48[rbp]
	lea	rax, -16[rbp]
	mov	ecx, edx
	lea	rdx, .LC10[rip]
	mov	esi, 8
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -16[rbp]
	mov	ecx, 0
	mov	rdx, rax
	lea	rsi, .LC11[rip]
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	execl@PLT
.L22:
	lea	rcx, -40[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	waitpid@PLT
	test	eax, eax
	jns	.L23
	lea	rsi, .LC13[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L23:
	mov	eax, DWORD PTR -40[rbp]
	and	eax, 127
	test	eax, eax
	je	.L24
	lea	rsi, .LC14[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L24:
	mov	eax, DWORD PTR -40[rbp]
	sar	eax, 8
	and	eax, 255
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	je	.L25
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	warnx@PLT
	call	abort@PLT
.L25:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 7
	mov	esi, 1
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	mov	edi, 0
	call	exit@PLT
	.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	"338465.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s -p port\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usage, %function
usage:
	@ 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]
	ldr	r3, .L2
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L2+4
	mov	r0, r3
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	.align	2
.L2:
	.word	stderr
	.word	.LC0
	.size	usage, .-usage
	.section	.rodata
	.align	2
.LC1:
	.ascii	"client socket failed\000"
	.align	2
.LC2:
	.ascii	"connect failed\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	connect_client, %function
connect_client:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldr	r0, .L8+4
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L5
	ldr	r1, .L8+8
	mov	r0, #1
	bl	err
.L5:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-28]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L6
	ldr	r1, .L8+12
	mov	r0, #1
	bl	err
.L6:
	bl	pause
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	.LC3
	.word	2130706433
	.word	.LC1
	.word	.LC2
	.size	connect_client, .-connect_client
	.section	.rodata
	.align	2
.LC4:
	.ascii	"invalid -p %s\000"
	.align	2
.LC5:
	.ascii	"p:\000"
	.align	2
.LC6:
	.ascii	"socket failed\000"
	.align	2
.LC7:
	.ascii	"bind failed\000"
	.align	2
.LC8:
	.ascii	"listen failed\000"
	.align	2
.LC9:
	.ascii	"fork failed\000"
	.align	2
.LC10:
	.ascii	"accept4 failed\000"
	.align	2
.LC11:
	.ascii	"%d\000"
	.align	2
.LC12:
	.ascii	"checkfd\000"
	.align	2
.LC13:
	.ascii	"/usr/local/bin/checkfd\000"
	.align	2
.LC14:
	.ascii	"waitpid failed\000"
	.align	2
.LC15:
	.ascii	"not exited\000"
	.align	2
.LC16:
	.ascii	"exit code %d\000"
	.align	2
.LC17:
	.ascii	"passed\012\000"
	.align	2
.LC18:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L32
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L11
.L15:
	ldr	r3, [fp, #-52]
	cmp	r3, #112
	bne	.L12
	ldr	r3, .L32+4
	ldr	r3, [r3]
	sub	r1, fp, #64
	mov	r2, #0
	mov	r0, r3
	bl	strtol
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L31
	ldr	r3, .L32+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L32+8
	mov	r0, #1
	bl	errx
.L12:
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
	b	.L11
.L31:
	nop
.L11:
	ldr	r2, .L32+12
	ldr	r1, [fp, #-76]
	ldr	r0, [fp, #-72]
	bl	getopt
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	bne	.L15
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	bgt	.L16
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	mov	r0, r3
	bl	usage
.L16:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L17
	ldr	r1, .L32+16
	mov	r0, #1
	bl	err
.L17:
	sub	r3, fp, #32
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-32]	@ movhi
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-30]	@ movhi
	sub	r3, fp, #32
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-48]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L18
	ldr	r1, .L32+20
	mov	r0, #1
	bl	err
.L18:
	mov	r1, #0
	ldr	r0, [fp, #-48]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L19
	ldr	r1, .L32+24
	mov	r0, #1
	bl	err
.L19:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L20
	ldr	r1, .L32+28
	mov	r0, #1
	bl	err
.L20:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L21
	ldr	r0, [fp, #-60]
	bl	connect_client
	bl	abort
.L21:
	mov	r3, #524288
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-48]
	bl	accept4
	str	r0, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bge	.L22
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-56]
	b	.L23
.L22:
	mov	r3, #0
	str	r3, [fp, #-56]
.L23:
	mov	r1, #9
	ldr	r0, [fp, #-44]
	bl	kill
	sub	r3, fp, #64
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	waitpid
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	beq	.L24
	ldr	r2, .L32+32
	ldr	r1, [fp, #-56]
	mov	r0, #1
	bl	errc
.L24:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bge	.L25
	ldr	r1, .L32+28
	mov	r0, #1
	bl	err
.L25:
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L26
	sub	r0, fp, #16
	ldr	r3, [fp, #-40]
	ldr	r2, .L32+36
	mov	r1, #8
	bl	snprintf
	sub	r2, fp, #16
	mov	r3, #0
	ldr	r1, .L32+40
	ldr	r0, .L32+44
	bl	execl
.L26:
	sub	r3, fp, #64
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-44]
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	bge	.L27
	ldr	r1, .L32+48
	mov	r0, #1
	bl	err
.L27:
	ldr	r3, [fp, #-64]
	and	r3, r3, #127
	cmp	r3, #0
	beq	.L28
	ldr	r1, .L32+52
	mov	r0, #1
	bl	errx
.L28:
	ldr	r3, [fp, #-64]
	asr	r3, r3, #8
	and	r3, r3, #255
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L29
	ldr	r1, [fp, #-36]
	ldr	r0, .L32+56
	bl	warnx
	bl	abort
.L29:
	ldr	r3, .L32+60
	ldr	r3, [r3]
	mov	r2, #7
	mov	r1, #1
	ldr	r0, .L32+64
	bl	fwrite
	mov	r0, #0
	bl	exit
.L33:
	.align	2
.L32:
	.word	.LC18
	.word	optarg
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	stderr
	.word	.LC17
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
