	.file	"258558.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"ERRO: Nao ha memoria suficiente para ser alocado!"
	.align 8
.LC1:
	.string	"FALHA: Infelizmente nao foi possivel criar seu socket."
.LC2:
	.string	"Socket criado com sucesso!"
	.align 8
.LC3:
	.string	"FALHA: Infelizmente a conexao falhou.\n"
.LC4:
	.string	"rb"
.LC5:
	.string	"index.html"
	.align 8
.LC6:
	.string	"FALHA: Encontramos um problema ao tentar abrir o !\n"
.LC7:
	.string	" aberto com sucesso!\n"
.LC8:
	.string	" nao pode ser sincronizado\n"
	.align 8
.LC9:
	.string	"FALHA: Houve perda de pacote e o programa teve que ser finalizado\n"
	.align 8
.LC10:
	.string	"FALHA: O buffer do  nao esta alocado\n"
.LC11:
	.string	"FALHA: O  nao esta legivel\n"
.LC12:
	.string	"O tamanho do  eh:  %ld\n"
	.align 8
.LC13:
	.string	"Sucesso: Conexao realizada com Sucesso !\n"
	.align 8
.LC14:
	.string	"FALHA: O servido nao esta recebendo solicitacoes\n"
	.align 8
.LC15:
	.string	"Aguardando os pedidos de conexoes... \n"
.LC16:
	.string	"HTTP/1.1 200 OK\r\n"
.LC17:
	.string	"%d conexoes aceitas\n"
	.align 8
.LC18:
	.string	"Um cliente esta conectado de %s:%hu...\n"
.LC19:
	.string	"Content-length: %ld\r\n"
.LC20:
	.string	"Connection: close\r\n\r\n"
	.align 8
.LC21:
	.string	"Arquivo foi enviado com sucesso!"
