	.file	"51699735.c"
	.intel_syntax noprefix
	.text
	.globl	sigchld_handler
	.type	sigchld_handler, @function
sigchld_handler:
.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
	nop
.L2:
	mov	edx, 1
	mov	esi, 0
	mov	edi, -1
	call	waitpid@PLT
	test	eax, eax
	jg	.L2
	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	sigchld_handler, .-sigchld_handler
	.globl	get_in_addr
	.type	get_in_addr, @function
get_in_addr:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, WORD PTR [rax]
	cmp	ax, 2
	jne	.L4
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
.L5:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_in_addr, .-get_in_addr
	.section	.rodata
.LC0:
	.string	"3490"
.LC1:
	.string	"getaddrinfo: %s\n"
.LC2:
	.string	"server: socket"
.LC3:
	.string	"setsockopt"
.LC4:
	.string	"server: bind"
.LC5:
	.string	"server: failed to bind\n"
.LC6:
	.string	"listen"
.LC7:
	.string	"sigaction"
	.align 8
.LC8:
	.string	"server: waiting for connections.."
.LC9:
	.string	"accept"
	.align 8
.LC10:
	.string	"server: got connection from %s\n"
.LC11:
	.string	"Hello, world!"
.LC12:
	.string	"send"
	.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, 448
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -432[rbp], 1
	lea	rax, -400[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -396[rbp], 0
	mov	DWORD PTR -392[rbp], 1
	mov	DWORD PTR -400[rbp], 1
	lea	rdx, -416[rbp]
	lea	rax, -400[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR -424[rbp], eax
	cmp	DWORD PTR -424[rbp], 0
	je	.L7
	mov	eax, DWORD PTR -424[rbp]
	mov	edi, eax
	call	gai_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
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L24
	jmp	.L25
.L7:
	mov	rax, QWORD PTR -416[rbp]
	mov	QWORD PTR -408[rbp], rax
	jmp	.L9
.L15:
	mov	rax, QWORD PTR -408[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -408[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -408[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -428[rbp], eax
	cmp	DWORD PTR -428[rbp], -1
	jne	.L10
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L11
.L10:
	lea	rdx, -432[rbp]
	mov	eax, DWORD PTR -428[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	cmp	eax, -1
	jne	.L12
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	rax, QWORD PTR -408[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -408[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -428[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L26
	mov	eax, DWORD PTR -428[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC4[rip]
	call	perror@PLT
	nop
.L11:
	mov	rax, QWORD PTR -408[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -408[rbp], rax
.L9:
	cmp	QWORD PTR -408[rbp], 0
	jne	.L15
	jmp	.L14
.L26:
	nop
.L14:
	mov	rax, QWORD PTR -416[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	cmp	QWORD PTR -408[rbp], 0
	jne	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	mov	eax, DWORD PTR -428[rbp]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	lea	rax, sigchld_handler[rip]
	mov	QWORD PTR -224[rbp], rax
	lea	rax, -224[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -88[rbp], 268435456
	lea	rax, -224[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 17
	call	sigaction@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L23:
	mov	DWORD PTR -436[rbp], 128
	lea	rdx, -436[rbp]
	lea	rcx, -352[rbp]
	mov	eax, DWORD PTR -428[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -420[rbp], eax
	cmp	DWORD PTR -420[rbp], -1
	jne	.L19
	lea	rdi, .LC9[rip]
	call	perror@PLT
	jmp	.L20
.L19:
	lea	rax, -352[rbp]
	mov	rdi, rax
	call	get_in_addr
	mov	rsi, rax
	movzx	eax, WORD PTR -352[rbp]
	movzx	eax, ax
	lea	rdx, -64[rbp]
	mov	ecx, 46
	mov	edi, eax
	call	inet_ntop@PLT
	lea	rax, -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	test	eax, eax
	jne	.L21
	mov	eax, DWORD PTR -428[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -420[rbp]
	mov	ecx, 0
	mov	edx, 13
	lea	rsi, .LC11[rip]
	mov	edi, eax
	call	send@PLT
	cmp	rax, -1
	jne	.L22
	lea	rdi, .LC12[rip]
	call	perror@PLT
.L22:
	mov	eax, DWORD PTR -420[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L21:
	mov	eax, DWORD PTR -420[rbp]
	mov	edi, eax
	call	close@PLT
.L20:
	jmp	.L23
.L25:
	call	__stack_chk_fail@PLT
.L24:
	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	"51699735.c"
	.text
	.align	2
	.global	sigchld_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigchld_handler, %function
sigchld_handler:
	@ 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]
	nop
.L2:
	mov	r2, #1
	mov	r1, #0
	mvn	r0, #0
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	bgt	.L2
	bl	__errno_location
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	sigchld_handler, .-sigchld_handler
	.align	2
	.global	get_in_addr
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_in_addr, %function
get_in_addr:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3]
	cmp	r3, #2
	bne	.L4
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	b	.L5
.L4:
	ldr	r3, [fp, #-8]
	add	r3, r3, #8
.L5:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get_in_addr, .-get_in_addr
	.section	.rodata
	.align	2
.LC0:
	.ascii	"3490\000"
	.align	2
.LC1:
	.ascii	"getaddrinfo: %s\012\000"
	.align	2
.LC2:
	.ascii	"server: socket\000"
	.align	2
.LC3:
	.ascii	"setsockopt\000"
	.align	2
.LC4:
	.ascii	"server: bind\000"
	.align	2
.LC5:
	.ascii	"server: failed to bind\012\000"
	.align	2
.LC6:
	.ascii	"listen\000"
	.align	2
.LC7:
	.ascii	"sigaction\000"
	.align	2
.LC8:
	.ascii	"server: waiting for connections..\000"
	.align	2
.LC9:
	.ascii	"accept\000"
	.align	2
.LC10:
	.ascii	"server: got connection from %s\012\000"
	.align	2
.LC11:
	.ascii	"Hello, world!\000"
	.align	2
.LC12:
	.ascii	"send\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 384
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #396
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-384]
	sub	r3, fp, #364
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-360]
	mov	r3, #1
	str	r3, [fp, #-356]
	mov	r3, #1
	str	r3, [fp, #-364]
	sub	r3, fp, #392
	sub	r2, fp, #364
	ldr	r1, .L27+4
	mov	r0, #0
	bl	getaddrinfo
	str	r0, [fp, #-372]
	ldr	r3, [fp, #-372]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L27+8
	ldr	r4, [r3]
	ldr	r0, [fp, #-372]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L27+12
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L24
	b	.L25
.L7:
	ldr	r3, [fp, #-392]
	str	r3, [fp, #-376]
	b	.L9
.L15:
	ldr	r3, [fp, #-376]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-376]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-376]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-380]
	ldr	r3, [fp, #-380]
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L27+16
	bl	perror
	b	.L11
.L10:
	sub	r3, fp, #384
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-380]
	bl	setsockopt
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L27+20
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-376]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-376]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-380]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L26
	ldr	r0, [fp, #-380]
	bl	close
	ldr	r0, .L27+24
	bl	perror
	nop
.L11:
	ldr	r3, [fp, #-376]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-376]
.L9:
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bne	.L15
	b	.L14
.L26:
	nop
.L14:
	ldr	r3, [fp, #-392]
	mov	r0, r3
	bl	freeaddrinfo
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bne	.L16
	ldr	r3, .L27+8
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L27+28
	bl	fwrite
	mov	r0, #1
	bl	exit
.L16:
	mov	r1, #10
	ldr	r0, [fp, #-380]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L27+32
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, .L27+36
	str	r3, [fp, #-204]
	sub	r3, fp, #204
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #268435456
	str	r3, [fp, #-72]
	sub	r3, fp, #204
	mov	r2, #0
	mov	r1, r3
	mov	r0, #17
	bl	sigaction
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L27+40
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	ldr	r0, .L27+44
	bl	puts
.L23:
	mov	r3, #128
	str	r3, [fp, #-388]
	sub	r2, fp, #388
	sub	r3, fp, #332
	mov	r1, r3
	ldr	r0, [fp, #-380]
	bl	accept
	str	r0, [fp, #-368]
	ldr	r3, [fp, #-368]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L27+48
	bl	perror
	b	.L20
.L19:
	sub	r3, fp, #12
	sub	r3, r3, #320
	ldrh	r3, [r3]
	mov	r4, r3
	sub	r3, fp, #332
	mov	r0, r3
	bl	get_in_addr
	mov	r1, r0
	sub	r2, fp, #64
	mov	r3, #46
	mov	r0, r4
	bl	inet_ntop
	sub	r3, fp, #64
	mov	r1, r3
	ldr	r0, .L27+52
	bl	printf
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L21
	ldr	r0, [fp, #-380]
	bl	close
	mov	r3, #0
	mov	r2, #13
	ldr	r1, .L27+56
	ldr	r0, [fp, #-368]
	bl	send
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	ldr	r0, .L27+60
	bl	perror
.L22:
	ldr	r0, [fp, #-368]
	bl	close
	mov	r0, #0
	bl	exit
.L21:
	ldr	r0, [fp, #-368]
	bl	close
.L20:
	b	.L23
.L25:
	bl	__stack_chk_fail
.L24:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC13
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	sigchld_handler
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
