	.file	"224393.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"port invalid\n"
.LC1:
	.string	"unable to open logfile\n"
.LC2:
	.string	"addrinfo error\n"
.LC3:
	.string	"socket creation failed\n"
.LC4:
	.string	"could not bind to host\n"
.LC5:
	.string	"listen error\n"
	.align 8
.LC6:
	.string	"server waiting for connections\n"
.LC7:
	.string	"accept error\n"
.LC8:
	.string	"fork error\n"
	.align 8
.LC9:
	.string	"forked child for new connection\n"
.LC10:
	.string	"new connection\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 240
	mov	DWORD PTR -228[rbp], edi
	mov	QWORD PTR -240[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -228[rbp], 1
	jg	.L2
	mov	edx, 13
	lea	rsi, .LC0[rip]
	mov	edi, 2
	call	write@PLT
	mov	eax, 1
	jmp	.L16
.L2:
	cmp	DWORD PTR -228[rbp], 2
	jle	.L4
	mov	rax, QWORD PTR -240[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, 420
	mov	esi, 1089
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -216[rbp], eax
	cmp	DWORD PTR -216[rbp], 0
	jns	.L5
	mov	edx, 23
	lea	rsi, .LC1[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L4
.L5:
	mov	edi, 2
	call	close@PLT
	mov	eax, DWORD PTR -216[rbp]
	mov	edi, eax
	call	dup@PLT
	mov	eax, DWORD PTR -216[rbp]
	mov	edi, eax
	call	close@PLT
.L4:
	lea	rax, -192[rbp]
	mov	edx, 48
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -188[rbp], 0
	mov	DWORD PTR -184[rbp], 1
	mov	DWORD PTR -192[rbp], 1
	mov	rax, QWORD PTR -240[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rcx, -200[rbp]
	lea	rdx, -192[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	getaddrinfo@PLT
	test	eax, eax
	je	.L6
	mov	edx, 15
	lea	rsi, .LC2[rip]
	mov	edi, 2
	call	write@PLT
	mov	eax, 2
	jmp	.L16
.L6:
	mov	rax, QWORD PTR -200[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -200[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -200[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -212[rbp], eax
	cmp	DWORD PTR -212[rbp], 0
	jns	.L7
	mov	edx, 23
	lea	rsi, .LC3[rip]
	mov	edi, 2
	call	write@PLT
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 3
	jmp	.L16
.L7:
	mov	rax, QWORD PTR -200[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -200[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -212[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L8
	mov	edx, 23
	lea	rsi, .LC4[rip]
	mov	edi, 2
	call	write@PLT
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, 4
	jmp	.L16
.L8:
	mov	rax, QWORD PTR -200[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	mov	eax, DWORD PTR -212[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	jns	.L9
	mov	edx, 13
	lea	rsi, .LC5[rip]
	mov	edi, 2
	call	write@PLT
	mov	eax, 5
	jmp	.L16
.L9:
	mov	edx, 31
	lea	rsi, .LC6[rip]
	mov	edi, 2
	call	write@PLT
.L15:
	mov	DWORD PTR -224[rbp], 128
	lea	rdx, -224[rbp]
	lea	rcx, -144[rbp]
	mov	eax, DWORD PTR -212[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -208[rbp], eax
	cmp	DWORD PTR -208[rbp], 0
	jns	.L10
	mov	edx, 13
	lea	rsi, .LC7[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L14
.L10:
	call	fork@PLT
	mov	DWORD PTR -204[rbp], eax
	cmp	DWORD PTR -204[rbp], 0
	jns	.L12
	mov	edx, 11
	lea	rsi, .LC8[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L14
.L12:
	cmp	DWORD PTR -204[rbp], 0
	je	.L13
	mov	edx, 32
	lea	rsi, .LC9[rip]
	mov	edi, 2
	call	write@PLT
	mov	eax, DWORD PTR -208[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rax, -220[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, -1
	call	waitpid@PLT
	jmp	.L15
.L13:
	mov	edx, 15
	lea	rsi, .LC10[rip]
	mov	edi, 2
	call	write@PLT
	mov	eax, DWORD PTR -212[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -208[rbp]
	mov	edi, eax
	call	capitalize
	mov	eax, DWORD PTR -208[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	jmp	.L16
.L14:
	jmp	.L15
.L16:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC11:
	.string	"connection closed\n"
.LC12:
	.string	"read error\n"
	.text
	.type	capitalize, @function
capitalize:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	DWORD PTR -116[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L26:
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -116[rbp]
	mov	edx, 80
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -100[rbp], eax
	cmp	DWORD PTR -100[rbp], 0
	jne	.L19
	mov	edx, 18
	lea	rsi, .LC11[rip]
	mov	edi, 2
	call	write@PLT
	nop
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L27
	jmp	.L28
.L19:
	cmp	DWORD PTR -100[rbp], 0
	jns	.L21
	mov	edx, 11
	lea	rsi, .LC12[rip]
	mov	edi, 2
	call	write@PLT
	jmp	.L22
.L21:
	mov	DWORD PTR -104[rbp], 0
.L25:
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	movzx	eax, BYTE PTR -96[rbp+rax]
	test	al, al
	je	.L23
	cmp	DWORD PTR -104[rbp], 79
	jg	.L23
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	movzx	eax, BYTE PTR -96[rbp+rax]
	cmp	al, 96
	jle	.L24
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	movzx	eax, BYTE PTR -96[rbp+rax]
	cmp	al, 122
	jg	.L24
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	movzx	eax, BYTE PTR -96[rbp+rax]
	sub	eax, 32
	mov	edx, eax
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	mov	BYTE PTR -96[rbp+rax], dl
.L24:
	add	DWORD PTR -104[rbp], 1
	jmp	.L25
.L23:
	mov	eax, DWORD PTR -100[rbp]
	movsx	rdx, eax
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -116[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L22:
	jmp	.L26
.L28:
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	capitalize, .-capitalize
	.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	"224393.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"port invalid\012\000"
	.align	2
.LC1:
	.ascii	"unable to open logfile\012\000"
	.align	2
.LC2:
	.ascii	"addrinfo error\012\000"
	.align	2
.LC3:
	.ascii	"socket creation failed\012\000"
	.align	2
.LC4:
	.ascii	"could not bind to host\012\000"
	.align	2
.LC5:
	.ascii	"listen error\012\000"
	.align	2
.LC6:
	.ascii	"server waiting for connections\012\000"
	.align	2
.LC7:
	.ascii	"accept error\012\000"
	.align	2
.LC8:
	.ascii	"fork error\012\000"
	.align	2
.LC9:
	.ascii	"forked child for new connection\012\000"
	.align	2
.LC10:
	.ascii	"new connection\012\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 200
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #200
	str	r0, [fp, #-200]
	str	r1, [fp, #-204]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-200]
	cmp	r3, #1
	bgt	.L2
	mov	r2, #13
	ldr	r1, .L18+4
	mov	r0, #2
	bl	write
	mov	r3, #1
	b	.L16
.L2:
	ldr	r3, [fp, #-200]
	cmp	r3, #2
	ble	.L4
	ldr	r3, [fp, #-204]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, #420
	ldr	r1, .L18+8
	mov	r0, r3
	bl	open
	str	r0, [fp, #-184]
	ldr	r3, [fp, #-184]
	cmp	r3, #0
	bge	.L5
	mov	r2, #23
	ldr	r1, .L18+12
	mov	r0, #2
	bl	write
	b	.L4
.L5:
	mov	r0, #2
	bl	close
	ldr	r0, [fp, #-184]
	bl	dup
	ldr	r0, [fp, #-184]
	bl	close
.L4:
	sub	r3, fp, #168
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-164]
	mov	r3, #1
	str	r3, [fp, #-160]
	mov	r3, #1
	str	r3, [fp, #-168]
	ldr	r3, [fp, #-204]
	add	r3, r3, #4
	ldr	r1, [r3]
	sub	r3, fp, #196
	sub	r2, fp, #168
	mov	r0, #0
	bl	getaddrinfo
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	mov	r2, #15
	ldr	r1, .L18+16
	mov	r0, #2
	bl	write
	mov	r3, #2
	b	.L16
.L6:
	ldr	r3, [fp, #-196]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-196]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-196]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-180]
	ldr	r3, [fp, #-180]
	cmp	r3, #0
	bge	.L7
	mov	r2, #23
	ldr	r1, .L18+20
	mov	r0, #2
	bl	write
	ldr	r3, [fp, #-196]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r3, #3
	b	.L16
.L7:
	ldr	r3, [fp, #-196]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-196]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-180]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L8
	mov	r2, #23
	ldr	r1, .L18+24
	mov	r0, #2
	bl	write
	ldr	r3, [fp, #-196]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r3, #4
	b	.L16
.L8:
	ldr	r3, [fp, #-196]
	mov	r0, r3
	bl	freeaddrinfo
	mov	r1, #5
	ldr	r0, [fp, #-180]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	bge	.L9
	mov	r2, #13
	ldr	r1, .L18+28
	mov	r0, #2
	bl	write
	mov	r3, #5
	b	.L16
.L9:
	mov	r2, #31
	ldr	r1, .L18+32
	mov	r0, #2
	bl	write
.L15:
	mov	r3, #128
	str	r3, [fp, #-192]
	sub	r2, fp, #192
	sub	r3, fp, #136
	mov	r1, r3
	ldr	r0, [fp, #-180]
	bl	accept
	str	r0, [fp, #-176]
	ldr	r3, [fp, #-176]
	cmp	r3, #0
	bge	.L10
	mov	r2, #13
	ldr	r1, .L18+36
	mov	r0, #2
	bl	write
	b	.L14
.L10:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-172]
	ldr	r3, [fp, #-172]
	cmp	r3, #0
	bge	.L12
	mov	r2, #11
	ldr	r1, .L18+40
	mov	r0, #2
	bl	write
	b	.L14
.L12:
	ldr	r3, [fp, #-172]
	cmp	r3, #0
	beq	.L13
	mov	r2, #32
	ldr	r1, .L18+44
	mov	r0, #2
	bl	write
	ldr	r0, [fp, #-176]
	bl	close
	sub	r3, fp, #188
	mov	r2, #1
	mov	r1, r3
	mvn	r0, #0
	bl	waitpid
	b	.L15
.L13:
	mov	r2, #15
	ldr	r1, .L18+48
	mov	r0, #2
	bl	write
	ldr	r0, [fp, #-180]
	bl	close
	ldr	r0, [fp, #-176]
	bl	capitalize
	ldr	r0, [fp, #-176]
	bl	close
	mov	r3, #0
	b	.L16
.L14:
	b	.L15
.L16:
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC11
	.word	.LC0
	.word	1089
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.section	.rodata
	.align	2
.LC12:
	.ascii	"connection closed\012\000"
	.align	2
.LC13:
	.ascii	"read error\012\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	capitalize, %function
capitalize:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	str	r0, [fp, #-104]
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L28:
	sub	r3, fp, #88
	mov	r2, #80
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	read
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L21
	mov	r2, #18
	ldr	r1, .L31+4
	mov	r0, #2
	bl	write
	nop
	nop
	ldr	r3, .L31
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L29
	b	.L30
.L21:
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L23
	mov	r2, #11
	ldr	r1, .L31+8
	mov	r0, #2
	bl	write
	b	.L24
.L23:
	mov	r3, #0
	str	r3, [fp, #-96]
.L27:
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L25
	ldr	r3, [fp, #-96]
	cmp	r3, #79
	bgt	.L25
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #96
	bls	.L26
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #122
	bhi	.L26
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #32
	and	r1, r3, #255
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
.L26:
	ldr	r3, [fp, #-96]
	add	r3, r3, #1
	str	r3, [fp, #-96]
	b	.L27
.L25:
	ldr	r2, [fp, #-92]
	sub	r3, fp, #88
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	write
.L24:
	b	.L28
.L30:
	bl	__stack_chk_fail
.L29:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC14
	.word	.LC12
	.word	.LC13
	.size	capitalize, .-capitalize
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
