	.file	"873516.c"
	.intel_syntax noprefix
	.text
	.type	socket_close, @function
socket_close:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	close@PLT
	call	__errno_location@PLT
	mov	edx, DWORD PTR -4[rbp]
	mov	DWORD PTR [rax], edx
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	socket_close, .-socket_close
	.type	socket_loopback_server, @function
socket_loopback_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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	DWORD PTR -56[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR -56[rbp]
	mov	edx, 0
	mov	esi, eax
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L3
	mov	eax, -1
	jmp	.L11
.L3:
	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 -52[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	mov	edi, 2130706433
	call	htonl@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	DWORD PTR -48[rbp], 1
	lea	rdx, -48[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
.L6:
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	mov	DWORD PTR -40[rbp], eax
	cmp	DWORD PTR -40[rbp], -1
	jne	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L6
.L5:
	mov	eax, DWORD PTR -40[rbp]
	test	eax, eax
	jns	.L7
	mov	eax, DWORD PTR -44[rbp]
	mov	edi, eax
	call	socket_close
	mov	eax, -1
	jmp	.L11
.L7:
	cmp	DWORD PTR -56[rbp], 1
	jne	.L8
.L10:
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, 4
	mov	edi, eax
	call	listen@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L10
.L9:
	mov	eax, DWORD PTR -36[rbp]
	test	eax, eax
	jns	.L8
	mov	eax, DWORD PTR -44[rbp]
	mov	edi, eax
	call	socket_close
	mov	eax, -1
	jmp	.L11
.L8:
	mov	eax, DWORD PTR -44[rbp]
.L11:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	socket_loopback_server, .-socket_loopback_server
	.section	.rodata
	.align 8
.LC0:
	.string	"Starting pipe test server on local port %d\n"
.LC1:
	.string	"Could not start server: %s\n"
.LC2:
	.string	"Server error: %s\n"
.LC3:
	.string	"Client connected!"
.LC4:
	.string	"Client read error: %s\n"
.LC5:
	.string	"Client closed connection"
	.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -8236[rbp], 8012
	mov	eax, DWORD PTR -8236[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -8236[rbp]
	mov	esi, 1
	mov	edi, eax
	call	socket_loopback_server
	mov	DWORD PTR -8232[rbp], eax
	cmp	DWORD PTR -8232[rbp], 0
	jns	.L24
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L15
.L24:
	nop
.L14:
.L17:
	mov	eax, DWORD PTR -8232[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -8228[rbp], eax
	cmp	DWORD PTR -8228[rbp], -1
	jne	.L16
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L17
.L16:
	mov	eax, DWORD PTR -8228[rbp]
	mov	DWORD PTR -8224[rbp], eax
	cmp	DWORD PTR -8224[rbp], 0
	jns	.L18
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 2
	jmp	.L15
.L18:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L20:
	lea	rcx, -8208[rbp]
	mov	eax, DWORD PTR -8224[rbp]
	mov	edx, 8192
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -8216[rbp], rax
	cmp	QWORD PTR -8216[rbp], -1
	jne	.L19
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	je	.L20
.L19:
	mov	rax, QWORD PTR -8216[rbp]
	mov	DWORD PTR -8220[rbp], eax
	cmp	DWORD PTR -8220[rbp], 0
	jns	.L21
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -8224[rbp]
	mov	edi, eax
	call	socket_close
	mov	eax, 3
	jmp	.L15
.L21:
	cmp	DWORD PTR -8220[rbp], 0
	jne	.L20
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -8224[rbp]
	mov	edi, eax
	call	socket_close
	jmp	.L17
.L15:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"873516.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	socket_close, %function
socket_close:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	close
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	socket_close, .-socket_close
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	socket_loopback_server, %function
socket_loopback_server:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	ldr	r1, [fp, #-52]
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bge	.L3
	mvn	r3, #0
	b	.L11
.L3:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	ldr	r0, .L13+4
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-40]
	sub	r3, fp, #40
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-36]
	bl	setsockopt
.L6:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	bind
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmn	r3, #1
	bne	.L5
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L6
.L5:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bge	.L7
	ldr	r0, [fp, #-36]
	bl	socket_close
	mvn	r3, #0
	b	.L11
.L7:
	ldr	r3, [fp, #-52]
	cmp	r3, #1
	bne	.L8
.L10:
	mov	r1, #4
	ldr	r0, [fp, #-36]
	bl	listen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L10
.L9:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L8
	ldr	r0, [fp, #-36]
	bl	socket_close
	mvn	r3, #0
	b	.L11
.L8:
	ldr	r3, [fp, #-36]
.L11:
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	2130706433
	.size	socket_loopback_server, .-socket_loopback_server
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Starting pipe test server on local port %d\012\000"
	.align	2
.LC2:
	.ascii	"Could not start server: %s\012\000"
	.align	2
.LC3:
	.ascii	"Server error: %s\012\000"
	.align	2
.LC4:
	.ascii	"Client connected!\000"
	.align	2
.LC5:
	.ascii	"Client read error: %s\012\000"
	.align	2
.LC6:
	.ascii	"Client closed connection\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8224
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #8192
	sub	sp, sp, #36
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L26+4
	str	r3, [r2, #-28]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, [r3, #-28]
	ldr	r0, .L26+8
	bl	printf
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r1, #1
	ldr	r0, [r3, #-28]
	bl	socket_loopback_server
	str	r0, [r4, #-24]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-24]
	cmp	r3, #0
	bge	.L25
	ldr	r3, .L26+12
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L26+16
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L17
.L25:
	nop
.L16:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [r3, #-24]
	bl	accept
	str	r0, [r4, #-20]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	cmn	r3, #1
	bne	.L18
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L25
.L18:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	str	r3, [r2, #-16]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-16]
	cmp	r3, #0
	bge	.L19
	ldr	r3, .L26+12
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L26+20
	mov	r0, r4
	bl	fprintf
	mov	r3, #2
	b	.L17
.L19:
	ldr	r0, .L26+24
	bl	puts
.L21:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #8192
	mov	r1, r3
	ldr	r0, [r0, #-16]
	bl	read
	str	r0, [r4, #-12]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	cmn	r3, #1
	bne	.L20
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	beq	.L21
.L20:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-12]
	sub	r2, fp, #8192
	sub	r2, r2, #12
	str	r3, [r2, #-8]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, #0
	bge	.L22
	ldr	r3, .L26+12
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L26+28
	mov	r0, r4
	bl	fprintf
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-16]
	bl	socket_close
	mov	r3, #3
	b	.L17
.L22:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, #0
	bne	.L21
	ldr	r0, .L26+32
	bl	puts
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-16]
	bl	socket_close
	b	.L16
.L17:
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC7
	.word	8012
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
