	.file	"646438.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, 16
	mov	DWORD PTR -4[rbp], edi
	nop
.L2:
	mov	edx, 1
	mov	esi, 0
	mov	edi, -1
	call	waitpid@PLT
	test	eax, eax
	jg	.L2
	nop
	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	"25"
.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	"recv"
.LC12:
	.string	"numbytes=%d, buf size=%d\n"
.LC13:
	.string	"recv: %s\n"
.LC14:
	.string	"%x "
	.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, 1952
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -1944[rbp], 1
	lea	rax, -1904[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -1900[rbp], 0
	mov	DWORD PTR -1896[rbp], 1
	mov	DWORD PTR -1904[rbp], 1
	lea	rdx, -1920[rbp]
	lea	rax, -1904[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC0[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR -1932[rbp], eax
	cmp	DWORD PTR -1932[rbp], 0
	je	.L7
	mov	eax, DWORD PTR -1932[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
	jmp	.L26
.L7:
	mov	rax, QWORD PTR -1920[rbp]
	mov	QWORD PTR -1912[rbp], rax
	jmp	.L9
.L15:
	mov	rax, QWORD PTR -1912[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -1912[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -1912[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -1940[rbp], eax
	cmp	DWORD PTR -1940[rbp], -1
	jne	.L10
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L11
.L10:
	lea	rdx, -1944[rbp]
	mov	eax, DWORD PTR -1940[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 -1912[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -1912[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -1940[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L28
	mov	eax, DWORD PTR -1940[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC4[rip]
	call	perror@PLT
	nop
.L11:
	mov	rax, QWORD PTR -1912[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -1912[rbp], rax
.L9:
	cmp	QWORD PTR -1912[rbp], 0
	jne	.L15
	jmp	.L14
.L28:
	nop
.L14:
	cmp	QWORD PTR -1912[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	eax, 2
	jmp	.L26
.L16:
	mov	rax, QWORD PTR -1920[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR -1940[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 -1728[rbp], rax
	lea	rax, -1728[rbp]
	add	rax, 8
	mov	rdi, rax
	call	sigemptyset@PLT
	mov	DWORD PTR -1592[rbp], 268435456
	lea	rax, -1728[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
.L25:
	mov	DWORD PTR -1948[rbp], 128
	lea	rdx, -1948[rbp]
	lea	rcx, -1856[rbp]
	mov	eax, DWORD PTR -1940[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -1928[rbp], eax
	cmp	DWORD PTR -1928[rbp], -1
	jne	.L19
	lea	rdi, .LC9[rip]
	call	perror@PLT
	jmp	.L20
.L19:
	lea	rax, -1856[rbp]
	mov	rdi, rax
	call	get_in_addr
	mov	rsi, rax
	movzx	eax, WORD PTR -1856[rbp]
	movzx	eax, ax
	lea	rdx, -1568[rbp]
	mov	ecx, 46
	mov	edi, eax
	call	inet_ntop@PLT
	lea	rax, -1568[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 -1940[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rsi, -1520[rbp]
	mov	eax, DWORD PTR -1928[rbp]
	mov	ecx, 0
	mov	edx, 1500
	mov	edi, eax
	call	recv@PLT
	shr	rax, 63
	movzx	eax, al
	mov	DWORD PTR -1924[rbp], eax
	cmp	DWORD PTR -1924[rbp], 0
	je	.L22
	lea	rdi, .LC11[rip]
	call	perror@PLT
.L22:
	mov	eax, DWORD PTR -1924[rbp]
	mov	edx, 1500
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -1520[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -1936[rbp], 0
	jmp	.L23
.L24:
	mov	eax, DWORD PTR -1936[rbp]
	cdqe
	movzx	eax, BYTE PTR -1520[rbp+rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -1936[rbp], 1
.L23:
	cmp	DWORD PTR -1936[rbp], 12
	jle	.L24
	mov	edi, 0
	call	exit@PLT
.L21:
	mov	eax, DWORD PTR -1928[rbp]
	mov	edi, eax
	call	close@PLT
.L20:
	jmp	.L25
.L26:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	"646438.c"
	.text
	.align	2
	.global	sigchld_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	sigchld_handler, %function
sigchld_handler:
	@ 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]
	nop
.L2:
	mov	r2, #1
	mov	r1, #0
	mvn	r0, #0
	bl	waitpid
	mov	r3, r0
	cmp	r3, #0
	bgt	.L2
	nop
	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	"25\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	"recv\000"
	.align	2
.LC12:
	.ascii	"numbytes=%d, buf size=%d\012\000"
	.align	2
.LC13:
	.ascii	"recv: %s\012\000"
	.align	2
.LC14:
	.ascii	"%x \000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1888
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #1888
	sub	sp, sp, #12
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-1892]
	sub	r3, fp, #1840
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-1860]
	mov	r3, #1
	str	r3, [fp, #-1856]
	mov	r3, #1
	str	r3, [fp, #-1864]
	sub	r3, fp, #1888
	sub	r3, r3, #12
	sub	r2, fp, #1840
	sub	r2, r2, #12
	sub	r2, r2, #12
	ldr	r1, .L29+4
	mov	r0, #0
	bl	getaddrinfo
	str	r0, [fp, #-1876]
	ldr	r3, [fp, #-1876]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L29+8
	ldr	r4, [r3]
	ldr	r0, [fp, #-1876]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L29+12
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L26
.L7:
	ldr	r3, [fp, #-1900]
	str	r3, [fp, #-1884]
	b	.L9
.L15:
	ldr	r3, [fp, #-1884]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-1884]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-1884]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-1888]
	ldr	r3, [fp, #-1888]
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L29+16
	bl	perror
	b	.L11
.L10:
	sub	r3, fp, #1872
	sub	r3, r3, #12
	sub	r3, r3, #8
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-1888]
	bl	setsockopt
	mov	r3, r0
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L29+20
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-1884]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-1884]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-1888]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L28
	ldr	r0, [fp, #-1888]
	bl	close
	ldr	r0, .L29+24
	bl	perror
	nop
.L11:
	ldr	r3, [fp, #-1884]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-1884]
.L9:
	ldr	r3, [fp, #-1884]
	cmp	r3, #0
	bne	.L15
	b	.L14
.L28:
	nop
.L14:
	ldr	r3, [fp, #-1884]
	cmp	r3, #0
	bne	.L16
	ldr	r3, .L29+8
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L29+28
	bl	fwrite
	mov	r3, #2
	b	.L26
.L16:
	ldr	r3, [fp, #-1900]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r1, #10
	ldr	r0, [fp, #-1888]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L29+32
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, .L29+36
	str	r3, [fp, #-1704]
	sub	r3, fp, #1680
	sub	r3, r3, #12
	sub	r3, r3, #12
	add	r3, r3, #4
	mov	r0, r3
	bl	sigemptyset
	mov	r3, #268435456
	str	r3, [fp, #-1572]
	sub	r3, fp, #1680
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, r3
	mov	r0, #17
	bl	sigaction
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L29+40
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	ldr	r0, .L29+44
	bl	puts
.L25:
	mov	r3, #128
	str	r3, [fp, #-1896]
	sub	r2, fp, #1872
	sub	r2, r2, #12
	sub	r2, r2, #12
	sub	r3, fp, #1808
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r1, r3
	ldr	r0, [fp, #-1888]
	bl	accept
	str	r0, [fp, #-1872]
	ldr	r3, [fp, #-1872]
	cmn	r3, #1
	bne	.L19
	ldr	r0, .L29+48
	bl	perror
	b	.L20
.L19:
	sub	r3, fp, #12
	sub	r3, r3, #1808
	sub	r3, r3, #12
	ldrh	r3, [r3]
	mov	r4, r3
	sub	r3, fp, #1808
	sub	r3, r3, #12
	sub	r3, r3, #12
	mov	r0, r3
	bl	get_in_addr
	mov	r1, r0
	sub	r2, fp, #1552
	sub	r2, r2, #12
	mov	r3, #46
	mov	r0, r4
	bl	inet_ntop
	sub	r3, fp, #1552
	sub	r3, r3, #12
	mov	r1, r3
	ldr	r0, .L29+52
	bl	printf
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L21
	ldr	r0, [fp, #-1888]
	bl	close
	sub	r1, fp, #1504
	sub	r1, r1, #12
	mov	r3, #0
	ldr	r2, .L29+56
	ldr	r0, [fp, #-1872]
	bl	recv
	mov	r3, r0
	lsr	r3, r3, #31
	and	r3, r3, #255
	str	r3, [fp, #-1868]
	ldr	r3, [fp, #-1868]
	cmp	r3, #0
	beq	.L22
	ldr	r0, .L29+60
	bl	perror
.L22:
	ldr	r2, .L29+56
	ldr	r1, [fp, #-1868]
	ldr	r0, .L29+64
	bl	printf
	sub	r3, fp, #1504
	sub	r3, r3, #12
	mov	r1, r3
	ldr	r0, .L29+68
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-1880]
	b	.L23
.L24:
	sub	r2, fp, #1504
	sub	r2, r2, #12
	ldr	r3, [fp, #-1880]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L29+72
	bl	printf
	ldr	r3, [fp, #-1880]
	add	r3, r3, #1
	str	r3, [fp, #-1880]
.L23:
	ldr	r3, [fp, #-1880]
	cmp	r3, #12
	ble	.L24
	mov	r0, #0
	bl	exit
.L21:
	ldr	r0, [fp, #-1872]
	bl	close
.L20:
	b	.L25
.L26:
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC15
	.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	1500
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
