	.file	"9224.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Fakehttpd, ipv4, version devel\nAuthor: C.D.Luminate / MIT Licence / 2014\nUsage:  %s [options] FILE\noptions:\n\t-h\tshow this help message\n\t-p PORT\tspecify a port number\n\t-v\tverbose output(now default)\n\t-b\tset bind address\n\t...\n"
	.text
	.globl	Usage
	.type	Usage, @function
Usage:
.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 stderr[rip]
	mov	rdx, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Usage, .-Usage
	.globl	debug
	.data
	.align 4
	.type	debug, @object
	.size	debug, 4
debug:
	.long	1
	.globl	openfd
	.bss
	.align 4
	.type	openfd, @object
	.size	openfd, 4
openfd:
	.zero	4
	.globl	buffer
	.align 32
	.type	buffer, @object
	.size	buffer, 1024
buffer:
	.zero	1024
	.globl	readn
	.align 4
	.type	readn, @object
	.size	readn, 4
readn:
	.zero	4
	.globl	req_fname
	.align 32
	.type	req_fname, @object
	.size	req_fname, 256
req_fname:
	.zero	256
	.globl	content_length
	.align 8
	.type	content_length, @object
	.size	content_length, 8
content_length:
	.zero	8
	.globl	serveraddr
	.align 16
	.type	serveraddr, @object
	.size	serveraddr, 16
serveraddr:
	.zero	16
	.globl	clientaddr
	.align 16
	.type	clientaddr, @object
	.size	clientaddr, 16
clientaddr:
	.zero	16
	.globl	sockfd
	.align 4
	.type	sockfd, @object
	.size	sockfd, 4
sockfd:
	.zero	4
	.globl	connfd
	.align 4
	.type	connfd, @object
	.size	connfd, 4
connfd:
	.zero	4
	.globl	client_len
	.align 4
	.type	client_len, @object
	.size	client_len, 4
client_len:
	.zero	4
	.globl	serverport
	.align 4
	.type	serverport, @object
	.size	serverport, 4
serverport:
	.zero	4
	.globl	bindaddr
	.align 32
	.type	bindaddr, @object
	.size	bindaddr, 32
bindaddr:
	.zero	32
	.globl	fileind
	.align 4
	.type	fileind, @object
	.size	fileind, 4
fileind:
	.zero	4
	.globl	child_pid
	.align 4
	.type	child_pid, @object
	.size	child_pid, 4
child_pid:
	.zero	4
	.globl	opt
	.align 4
	.type	opt, @object
	.size	opt, 4
opt:
	.zero	4
	.globl	act
	.align 32
	.type	act, @object
	.size	act, 152
act:
	.zero	152
	.globl	oldact
	.align 32
	.type	oldact, @object
	.size	oldact, 152
oldact:
	.zero	152
	.section	.rodata
.LC1:
	.string	"Invalid Port Number.\n"
.LC2:
	.string	"b:hp:v"
.LC3:
	.string	"%s: Expected Filename\n"
.LC4:
	.string	"open"
.LC5:
	.string	"Content-Length: %ld\n"
.LC6:
	.string	"socket"
.LC7:
	.string	"bind"
.LC8:
	.string	"listen"
.LC9:
	.string	"accept"
	.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	lea	rax, handle_sig[rip]
	mov	QWORD PTR act[rip], rax
	mov	DWORD PTR act[rip+136], -1073741824
	lea	rdx, oldact[rip]
	lea	rsi, act[rip]
	mov	edi, 2
	call	sigaction@PLT
	mov	DWORD PTR serverport[rip], 8000
	movabs	rax, 3328210909095473713
	mov	QWORD PTR bindaddr[rip], rax
	mov	WORD PTR bindaddr[rip+8], 49
	jmp	.L4
.L11:
	mov	eax, DWORD PTR opt[rip]
	cmp	eax, 118
	je	.L5
	cmp	eax, 118
	jg	.L6
	cmp	eax, 112
	je	.L7
	cmp	eax, 112
	jg	.L6
	cmp	eax, 98
	je	.L8
	cmp	eax, 104
	jne	.L6
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	Usage
	mov	edi, 0
	call	exit@PLT