.LC22:
	.string	"accept failed"
	.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
	push	rbx
	sub	rsp, 168
	.cfi_offset 3, -24
	mov	DWORD PTR -164[rbp], edi
	mov	QWORD PTR -176[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -152[rbp], 0
	mov	DWORD PTR -148[rbp], 1024
	mov	eax, DWORD PTR -148[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -136[rbp], rax
	cmp	QWORD PTR -136[rbp], 0
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L2:
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -144[rbp], eax
	cmp	DWORD PTR -144[rbp], -1
	jne	.L4
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L4:
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -96[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -96[rbp], 2
	mov	DWORD PTR -92[rbp], 0
	mov	edi, 8888
	call	htons@PLT
	mov	WORD PTR -94[rbp], ax
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -144[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L5:
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -128[rbp], rax
	cmp	QWORD PTR -128[rbp], 0
	jne	.L6
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L6:
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -128[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	cmp	eax, -1
	jne	.L7
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L7:
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -120[rbp], rax
	cmp	QWORD PTR -120[rbp], -1
	jne	.L8
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L8:
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -112[rbp], rax
	cmp	QWORD PTR -112[rbp], 0
	jne	.L9
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L9:
	mov	rsi, QWORD PTR -120[rbp]
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -112[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 1
	je	.L10
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L10:
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -120[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC13[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -144[rbp]
	mov	esi, 10
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L11
	lea	rdi, .LC14[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L20
.L11:
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	DWORD PTR -156[rbp], 16
	lea	rax, .LC16[rip]
	mov	QWORD PTR -104[rbp], rax
	jmp	.L12
.L18:
	add	DWORD PTR -152[rbp], 1
	mov	eax, DWORD PTR -152[rbp]
	mov	esi, eax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	movzx	eax, WORD PTR -94[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	ntohs@PLT
	movzx	ebx, ax
	mov	eax, DWORD PTR -92[rbp]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	edx, ebx
	mov	rsi, rax
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR -140[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jne	.L13
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L12
.L13:
	mov	rdx, QWORD PTR -120[rbp]
	lea	rax, -64[rbp]
	lea	rsi, .LC19[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -140[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jne	.L15
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L12
.L15:
	mov	eax, DWORD PTR -140[rbp]
	mov	edx, 21
	lea	rsi, .LC20[rip]
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jne	.L16
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L12
.L16:
	mov	rdx, QWORD PTR -120[rbp]
	mov	rcx, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -140[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	test	rax, rax
	jne	.L17
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L12
.L17:
	lea	rdi, .LC21[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
.L12:
	lea	rdx, -156[rbp]
	lea	rcx, -80[rbp]
	mov	eax, DWORD PTR -144[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -140[rbp], eax
	cmp	DWORD PTR -140[rbp], 0
	jne	.L18
	cmp	DWORD PTR -140[rbp], 0
	jns	.L19
	lea	rdi, .LC22[rip]
	call	perror@PLT
	mov	eax, DWORD PTR -140[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 1
	jmp	.L20
.L19:
	mov	eax, DWORD PTR -144[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
.L20:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"258558.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ERRO: Nao ha memoria suficiente para ser alocado!\000"
	.align	2
.LC1:
	.ascii	"FALHA: Infelizmente nao foi possivel criar seu sock"
	.ascii	"et.\000"
	.align	2
.LC2:
	.ascii	"Socket criado com sucesso!\000"
	.align	2
.LC3:
	.ascii	"FALHA: Infelizmente a conexao falhou.\012\000"
	.align	2
.LC4:
	.ascii	"rb\000"
	.align	2
.LC5:
	.ascii	"index.html\000"
	.align	2
.LC6:
	.ascii	"FALHA: Encontramos um problema ao tentar abrir o !\012"
	.ascii	"\000"
	.align	2
.LC7:
	.ascii	" aberto com sucesso!\012\000"
	.align	2
.LC8:
	.ascii	" nao pode ser sincronizado\012\000"
	.align	2
.LC9:
	.ascii	"FALHA: Houve perda de pacote e o programa teve que "
	.ascii	"ser finalizado\012\000"
	.align	2
.LC10:
	.ascii	"FALHA: O buffer do  nao esta alocado\012\000"
	.align	2
.LC11:
	.ascii	"FALHA: O  nao esta legivel\012\000"
	.align	2
.LC12:
	.ascii	"O tamanho do  eh:  %ld\012\000"
	.align	2
.LC13:
	.ascii	"Sucesso: Conexao realizada com Sucesso !\012\000"
	.align	2
.LC14:
	.ascii	"FALHA: O servido nao esta recebendo solicitacoes\012"
	.ascii	"\000"
	.align	2
.LC15:
	.ascii	"Aguardando os pedidos de conexoes... \012\000"
	.align	2
.LC16:
	.ascii	"HTTP/1.1 200 OK\015\012\000"
	.align	2
.LC17:
	.ascii	"%d conexoes aceitas\012\000"
	.align	2
.LC18:
	.ascii	"Um cliente esta conectado de %s:%hu...\012\000"
	.align	2
.LC19:
	.ascii	"Content-length: %ld\015\012\000"
	.align	2
.LC20:
	.ascii	"Connection: close\015\012\015\012\000"
	.align	2
.LC21:
	.ascii	"Arquivo foi enviado com sucesso!\000"
	.align	2
.LC22:
	.ascii	"accept failed\000"
	.align	2
.LC23:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #132
	str	r0, [fp, #-136]
	str	r1, [fp, #-140]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-124]
	mov	r3, #1024
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-120]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L22+4
	bl	puts
	mov	r3, #1
	b	.L20
.L2:
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-112]
	cmn	r3, #1
	bne	.L4
	ldr	r0, .L22+8
	bl	puts
	mov	r3, #1
	b	.L20
.L4:
	ldr	r0, .L22+12
	bl	printf
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #2
	strh	r3, [fp, #-88]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-84]
	ldr	r0, .L22+16
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-86]	@ movhi
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L22+20
	bl	puts
	mov	r3, #1
	b	.L20
.L5:
	ldr	r1, .L22+24
	ldr	r0, .L22+28
	bl	fopen
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L22+32
	bl	puts
	mov	r3, #1
	b	.L20
.L6:
	ldr	r0, .L22+36
	bl	puts
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-108]
	bl	fseek
	mov	r3, r0
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L22+40
	bl	puts
	mov	r3, #1
	b	.L20
.L7:
	ldr	r0, [fp, #-108]
	bl	ftell
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L22+44
	bl	puts
	mov	r3, #1
	b	.L20
.L8:
	ldr	r0, [fp, #-108]
	bl	rewind
	ldr	r3, [fp, #-104]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-100]
	ldr	r3, [fp, #-100]
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L22+48
	bl	puts
	mov	r3, #1
	b	.L20
.L9:
	ldr	r1, [fp, #-104]
	ldr	r3, [fp, #-108]
	mov	r2, #1
	ldr	r0, [fp, #-100]
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	beq	.L10
	ldr	r0, .L22+52
	bl	puts
	mov	r3, #1
	b	.L20
.L10:
	ldr	r0, [fp, #-108]
	bl	fclose
	ldr	r1, [fp, #-104]
	ldr	r0, .L22+56
	bl	printf
	ldr	r0, .L22+60
	bl	puts
	mov	r1, #10
	ldr	r0, [fp, #-112]
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L22+64
	bl	puts
	mov	r3, #1
	b	.L20
.L11:
	ldr	r0, .L22+68
	bl	puts
	mov	r3, #16
	str	r3, [fp, #-128]
	ldr	r3, .L22+72
	str	r3, [fp, #-96]
	b	.L12
.L18:
	ldr	r3, [fp, #-124]
	add	r3, r3, #1
	str	r3, [fp, #-124]
	ldr	r1, [fp, #-124]
	ldr	r0, .L22+76
	bl	printf
	ldr	r0, [fp, #-84]
	bl	inet_ntoa
	mov	r4, r0
	ldrh	r3, [fp, #-86]
	mov	r0, r3
	bl	ntohs
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L22+80
	bl	printf
	ldr	r0, [fp, #-96]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-96]
	ldr	r0, [fp, #-92]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bne	.L13
	ldr	r0, [fp, #-92]
	bl	close
	b	.L12
.L13:
	sub	r3, fp, #56
	ldr	r2, [fp, #-104]
	ldr	r1, .L22+84
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #56
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #56
	mov	r1, r3
	ldr	r0, [fp, #-92]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bne	.L15
	ldr	r0, [fp, #-92]
	bl	close
	b	.L12
.L15:
	mov	r2, #21
	ldr	r1, .L22+88
	ldr	r0, [fp, #-92]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bne	.L16
	ldr	r0, [fp, #-92]
	bl	close
	b	.L12
.L16:
	ldr	r3, [fp, #-104]
	mov	r2, r3
	ldr	r1, [fp, #-100]
	ldr	r0, [fp, #-92]
	bl	write
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r0, [fp, #-92]
	bl	close
	b	.L12
.L17:
	ldr	r0, .L22+92
	bl	puts
	ldr	r0, [fp, #-92]
	bl	close
.L12:
	sub	r2, fp, #128
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	accept
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L18
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bge	.L19
	ldr	r0, .L22+96
	bl	perror
	ldr	r0, [fp, #-92]
	bl	close
	mov	r3, #1
	b	.L20
.L19:
	ldr	r0, [fp, #-112]
	bl	close
	mov	r3, #0
.L20:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC23
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	8888
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
