	.file	"241051.c"
	.intel_syntax noprefix
	.text
	.globl	error
	.type	error, @function
error:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.section	.rodata
.LC0:
	.string	"Error creating socket"
.LC1:
	.string	"Error binding socket"
	.align 8
.LC2:
	.string	"Server listening on localhost:1337..."
.LC3:
	.string	"Error on incoming socket"
.LC4:
	.string	"wb"
.LC5:
	.string	"server_file"
.LC6:
	.string	"Error writing to file"
.LC7:
	.string	"Bytes received %d\n"
	.align 8
.LC8:
	.string	"File read error. Client connected but file could not be read."
	.text
	.globl	main
	.type	main, @function
main:
.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, 336
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -324[rbp], 0
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -320[rbp], eax
	cmp	DWORD PTR -320[rbp], 0
	jns	.L3
	lea	rdi, .LC0[rip]
	call	error
.L3:
	lea	rax, -304[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -304[rbp], 2
	mov	DWORD PTR -300[rbp], 0
	mov	edi, 1337
	call	htons@PLT
	mov	WORD PTR -302[rbp], ax
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -320[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	jns	.L4
	lea	rdi, .LC1[rip]
	call	error
.L4:
	mov	eax, DWORD PTR -320[rbp]
	mov	esi, 5
	mov	edi, eax
	call	listen@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	DWORD PTR -328[rbp], 16
	lea	rdx, -328[rbp]
	lea	rcx, -288[rbp]
	mov	eax, DWORD PTR -320[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -316[rbp], eax
	cmp	DWORD PTR -316[rbp], 0
	jns	.L5
	lea	rdi, .LC3[rip]
	call	error
.L5:
	lea	rax, -272[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], 0
	jne	.L7
	lea	rdi, .LC6[rip]
	call	error
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -324[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -324[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -312[rbp]
	lea	rax, -272[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	lea	rax, -272[rbp]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
.L7:
	lea	rsi, -272[rbp]
	mov	eax, DWORD PTR -316[rbp]
	mov	ecx, 0
	mov	edx, 5
	mov	edi, eax
	call	recv@PLT
	mov	DWORD PTR -324[rbp], eax
	cmp	DWORD PTR -324[rbp], 0
	jg	.L8
	cmp	DWORD PTR -324[rbp], 0
	jns	.L9
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L9:
	mov	eax, DWORD PTR -320[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"241051.c"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ 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]
	ldr	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error creating socket\000"
	.align	2
.LC1:
	.ascii	"Error binding socket\000"
	.align	2
.LC2:
	.ascii	"Server listening on localhost:1337...\000"
	.align	2
.LC3:
	.ascii	"Error on incoming socket\000"
	.align	2
.LC4:
	.ascii	"wb\000"
	.align	2
.LC5:
	.ascii	"server_file\000"
	.align	2
.LC6:
	.ascii	"Error writing to file\000"
	.align	2
.LC7:
	.ascii	"Bytes received %d\012\000"
	.align	2
.LC8:
	.ascii	"File read error. Client connected but file could no"
	.ascii	"t be read.\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 312
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #312
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-312]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-308]
	ldr	r3, [fp, #-308]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L12+4
	bl	error
.L3:
	sub	r3, fp, #296
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4
	sub	r3, r3, #292
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-292]
	ldr	r0, .L12+8
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #292
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #296
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-308]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L12+12
	bl	error
.L4:
	mov	r1, #5
	ldr	r0, [fp, #-308]
	bl	listen
	ldr	r0, .L12+16
	bl	puts
	mov	r3, #16
	str	r3, [fp, #-316]
	sub	r2, fp, #316
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, [fp, #-308]
	bl	accept
	str	r0, [fp, #-304]
	ldr	r3, [fp, #-304]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L12+20
	bl	error
.L5:
	sub	r3, fp, #264
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r1, .L12+24
	ldr	r0, .L12+28
	bl	fopen
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	bne	.L7
	ldr	r0, .L12+32
	bl	error
	b	.L7
.L8:
	ldr	r1, [fp, #-312]
	ldr	r0, .L12+36
	bl	printf
	ldr	r2, [fp, #-312]
	sub	r0, fp, #264
	ldr	r3, [fp, #-300]
	mov	r1, #1
	bl	fwrite
	sub	r3, fp, #264
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	memset
.L7:
	sub	r1, fp, #264
	mov	r3, #0
	mov	r2, #5
	ldr	r0, [fp, #-304]
	bl	recv
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bgt	.L8
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L12+40
	bl	puts
.L9:
	ldr	r0, [fp, #-308]
	bl	close
	mov	r3, #0
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC9
	.word	.LC0
	.word	1337
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
