	.file	"108188.c"
	.intel_syntax noprefix
	.text
	.globl	get_in_addr
	.type	get_in_addr, @function
get_in_addr:
.LFB6:
	.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	.L2
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 4
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
.L3:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_in_addr, .-get_in_addr
	.section	.rodata
.LC0:
	.string	"Thread #%d running\n"
	.align 8
.LC1:
	.string	"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %ld\r\n\r\n%s"
.LC2:
	.string	"accept"
	.align 8
.LC3:
	.string	"Thread #%d: got connection from %s\n"
.LC4:
	.string	"send"
	.text
	.globl	req_handler
	.type	req_handler, @function
req_handler:
.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, 448
	mov	QWORD PTR -440[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	pthread_self@PLT
	mov	DWORD PTR -416[rbp], eax
	mov	eax, DWORD PTR -416[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -440[rbp]
	mov	QWORD PTR -408[rbp], rax
	mov	DWORD PTR -420[rbp], 128
	mov	rax, QWORD PTR -408[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -400[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -392[rbp], rax
.L8:
	mov	rax, QWORD PTR -408[rbp]
	mov	eax, DWORD PTR [rax]
	lea	rdx, -420[rbp]
	lea	rcx, -384[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -412[rbp], eax
	cmp	DWORD PTR -412[rbp], -1
	jne	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	jmp	.L6
.L5:
	lea	rax, -384[rbp]
	mov	rdi, rax
	call	get_in_addr
	mov	rsi, rax
	movzx	eax, WORD PTR -384[rbp]
	movzx	eax, ax
	lea	rdx, -256[rbp]
	mov	ecx, 46
	mov	edi, eax
	call	inet_ntop@PLT
	lea	rdx, -256[rbp]
	mov	eax, DWORD PTR -416[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -400[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rcx, rax
	mov	rsi, QWORD PTR -400[rbp]
	mov	rdx, QWORD PTR -392[rbp]
	lea	rax, -208[rbp]
	mov	r8, rsi
	mov	esi, 200
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -208[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rsi, -208[rbp]
	mov	eax, DWORD PTR -412[rbp]
	mov	ecx, 0
	mov	edi, eax
	call	send@PLT
	cmp	rax, -1
	jne	.L7
	lea	rdi, .LC4[rip]
	call	perror@PLT
.L7:
	mov	eax, DWORD PTR -412[rbp]
	mov	edi, eax
	call	close@PLT
.L6:
	jmp	.L8
	.cfi_endproc
.LFE7:
	.size	req_handler, .-req_handler
	.section	.rodata
.LC5:
	.string	"3000"
.LC6:
	.string	"getaddrinfo: %s\n"
.LC7:
	.string	"server: socket"
.LC8:
	.string	"setsockopt"
.LC9:
	.string	"server:bind"
.LC10:
	.string	"server: failed to bind\n"
.LC11:
	.string	"listen"
	.align 8
.LC12:
	.string	"server: waiting for connections..."
.LC13:
	.string	"hello world\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, 192
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -180[rbp], 1
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 0
	mov	QWORD PTR -104[rbp], 0
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -88[rbp], 0
	mov	DWORD PTR -128[rbp], 1
	mov	DWORD PTR -120[rbp], 1
	lea	rdx, -160[rbp]
	lea	rax, -128[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, .LC5[rip]
	mov	edi, 0
	call	getaddrinfo@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	je	.L11
	mov	eax, DWORD PTR -164[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L26
.L11:
	mov	rax, QWORD PTR -160[rbp]
	mov	QWORD PTR -152[rbp], rax
	jmp	.L13
.L19:
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -176[rbp], eax
	cmp	DWORD PTR -176[rbp], -1
	jne	.L14
	lea	rdi, .LC7[rip]
	call	perror@PLT
	jmp	.L15
.L14:
	lea	rdx, -180[rbp]
	mov	eax, DWORD PTR -176[rbp]
	mov	r8d, 4
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	edi, eax
	call	setsockopt@PLT
	cmp	eax, -1
	jne	.L16
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L26
.L16:
	mov	rax, QWORD PTR -152[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -176[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L28
	mov	eax, DWORD PTR -176[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rdi, .LC9[rip]
	call	perror@PLT
	nop
.L15:
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -152[rbp], rax
.L13:
	cmp	QWORD PTR -152[rbp], 0
	jne	.L19
	jmp	.L18
.L28:
	nop
.L18:
	cmp	QWORD PTR -152[rbp], 0
	jne	.L20
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L26
.L20:
	mov	rax, QWORD PTR -160[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR -176[rbp]
	mov	esi, 128
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L21
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L26
.L21:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	DWORD PTR -172[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -176[rbp]
	mov	DWORD PTR -144[rbp], eax
	lea	rax, .LC13[rip]
	mov	QWORD PTR -136[rbp], rax
	lea	rdx, -80[rbp]
	mov	eax, DWORD PTR -172[rbp]
	cdqe
	sal	rax, 3
	lea	rdi, [rdx+rax]
	lea	rax, -144[rbp]
	mov	rcx, rax
	lea	rdx, req_handler[rip]
	mov	esi, 0
	call	pthread_create@PLT
	add	DWORD PTR -172[rbp], 1
.L22:
	cmp	DWORD PTR -172[rbp], 7
	jle	.L23
	mov	DWORD PTR -168[rbp], 0
	jmp	.L24
.L25:
	mov	eax, DWORD PTR -168[rbp]
	cdqe
	mov	rax, QWORD PTR -80[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -168[rbp], 1
.L24:
	cmp	DWORD PTR -168[rbp], 7
	jle	.L25
	mov	eax, DWORD PTR -176[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.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	"108188.c"
	.text
	.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	.L2
	ldr	r3, [fp, #-8]
	add	r3, r3, #4
	b	.L3
.L2:
	ldr	r3, [fp, #-8]
	add	r3, r3, #8
.L3:
	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	"Thread #%d running\012\000"
	.align	2
.LC1:
	.ascii	"HTTP/1.1 200 OK\015\012Content-Type: text/html; cha"
	.ascii	"rset=utf-8\015\012Content-Length: %ld\015\012\015\012"
	.ascii	"%s\000"
	.align	2
.LC2:
	.ascii	"accept\000"
	.align	2
.LC3:
	.ascii	"Thread #%d: got connection from %s\012\000"
	.align	2
.LC4:
	.ascii	"send\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	req_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	req_handler, %function
req_handler:
	@ args = 0, pretend = 0, frame = 416
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #428
	str	r0, [fp, #-424]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	pthread_self
	mov	r3, r0
	str	r3, [fp, #-412]
	ldr	r1, [fp, #-412]
	ldr	r0, .L10+4
	bl	printf
	ldr	r3, [fp, #-424]
	str	r3, [fp, #-408]
	mov	r3, #128
	str	r3, [fp, #-416]
	ldr	r3, [fp, #-408]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-404]
	ldr	r3, .L10+8
	str	r3, [fp, #-400]
.L8:
	ldr	r3, [fp, #-408]
	ldr	r3, [r3]
	sub	r2, fp, #416
	sub	r1, fp, #392
	mov	r0, r3
	bl	accept
	str	r0, [fp, #-396]
	ldr	r3, [fp, #-396]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L10+12
	bl	perror
	b	.L6
.L5:
	sub	r3, fp, #12
	sub	r3, r3, #380
	ldrh	r3, [r3]
	mov	r4, r3
	sub	r3, fp, #392
	mov	r0, r3
	bl	get_in_addr
	mov	r1, r0
	sub	r2, fp, #264
	mov	r3, #46
	mov	r0, r4
	bl	inet_ntop
	sub	r3, fp, #264
	mov	r2, r3
	ldr	r1, [fp, #-412]
	ldr	r0, .L10+16
	bl	printf
	ldr	r0, [fp, #-404]
	bl	strlen
	mov	r2, r0
	sub	r0, fp, #216
	ldr	r3, [fp, #-404]
	str	r3, [sp]
	mov	r3, r2
	ldr	r2, [fp, #-400]
	mov	r1, #200
	bl	snprintf
	sub	r3, fp, #216
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r1, fp, #216
	mov	r3, #0
	ldr	r0, [fp, #-396]
	bl	send
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L10+20
	bl	perror
.L7:
	ldr	r0, [fp, #-396]
	bl	close
.L6:
	b	.L8
.L11:
	.align	2
.L10:
	.word	.LC5
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	req_handler, .-req_handler
	.section	.rodata
	.align	2
.LC6:
	.ascii	"3000\000"
	.align	2
.LC7:
	.ascii	"getaddrinfo: %s\012\000"
	.align	2
.LC8:
	.ascii	"server: socket\000"
	.align	2
.LC9:
	.ascii	"setsockopt\000"
	.align	2
.LC10:
	.ascii	"server:bind\000"
	.align	2
.LC11:
	.ascii	"server: failed to bind\012\000"
	.align	2
.LC12:
	.ascii	"listen\000"
	.align	2
.LC13:
	.ascii	"server: waiting for connections...\000"
	.align	2
.LC14:
	.ascii	"hello world\012\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 = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #116
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-112]
	sub	r3, fp, #80
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #1
	str	r3, [fp, #-80]
	mov	r3, #1
	str	r3, [fp, #-72]
	sub	r3, fp, #116
	sub	r2, fp, #80
	ldr	r1, .L31+4
	mov	r0, #0
	bl	getaddrinfo
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	beq	.L13
	ldr	r3, .L31+8
	ldr	r4, [r3]
	ldr	r0, [fp, #-92]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L31+12
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L28
.L13:
	ldr	r3, [fp, #-116]
	str	r3, [fp, #-104]
	b	.L15
.L21:
	ldr	r3, [fp, #-104]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-104]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-104]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L31+16
	bl	perror
	b	.L17
.L16:
	sub	r3, fp, #112
	mov	r2, #4
	str	r2, [sp]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, [fp, #-108]
	bl	setsockopt
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r0, .L31+20
	bl	perror
	mov	r3, #1
	b	.L28
.L18:
	ldr	r3, [fp, #-104]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-104]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-108]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L30
	ldr	r0, [fp, #-108]
	bl	close
	ldr	r0, .L31+24
	bl	perror
	nop
.L17:
	ldr	r3, [fp, #-104]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-104]
.L15:
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L21
	b	.L20
.L30:
	nop
.L20:
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bne	.L22
	ldr	r3, .L31+8
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L31+28
	bl	fwrite
	mov	r3, #2
	b	.L28
.L22:
	ldr	r3, [fp, #-116]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r1, #128
	ldr	r0, [fp, #-108]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L23
	ldr	r0, .L31+32
	bl	perror
	mov	r3, #1
	b	.L28
.L23:
	ldr	r0, .L31+36
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-100]
	b	.L24
.L25:
	sub	r2, fp, #48
	ldr	r3, [fp, #-100]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-108]
	str	r3, [fp, #-88]
	ldr	r3, .L31+40
	str	r3, [fp, #-84]
	sub	r3, fp, #88
	ldr	r2, .L31+44
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L24:
	ldr	r3, [fp, #-100]
	cmp	r3, #7
	ble	.L25
	mov	r3, #0
	str	r3, [fp, #-96]
	b	.L26
.L27:
	ldr	r3, [fp, #-96]
	lsl	r3, r3, #2
	sub	r2, fp, #12
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-96]
	add	r3, r3, #1
	str	r3, [fp, #-96]
.L26:
	ldr	r3, [fp, #-96]
	cmp	r3, #7
	ble	.L27
	ldr	r0, [fp, #-108]
	bl	close
	mov	r3, #0
.L28:
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L29
	bl	__stack_chk_fail
.L29:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC15
	.word	.LC6
	.word	stderr
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	req_handler
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