.L8:
	mov	rax, QWORD PTR optarg[rip]
	mov	edx, 31
	mov	rsi, rax
	lea	rdi, bindaddr[rip]
	call	strncpy@PLT
	jmp	.L4
.L7:
	mov	rax, QWORD PTR optarg[rip]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR serverport[rip], eax
	mov	eax, DWORD PTR serverport[rip]
	test	eax, eax
	jle	.L9
	mov	eax, DWORD PTR serverport[rip]
	cmp	eax, 65535
	jle	.L4
.L9:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC1[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	DWORD PTR debug[rip], 1
	jmp	.L4
.L6:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	Usage
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rcx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	lea	rdx, .LC2[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR opt[rip], eax
	mov	eax, DWORD PTR opt[rip]
	cmp	eax, -1
	jne	.L11
	mov	eax, DWORD PTR optind[rip]
	mov	DWORD PTR fileind[rip], eax
	mov	eax, DWORD PTR fileind[rip]
	cmp	DWORD PTR -4[rbp], eax
	jg	.L12
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	eax, DWORD PTR fileind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR openfd[rip], eax
	mov	eax, DWORD PTR openfd[rip]
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	QWORD PTR content_length[rip], 0
	jmp	.L14
.L15:
	mov	eax, DWORD PTR readn[rip]
	movsx	rdx, eax
	mov	rax, QWORD PTR content_length[rip]
	add	rax, rdx
	mov	QWORD PTR content_length[rip], rax
.L14:
	mov	eax, DWORD PTR openfd[rip]
	mov	edx, 1024
	lea	rsi, buffer[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR readn[rip], eax
	mov	eax, DWORD PTR readn[rip]
	test	eax, eax
	jg	.L15
	lea	rdx, buffer[rip]
	mov	eax, 0
	mov	ecx, 128
	mov	rdi, rdx
	rep stosq
	mov	DWORD PTR readn[rip], 0
	mov	eax, DWORD PTR openfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR debug[rip]
	test	eax, eax
	je	.L16
	mov	rax, QWORD PTR content_length[rip]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L16:
	mov	edx, 6
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR sockfd[rip], eax
	mov	eax, DWORD PTR sockfd[rip]
	cmp	eax, -1
	jne	.L17
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	mov	QWORD PTR serveraddr[rip], 0
	mov	QWORD PTR serveraddr[rip+8], 0
	mov	WORD PTR serveraddr[rip], 2
	mov	eax, DWORD PTR serverport[rip]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR serveraddr[rip+2], ax
	lea	rdx, serveraddr[rip+4]
	lea	rsi, bindaddr[rip]
	mov	edi, 2
	call	inet_pton@PLT
	mov	eax, DWORD PTR sockfd[rip]
	mov	edx, 16
	lea	rsi, serveraddr[rip]
	mov	edi, eax
	call	bind@PLT
	cmp	eax, -1
	jne	.L18
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L18:
	mov	eax, DWORD PTR sockfd[rip]
	mov	esi, 8
	mov	edi, eax
	call	listen@PLT
	cmp	eax, -1
	jne	.L19
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	DWORD PTR client_len[rip], 16
	mov	eax, DWORD PTR sockfd[rip]
	lea	rdx, client_len[rip]
	lea	rsi, clientaddr[rip]
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR connfd[rip], eax
	mov	eax, DWORD PTR connfd[rip]
	cmp	eax, -1
	jne	.L20
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	call	fork@PLT
	mov	DWORD PTR child_pid[rip], eax
	mov	eax, DWORD PTR child_pid[rip]
	test	eax, eax
	jne	.L21
	mov	eax, DWORD PTR sockfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	edx, DWORD PTR connfd[rip]
	mov	eax, DWORD PTR fileind[rip]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	mov	esi, edx
	mov	rdi, rax
	call	httpd_serve
	mov	eax, DWORD PTR openfd[rip]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR connfd[rip]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	edi, 0
	call	exit@PLT
.L21:
	mov	eax, DWORD PTR connfd[rip]
	mov	edi, eax
	call	close@PLT
	jmp	.L19
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
.LC10:
	.string	"read"
.LC11:
	.string	"requested file '/%s'\n"
.LC12:
	.string	""
	.text
	.globl	httpd_serve
	.type	httpd_serve, @function
httpd_serve:
.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, 1072
	mov	QWORD PTR -1064[rbp], rdi
	mov	DWORD PTR -1068[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1040[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 128
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	mov	DWORD PTR -1044[rbp], 0
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1068[rbp]
	mov	edx, 1023
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, -1
	jne	.L23
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	lea	rax, -1040[rbp]
	lea	rsi, req_fname[rip]
	mov	rdi, rax
	call	httpd_parse_req
	mov	DWORD PTR -1044[rbp], eax
	mov	eax, DWORD PTR debug[rip]
	test	eax, eax
	je	.L24
	mov	rax, QWORD PTR stdout[rip]
	lea	rdx, req_fname[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L24:
	cmp	DWORD PTR -1044[rbp], -1
	je	.L25
	cmp	DWORD PTR -1044[rbp], 1
	jne	.L26
	mov	rdx, QWORD PTR content_length[rip]
	mov	eax, DWORD PTR -1068[rbp]
	lea	rcx, .LC12[rip]
	mov	esi, 1
	mov	edi, eax
	call	httpd_resp_head
	mov	rdx, QWORD PTR -1064[rbp]
	mov	eax, DWORD PTR -1068[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	httpd_resp_file
	jmp	.L26
.L25:
	mov	eax, DWORD PTR -1068[rbp]
	lea	rcx, .LC12[rip]
	mov	edx, 0
	mov	esi, -1
	mov	edi, eax
	call	httpd_resp_head
	nop
.L26:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	httpd_serve, .-httpd_serve
	.section	.rodata
.LC13:
	.string	"GET / HTTP/1.0"
.LC14:
	.string	"GET /"
.LC15:
	.string	"GET /%s HTTP"
	.text
	.globl	httpd_parse_req
	.type	httpd_parse_req, @function
httpd_parse_req:
.LFB9:
	.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	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 14
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L30
	mov	eax, 1
	jmp	.L31
.L30:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 5
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L32
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	mov	eax, 1
	jmp	.L31
.L32:
	mov	eax, -1
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	httpd_parse_req, .-httpd_parse_req
	.section	.rodata
	.align 8
.LC16:
	.string	"HTTP/1.1 200 OK\nDate:\nServer: Fakehttpd\nContent-Length: %ld\nConnection: close\nContent-Type: text/html; charset=utf-8\n\n"
	.align 8
.LC17:
	.string	"HTTP/1.1 501 Not Implemented\nDate:\nServer: Fakehttpd\nContent-Length: 0\nConnection: close\nContent-Type: text/html; charset=utf-8\n\n"
	.text
	.globl	httpd_resp_head
	.type	httpd_resp_head, @function
httpd_resp_head:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1072
	mov	DWORD PTR -1044[rbp], edi
	mov	DWORD PTR -1048[rbp], esi
	mov	QWORD PTR -1056[rbp], rdx
	mov	QWORD PTR -1064[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1040[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 128
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	cmp	DWORD PTR -1048[rbp], -1
	je	.L34
	cmp	DWORD PTR -1048[rbp], 1
	jne	.L35
	mov	rdx, QWORD PTR content_length[rip]
	lea	rax, -1040[rbp]
	mov	rcx, rdx
	lea	rdx, .LC16[rip]
	mov	esi, 1024
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	strnlen@PLT
	mov	rdx, rax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L36
.L34:
	lea	rax, -1040[rbp]
	lea	rdx, .LC17[rip]
	mov	esi, 1024
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -1040[rbp]
	mov	esi, 1024
	mov	rdi, rax
	call	strnlen@PLT
	mov	rdx, rax
	lea	rcx, -1040[rbp]
	mov	eax, DWORD PTR -1044[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	jmp	.L36
.L35:
	mov	eax, -1
	jmp	.L38
.L36:
	mov	eax, 0
.L38:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	httpd_resp_head, .-httpd_resp_head
	.globl	httpd_resp_file
	.type	httpd_resp_file, @function
httpd_resp_file:
.LFB11:
	.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
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR openfd[rip], eax
	lea	rdx, buffer[rip]
	mov	eax, 0
	mov	ecx, 128
	mov	rdi, rdx
	rep stosq
	jmp	.L41
.L42:
	mov	esi, 1024
	lea	rdi, buffer[rip]
	call	strnlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	lea	rsi, buffer[rip]
	mov	edi, eax
	call	write@PLT
	lea	rdx, buffer[rip]
	mov	eax, 0
	mov	ecx, 128
	mov	rdi, rdx
	rep stosq
.L41:
	mov	eax, DWORD PTR openfd[rip]
	mov	edx, 1024
	lea	rsi, buffer[rip]
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR readn[rip], eax
	mov	eax, DWORD PTR readn[rip]
	test	eax, eax
	jg	.L42
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	httpd_resp_file, .-httpd_resp_file
	.globl	handle_sig
	.type	handle_sig, @function
handle_sig:
.LFB12:
	.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
	cmp	DWORD PTR -4[rbp], 2
	jne	.L46
	mov	eax, DWORD PTR connfd[rip]
	mov	esi, 2
	mov	edi, eax
	call	shutdown@PLT
	mov	edi, 12
	call	_exit@PLT
.L46:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	handle_sig, .-handle_sig
	.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	"9224.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Fakehttpd, ipv4, version devel\012Author: C.D.Lumin"
	.ascii	"ate / MIT Licence / 2014\012Usage:  %s [options] FI"
	.ascii	"LE\012options:\012\011-h\011show this help message\012"
	.ascii	"\011-p PORT\011specify a port number\012\011-v\011v"
	.ascii	"erbose output(now default)\012\011-b\011set bind ad"
	.ascii	"dress\012\011...\012\000"
	.text
	.align	2
	.global	Usage
	.syntax unified
	.arm
	.fpu softvfp
	.type	Usage, %function
Usage:
	@ 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	r3, .L3
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L3+4
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	stderr
	.word	.LC0
	.size	Usage, .-Usage
	.global	debug
	.data
	.align	2
	.type	debug, %object
	.size	debug, 4
debug:
	.word	1
	.comm	openfd,4,4
	.comm	buffer,1024,4
	.comm	readn,4,4
	.comm	req_fname,256,4
	.comm	content_length,4,4
	.comm	serveraddr,16,4
	.comm	clientaddr,16,4
	.comm	sockfd,4,4
	.comm	connfd,4,4
	.comm	client_len,4,4
	.comm	serverport,4,4
	.comm	bindaddr,32,4
	.comm	fileind,4,4
	.comm	child_pid,4,4
	.comm	opt,4,4
	.comm	act,140,4
	.comm	oldact,140,4
	.section	.rodata
	.align	2
.LC1:
	.ascii	"127.0.0.1\000"
	.align	2
.LC2:
	.ascii	"Invalid Port Number.\012\000"
	.align	2
.LC3:
	.ascii	"b:hp:v\000"
	.align	2
.LC4:
	.ascii	"%s: Expected Filename\012\000"
	.align	2
.LC5:
	.ascii	"open\000"
	.align	2
.LC6:
	.ascii	"Content-Length: %ld\012\000"
	.align	2
.LC7:
	.ascii	"socket\000"
	.align	2
.LC8:
	.ascii	"bind\000"
	.align	2
.LC9:
	.ascii	"listen\000"
	.align	2
.LC10:
	.ascii	"accept\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-12]
	ldr	r3, .L26
	ldr	r2, .L26+4
	str	r2, [r3]
	ldr	r3, .L26
	mov	r2, #-1073741824
	str	r2, [r3, #132]
	ldr	r2, .L26+8
	ldr	r1, .L26
	mov	r0, #2
	bl	sigaction
	ldr	r3, .L26+12
	mov	r2, #8000
	str	r2, [r3]
	ldr	r2, .L26+16
	ldr	r3, .L26+20
	mov	r0, r2
	mov	r1, r3
	mov	r3, #10
	mov	r2, r3
	bl	memcpy
	b	.L6
.L15:
	ldr	r3, .L26+24
	ldr	r3, [r3]
	sub	r3, r3, #98
	cmp	r3, #20
	ldrls	pc, [pc, r3, asl #2]
	b	.L7
.L9:
	.word	.L12
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L11
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L10
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L7
	.word	.L8
.L11:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r0, r3
	bl	Usage
	mov	r0, #0
	bl	exit
.L12:
	ldr	r3, .L26+28
	ldr	r3, [r3]
	mov	r2, #31
	mov	r1, r3
	ldr	r0, .L26+16
	bl	strncpy
	b	.L6
.L10:
	ldr	r3, .L26+28
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	ldr	r2, .L26+12
	str	r3, [r2]
	ldr	r3, .L26+12
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L13
	ldr	r3, .L26+12
	ldr	r3, [r3]
	cmp	r3, #65536
	blt	.L6
.L13:
	ldr	r3, .L26+32
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L26+36
	bl	fwrite
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, .L26+40
	mov	r2, #1
	str	r2, [r3]
	b	.L6
.L7:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r0, r3
	bl	Usage
	mov	r0, #1
	bl	exit
.L6:
	ldr	r2, .L26+44
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	getopt
	mov	r3, r0
	ldr	r2, .L26+24
	str	r3, [r2]
	ldr	r3, .L26+24
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L15
	ldr	r3, .L26+48
	ldr	r3, [r3]
	ldr	r2, .L26+52
	str	r3, [r2]
	ldr	r3, .L26+52
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bgt	.L16
	ldr	r3, .L26+32
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L26+56
	bl	fprintf
	mov	r0, #1
	bl	exit
.L16:
	ldr	r3, .L26+52
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	mov	r3, r0
	ldr	r2, .L26+60
	str	r3, [r2]
	ldr	r3, .L26+60
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L17
	ldr	r0, .L26+64
	bl	perror
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, .L26+68
	mov	r2, #0
	str	r2, [r3]
	b	.L18
.L19:
	ldr	r3, .L26+68
	ldr	r2, [r3]
	ldr	r3, .L26+72
	ldr	r3, [r3]
	add	r3, r2, r3
	ldr	r2, .L26+68
	str	r3, [r2]
.L18:
	ldr	r3, .L26+60
	ldr	r3, [r3]
	mov	r2, #1024
	ldr	r1, .L26+76
	mov	r0, r3
	bl	read
	mov	r3, r0
	ldr	r2, .L26+72
	str	r3, [r2]
	ldr	r3, .L26+72
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L19
	ldr	r3, .L26+76
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, .L26+72
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L26+60
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L26+40
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L20
	ldr	r3, .L26+68
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26+80
	bl	printf
.L20:
	mov	r2, #6
	mov	r1, #1
	mov	r0, #2
	bl	socket
	mov	r3, r0
	ldr	r2, .L26+84
	str	r3, [r2]
	ldr	r3, .L26+84
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L26+88
	bl	perror
	mov	r0, #1
	bl	exit
.L21:
	ldr	r3, .L26+92
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	ldr	r3, .L26+92
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	ldr	r3, .L26+12
	ldr	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+92
	strh	r2, [r3, #2]	@ movhi
	ldr	r2, .L26+96
	ldr	r1, .L26+16
	mov	r0, #2
	bl	inet_pton
	ldr	r3, .L26+84
	ldr	r3, [r3]
	mov	r2, #16
	ldr	r1, .L26+92
	mov	r0, r3
	bl	bind
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	ldr	r0, .L26+100
	bl	perror
	mov	r0, #1
	bl	exit
.L22:
	ldr	r3, .L26+84
	ldr	r3, [r3]
	mov	r1, #8
	mov	r0, r3
	bl	listen
	mov	r3, r0
	cmn	r3, #1
	bne	.L23
	ldr	r0, .L26+104
	bl	perror
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, .L26+108
	mov	r2, #16
	str	r2, [r3]
	ldr	r3, .L26+84
	ldr	r3, [r3]
	ldr	r2, .L26+108
	ldr	r1, .L26+112
	mov	r0, r3
	bl	accept
	mov	r3, r0
	ldr	r2, .L26+116
	str	r3, [r2]
	ldr	r3, .L26+116
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L24
	ldr	r0, .L26+120
	bl	perror
	mov	r0, #1
	bl	exit
.L24:
	bl	fork
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L26+124
	str	r2, [r3]
	ldr	r3, .L26+124
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L26+84
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L26+52
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L26+116
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	httpd_serve
	ldr	r3, .L26+60
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, .L26+116
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	shutdown
	mov	r0, #0
	bl	exit
.L25:
	ldr	r3, .L26+116
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	b	.L23
.L27:
	.align	2
.L26:
	.word	act
	.word	handle_sig
	.word	oldact
	.word	serverport
	.word	bindaddr
	.word	.LC1
	.word	opt
	.word	optarg
	.word	stderr
	.word	.LC2
	.word	debug
	.word	.LC3
	.word	optind
	.word	fileind
	.word	.LC4
	.word	openfd
	.word	.LC5
	.word	content_length
	.word	readn
	.word	buffer
	.word	.LC6
	.word	sockfd
	.word	.LC7
	.word	serveraddr
	.word	serveraddr+4
	.word	.LC8
	.word	.LC9
	.word	client_len
	.word	clientaddr
	.word	connfd
	.word	.LC10
	.word	child_pid
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"read\000"
	.align	2
.LC12:
	.ascii	"requested file '/%s'\012\000"
	.align	2
.LC13:
	.ascii	"\000"
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	httpd_serve
	.syntax unified
	.arm
	.fpu softvfp
	.type	httpd_serve, %function
httpd_serve:
	@ args = 0, pretend = 0, frame = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	str	r0, [fp, #-1040]
	str	r1, [fp, #-1044]
	ldr	r3, .L35
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-1036]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L35+4
	mov	r1, r3
	ldr	r0, [fp, #-1044]
	bl	read
	mov	r3, r0
	cmn	r3, #1
	bne	.L29
	ldr	r0, .L35+8
	bl	perror
	mov	r0, #1
	bl	exit
.L29:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L35+12
	mov	r0, r3
	bl	httpd_parse_req
	str	r0, [fp, #-1036]
	ldr	r3, .L35+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L30
	ldr	r3, .L35+20
	ldr	r3, [r3]
	ldr	r2, .L35+12
	ldr	r1, .L35+24
	mov	r0, r3
	bl	fprintf
.L30:
	ldr	r3, [fp, #-1036]
	cmn	r3, #1
	beq	.L31
	ldr	r3, [fp, #-1036]
	cmp	r3, #1
	bne	.L32
	ldr	r3, .L35+28
	ldr	r2, [r3]
	ldr	r3, .L35+32
	mov	r1, #1
	ldr	r0, [fp, #-1044]
	bl	httpd_resp_head
	ldr	r1, [fp, #-1040]
	ldr	r0, [fp, #-1044]
	bl	httpd_resp_file
	b	.L32
.L31:
	ldr	r3, .L35+32
	mov	r2, #0
	mvn	r1, #0
	ldr	r0, [fp, #-1044]
	bl	httpd_resp_head
	nop
.L32:
	mov	r3, #0
	ldr	r2, .L35
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L34
	bl	__stack_chk_fail
.L34:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	.LC14
	.word	1023
	.word	.LC11
	.word	req_fname
	.word	debug
	.word	stdout
	.word	.LC12
	.word	content_length
	.word	.LC13
	.size	httpd_serve, .-httpd_serve
	.section	.rodata
	.align	2
.LC15:
	.ascii	"GET / HTTP/1.0\000"
	.align	2
.LC16:
	.ascii	"GET /\000"
	.align	2
.LC17:
	.ascii	"GET /%s HTTP\000"
	.text
	.align	2
	.global	httpd_parse_req
	.syntax unified
	.arm
	.fpu softvfp
	.type	httpd_parse_req, %function
httpd_parse_req:
	@ 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]
	str	r1, [fp, #-12]
	mov	r2, #14
	ldr	r1, .L41
	ldr	r0, [fp, #-8]
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L38
	mov	r3, #1
	b	.L39
.L38:
	mov	r2, #5
	ldr	r1, .L41+4
	ldr	r0, [fp, #-8]
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L40
	ldr	r2, [fp, #-12]
	ldr	r1, .L41+8
	ldr	r0, [fp, #-8]
	bl	__isoc99_sscanf
	mov	r3, #1
	b	.L39
.L40:
	mvn	r3, #0
.L39:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L42:
	.align	2
.L41:
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.size	httpd_parse_req, .-httpd_parse_req
	.section	.rodata
	.align	2
.LC18:
	.ascii	"HTTP/1.1 200 OK\012Date:\012Server: Fakehttpd\012Co"
	.ascii	"ntent-Length: %ld\012Connection: close\012Content-T"
	.ascii	"ype: text/html; charset=utf-8\012\012\000"
	.align	2
.LC19:
	.ascii	"HTTP/1.1 501 Not Implemented\012Date:\012Server: Fa"
	.ascii	"kehttpd\012Content-Length: 0\012Connection: close\012"
	.ascii	"Content-Type: text/html; charset=utf-8\012\012\000"
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	httpd_resp_head
	.syntax unified
	.arm
	.fpu softvfp
	.type	httpd_resp_head, %function
httpd_resp_head:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1040]
	str	r1, [fp, #-1044]
	str	r2, [fp, #-1048]
	str	r3, [fp, #-1052]
	ldr	r3, .L50
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
	ldr	r3, [fp, #-1044]
	cmn	r3, #1
	beq	.L44
	ldr	r3, [fp, #-1044]
	cmp	r3, #1
	bne	.L45
	ldr	r3, .L50+4
	ldr	r3, [r3]
	sub	r0, fp, #1024
	sub	r0, r0, #4
	sub	r0, r0, #4
	ldr	r2, .L50+8
	mov	r1, #1024
	bl	snprintf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	strnlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1040]
	bl	write
	b	.L46
.L44:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L50+12
	mov	r1, #1024
	mov	r0, r3
	bl	snprintf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1024
	mov	r0, r3
	bl	strnlen
	mov	r2, r0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1040]
	bl	write
	b	.L46
.L45:
	mvn	r3, #0
	b	.L48
.L46:
	mov	r3, #0
.L48:
	ldr	r2, .L50
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L49
	bl	__stack_chk_fail
.L49:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L51:
	.align	2
.L50:
	.word	.LC20
	.word	content_length
	.word	.LC18
	.word	.LC19
	.size	httpd_resp_head, .-httpd_resp_head
	.align	2
	.global	httpd_resp_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	httpd_resp_file, %function
httpd_resp_file:
	@ 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]
	str	r1, [fp, #-12]
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	open
	mov	r3, r0
	ldr	r2, .L56
	str	r3, [r2]
	ldr	r3, .L56+4
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
	b	.L53
.L54:
	mov	r1, #1024
	ldr	r0, .L56+4
	bl	strnlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L56+4
	ldr	r0, [fp, #-8]
	bl	write
	ldr	r3, .L56+4
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
.L53:
	ldr	r3, .L56
	ldr	r3, [r3]
	mov	r2, #1024
	ldr	r1, .L56+4
	mov	r0, r3
	bl	read
	mov	r3, r0
	ldr	r2, .L56+8
	str	r3, [r2]
	ldr	r3, .L56+8
	ldr	r3, [r3]
	cmp	r3, #0
	bgt	.L54
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L57:
	.align	2
.L56:
	.word	openfd
	.word	buffer
	.word	readn
	.size	httpd_resp_file, .-httpd_resp_file
	.align	2
	.global	handle_sig
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_sig, %function
handle_sig:
	@ 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	r3, [fp, #-8]
	cmp	r3, #2
	bne	.L60
	ldr	r3, .L61
	ldr	r3, [r3]
	mov	r1, #2
	mov	r0, r3
	bl	shutdown
	mov	r0, #12
	bl	_exit
.L60:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L62:
	.align	2
.L61:
	.word	connfd
	.size	handle_sig, .-handle_sig
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
