	.file	"150992.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"usage: ws portnum\n"
.LC1:
	.string	"r"
.LC2:
	.string	"got a call: request = %s"
	.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 48
	mov	DWORD PTR -8228[rbp], edi
	mov	QWORD PTR -8240[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -8228[rbp], 1
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 18
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -8240[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	mov	eax, 0
	call	atoi@PLT
	mov	edi, eax
	mov	eax, 0
	call	make_server_socket@PLT
	mov	DWORD PTR -8224[rbp], eax
	cmp	DWORD PTR -8224[rbp], -1
	jne	.L3
	mov	edi, 2
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -8224[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	mov	eax, 0
	call	accept@PLT
	mov	DWORD PTR -8220[rbp], eax
	mov	eax, DWORD PTR -8220[rbp]
	lea	rsi, .LC1[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -8216[rbp], rax
	mov	rdx, QWORD PTR -8216[rbp]
	lea	rax, -8208[rbp]
	mov	esi, 8192
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -8208[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8216[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	read_til_crnl
	mov	edx, DWORD PTR -8220[rbp]
	lea	rax, -8208[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	process_rq
	mov	rax, QWORD PTR -8216[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L3
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC3:
	.string	"\r\n"
	.text
	.globl	read_til_crnl
	.type	read_til_crnl, @function
read_til_crnl:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 32
	mov	QWORD PTR -8216[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	nop
.L7:
	mov	rdx, QWORD PTR -8216[rbp]
	lea	rax, -8208[rbp]
	mov	esi, 8192
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	je	.L6
	lea	rax, -8208[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L7
.L6:
	nop
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_til_crnl, .-read_til_crnl
	.section	.rodata
.LC4:
	.string	"fork"
.LC5:
	.string	"%s%s"
.LC6:
	.string	"sscanf"
.LC7:
	.string	"GET"
	.text
	.globl	process_rq
	.type	process_rq, @function
process_rq:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -16384[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 32
	mov	QWORD PTR -16408[rbp], rdi
	mov	DWORD PTR -16412[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	fork@PLT
	test	eax, eax
	je	.L10
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L9
.L10:
	lea	rax, -8208[rbp]
	mov	WORD PTR [rax], 12078
	mov	BYTE PTR 2[rax], 0
	lea	rax, -8208[rbp]
	add	rax, 2
	lea	rdx, -16400[rbp]
	mov	rdi, QWORD PTR -16408[rbp]
	mov	rcx, rax
	lea	rsi, .LC5[rip]
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 2
	je	.L12
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L9
.L12:
	lea	rax, -16400[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L13
	mov	eax, DWORD PTR -16412[rbp]
	mov	edi, eax
	mov	eax, 0
	call	cannot_do
	jmp	.L14
.L13:
	lea	rax, -8208[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	not_exist
	test	eax, eax
	je	.L15
	mov	edx, DWORD PTR -16412[rbp]
	lea	rax, -8208[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	do_404
	jmp	.L14
.L15:
	lea	rax, -8208[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	isadir
	test	eax, eax
	je	.L16
	mov	edx, DWORD PTR -16412[rbp]
	lea	rax, -8208[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	do_ls
	jmp	.L14
.L16:
	lea	rax, -8208[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	ends_in_cgi
	test	eax, eax
	je	.L17
	mov	edx, DWORD PTR -16412[rbp]
	lea	rax, -8208[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	do_exec
	jmp	.L14
.L17:
	mov	edx, DWORD PTR -16412[rbp]
	lea	rax, -8208[rbp]
	mov	esi, edx
	mov	rdi, rax
	mov	eax, 0
	call	do_cat
.L14:
.L9:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	process_rq, .-process_rq
	.section	.rodata
.LC8:
	.string	"HTTP/1.0 200 OK\r\n"
.LC9:
	.string	"Content-type: %s\r\n"
	.text
	.globl	header
	.type	header, @function
header:
.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	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	cmp	QWORD PTR -16[rbp], 0
	je	.L21
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L21:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	header, .-header
	.section	.rodata
.LC10:
	.string	"w"
	.align 8
.LC11:
	.string	"HTTP/1.0 501 Not Implemented\r\n"
.LC12:
	.string	"Content-type: text/plain\r\n"
	.align 8
.LC13:
	.string	"That command is not yet implemented\r\n"
	.text
	.globl	cannot_do
	.type	cannot_do, @function
cannot_do:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	lea	rsi, .LC10[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 2
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 37
	mov	esi, 1
	lea	rdi, .LC13[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cannot_do, .-cannot_do
	.section	.rodata
.LC14:
	.string	"HTTP/1.0 404 Not Found\r\n"
	.align 8
.LC15:
	.string	"The item you requested: %s\r\nis not found\r\n"
	.text
	.globl	do_404
	.type	do_404, @function
do_404:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	lea	rsi, .LC10[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 26
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 2
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	do_404, .-do_404
	.globl	isadir
	.type	isadir, @function
isadir:
.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, 176
	mov	QWORD PTR -168[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -168[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	je	.L25
	mov	eax, DWORD PTR -136[rbp]
	and	eax, 61440
	cmp	eax, 16384
	jne	.L25
	mov	eax, 1
	jmp	.L27
.L25:
	mov	eax, 0
.L27:
	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
.LFE12:
	.size	isadir, .-isadir
	.globl	not_exist
	.type	not_exist, @function
not_exist:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 176
	mov	QWORD PTR -168[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -168[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	sete	al
	movzx	eax, al
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L31
	call	__stack_chk_fail@PLT
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	not_exist, .-not_exist
	.section	.rodata
.LC16:
	.string	"text/plain"
.LC17:
	.string	"-l"
.LC18:
	.string	"ls"
	.text
	.globl	do_ls
	.type	do_ls, @function
do_ls:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	lea	rsi, .LC10[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC16[rip]
	mov	rdi, rax
	call	header
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 2
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, 2
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	r8d, 0
	mov	rcx, rax
	lea	rdx, .LC17[rip]
	lea	rsi, .LC18[rip]
	lea	rdi, .LC18[rip]
	mov	eax, 0
	call	execlp@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE14:
	.size	do_ls, .-do_ls
	.section	.rodata
.LC19:
	.string	""
	.text
	.globl	file_type
	.type	file_type, @function
file_type:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L34
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	jmp	.L35
.L34:
	lea	rax, .LC19[rip]
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	file_type, .-file_type
	.section	.rodata
.LC20:
	.string	"cgi"
	.text
	.globl	ends_in_cgi
	.type	ends_in_cgi, @function
ends_in_cgi:
.LFB16:
	.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	file_type
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	sete	al
	movzx	eax, al
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	ends_in_cgi, .-ends_in_cgi
	.globl	do_exec
	.type	do_exec, @function
do_exec:
.LFB17:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	lea	rsi, .LC10[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	header
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, 1
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, 2
	mov	edi, eax
	mov	eax, 0
	call	dup2@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	execl@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	do_exec, .-do_exec
	.section	.rodata
.LC21:
	.string	"html"
.LC22:
	.string	"text/html"
.LC23:
	.string	"gif"
.LC24:
	.string	"image/gif"
.LC25:
	.string	"jpg"
.LC26:
	.string	"image/jpeg"
.LC27:
	.string	"jpeg"
	.text
	.globl	do_cat
	.type	do_cat, @function
do_cat:
.LFB18:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	DWORD PTR -60[rbp], esi
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	file_type
	mov	QWORD PTR -24[rbp], rax
	lea	rax, .LC16[rip]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC21[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L40
	lea	rax, .LC22[rip]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L41
.L40:
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC23[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L42
	lea	rax, .LC24[rip]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L41
.L42:
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC25[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L43
	lea	rax, .LC26[rip]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L41
.L43:
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC27[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L41
	lea	rax, .LC26[rip]
	mov	QWORD PTR -32[rbp], rax
.L41:
	mov	eax, DWORD PTR -60[rbp]
	lea	rsi, .LC10[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L44
	cmp	QWORD PTR -8[rbp], 0
	je	.L44
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	header
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	mov	edx, 2
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	jmp	.L45
.L46:
	mov	rdx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
.L45:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L46
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L44:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE18:
	.size	do_cat, .-do_cat
	.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	"150992.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: ws portnum\012\000"
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"got a call: request = %s\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8216
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #8192
	sub	sp, sp, #28
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r0, [r3, #-20]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	str	r1, [r3, #-24]
	ldr	r3, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-20]
	cmp	r3, #1
	bne	.L2
	ldr	r3, .L5+4
	ldr	r3, [r3]
	mov	r2, #18
	mov	r1, #1
	ldr	r0, .L5+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-24]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	sub	r2, fp, #8192
	sub	r2, r2, #12
	mov	r4, r2
	mov	r0, r3
	bl	make_server_socket
	str	r0, [r4, #-16]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r3, [r3, #-16]
	cmn	r3, #1
	bne	.L3
	mov	r0, #2
	bl	exit
.L3:
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [r3, #-16]
	bl	accept
	str	r0, [r4, #-12]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, .L5+12
	ldr	r0, [r3, #-12]
	bl	fdopen
	str	r0, [r4, #-8]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r2, [r2, #-8]
	mov	r1, #8192
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L5+16
	bl	printf
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-8]
	bl	read_til_crnl
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	sub	r3, r3, #4
	ldr	r1, [r2, #-12]
	mov	r0, r3
	bl	process_rq
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r0, [r3, #-8]
	bl	fclose
	b	.L3
.L6:
	.align	2
.L5:
	.word	.LC3
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"\015\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_til_crnl
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_til_crnl, %function
read_til_crnl:
	@ args = 0, pretend = 0, frame = 8208
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8192
	sub	sp, sp, #16
	sub	r3, fp, #8192
	sub	r3, r3, #4
	str	r0, [r3, #-12]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	nop
.L9:
	sub	r3, fp, #8192
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [r2, #-12]
	mov	r1, #8192
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	beq	.L8
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L11+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
.L8:
	nop
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC5
	.word	.LC4
	.size	read_til_crnl, .-read_til_crnl
	.section	.rodata
	.align	2
.LC6:
	.ascii	"fork\000"
	.align	2
.LC7:
	.ascii	"./\000"
	.align	2
.LC8:
	.ascii	"%s%s\000"
	.align	2
.LC9:
	.ascii	"sscanf\000"
	.align	2
.LC10:
	.ascii	"GET\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	process_rq
	.syntax unified
	.arm
	.fpu softvfp
	.type	process_rq, %function
process_rq:
	@ args = 0, pretend = 0, frame = 16400
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16384
	sub	sp, sp, #16
	sub	r3, fp, #16384
	sub	r3, r3, #4
	str	r0, [r3, #-12]
	sub	r3, fp, #16384
	sub	r3, r3, #4
	str	r1, [r3, #-16]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	ldr	r0, .L24+4
	bl	perror
	mov	r3, #1
	b	.L13
.L14:
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, .L24+8
	ldr	r2, [r2]
	strh	r2, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r2, #16
	strb	r2, [r3]
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r3, r3, #2
	sub	r2, fp, #16384
	sub	r2, r2, #4
	sub	r2, r2, #4
	sub	r1, fp, #16384
	sub	r1, r1, #4
	mov	r0, r1
	ldr	r1, .L24+12
	ldr	r0, [r0, #-12]
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #2
	beq	.L16
	ldr	r0, .L24+16
	bl	perror
	mov	r3, #1
	b	.L13
.L16:
	sub	r3, fp, #16384
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L24+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	sub	r3, fp, #16384
	sub	r3, r3, #4
	ldr	r0, [r3, #-16]
	bl	cannot_do
	b	.L18
.L17:
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	not_exist
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	sub	r3, fp, #16384
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [r2, #-16]
	mov	r0, r3
	bl	do_404
	b	.L18
.L19:
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	isadir
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	sub	r3, fp, #16384
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [r2, #-16]
	mov	r0, r3
	bl	do_ls
	b	.L18
.L20:
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	ends_in_cgi
	mov	r3, r0
	cmp	r3, #0
	beq	.L21
	sub	r3, fp, #16384
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [r2, #-16]
	mov	r0, r3
	bl	do_exec
	b	.L18
.L21:
	sub	r3, fp, #16384
	sub	r3, r3, #4
	mov	r2, r3
	sub	r3, fp, #8192
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, [r2, #-16]
	mov	r0, r3
	bl	do_cat
.L18:
.L13:
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC11
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	process_rq, .-process_rq
	.section	.rodata
	.align	2
.LC12:
	.ascii	"HTTP/1.0 200 OK\015\012\000"
	.align	2
.LC13:
	.ascii	"Content-type: %s\015\012\000"
	.text
	.align	2
	.global	header
	.syntax unified
	.arm
	.fpu softvfp
	.type	header, %function
header:
	@ 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, [fp, #-8]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L28
	bl	fwrite
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L27
	ldr	r2, [fp, #-12]
	ldr	r1, .L28+4
	ldr	r0, [fp, #-8]
	bl	fprintf
.L27:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC12
	.word	.LC13
	.size	header, .-header
	.section	.rodata
	.align	2
.LC14:
	.ascii	"w\000"
	.align	2
.LC15:
	.ascii	"HTTP/1.0 501 Not Implemented\015\012\000"
	.align	2
.LC16:
	.ascii	"Content-type: text/plain\015\012\000"
	.align	2
.LC17:
	.ascii	"That command is not yet implemented\015\012\000"
	.text
	.align	2
	.global	cannot_do
	.syntax unified
	.arm
	.fpu softvfp
	.type	cannot_do, %function
cannot_do:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r1, .L31
	ldr	r0, [fp, #-16]
	bl	fdopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L31+4
	bl	fwrite
	ldr	r3, [fp, #-8]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L31+8
	bl	fwrite
	ldr	r3, [fp, #-8]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, .L31+12
	bl	fwrite
	ldr	r3, [fp, #-8]
	mov	r2, #37
	mov	r1, #1
	ldr	r0, .L31+16
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC4
	.word	.LC17
	.size	cannot_do, .-cannot_do
	.section	.rodata
	.align	2
.LC18:
	.ascii	"HTTP/1.0 404 Not Found\015\012\000"
	.align	2
.LC19:
	.ascii	"The item you requested: %s\015\012is not found\015\012"
	.ascii	"\000"
	.text
	.align	2
	.global	do_404
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_404, %function
do_404:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, .L34
	ldr	r0, [fp, #-20]
	bl	fdopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L34+4
	bl	fwrite
	ldr	r3, [fp, #-8]
	mov	r2, #26
	mov	r1, #1
	ldr	r0, .L34+8
	bl	fwrite
	ldr	r3, [fp, #-8]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, .L34+12
	bl	fwrite
	ldr	r2, [fp, #-16]
	ldr	r1, .L34+16
	ldr	r0, [fp, #-8]
	bl	fprintf
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC14
	.word	.LC18
	.word	.LC16
	.word	.LC4
	.word	.LC19
	.size	do_404, .-do_404
	.section	.rodata
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	isadir
	.syntax unified
	.arm
	.fpu softvfp
	.type	isadir, %function
isadir:
	@ 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, .L41
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	beq	.L37
	ldr	r3, [fp, #-84]
	and	r3, r3, #61440
	cmp	r3, #16384
	bne	.L37
	mov	r3, #1
	b	.L39
.L37:
	mov	r3, #0
.L39:
	ldr	r2, .L41
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L40
	bl	__stack_chk_fail
.L40:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L42:
	.align	2
.L41:
	.word	.LC20
	.size	isadir, .-isadir
	.section	.rodata
	.align	2
.LC21:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	not_exist
	.syntax unified
	.arm
	.fpu softvfp
	.type	not_exist, %function
not_exist:
	@ 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, .L46
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	ldr	r2, .L46
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L45
	bl	__stack_chk_fail
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L47:
	.align	2
.L46:
	.word	.LC21
	.size	not_exist, .-not_exist
	.section	.rodata
	.align	2
.LC22:
	.ascii	"text/plain\000"
	.align	2
.LC23:
	.ascii	"-l\000"
	.align	2
.LC24:
	.ascii	"ls\000"
	.text
	.align	2
	.global	do_ls
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_ls, %function
do_ls:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, .L49
	ldr	r0, [fp, #-20]
	bl	fdopen
	str	r0, [fp, #-8]
	ldr	r1, .L49+4
	ldr	r0, [fp, #-8]
	bl	header
	ldr	r3, [fp, #-8]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, .L49+8
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	fflush
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	dup2
	mov	r1, #2
	ldr	r0, [fp, #-20]
	bl	dup2
	ldr	r0, [fp, #-20]
	bl	close
	mov	r3, #0
	str	r3, [sp]
	ldr	r3, [fp, #-16]
	ldr	r2, .L49+12
	ldr	r1, .L49+16
	ldr	r0, .L49+16
	bl	execlp
	ldr	r0, [fp, #-16]
	bl	perror
	mov	r0, #1
	bl	exit
.L50:
	.align	2
.L49:
	.word	.LC14
	.word	.LC22
	.word	.LC4
	.word	.LC23
	.word	.LC24
	.size	do_ls, .-do_ls
	.section	.rodata
	.align	2
.LC25:
	.ascii	"\000"
	.text
	.align	2
	.global	file_type
	.syntax unified
	.arm
	.fpu softvfp
	.type	file_type, %function
file_type:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r1, #46
	ldr	r0, [fp, #-16]
	bl	strrchr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L52
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	b	.L53
.L52:
	ldr	r3, .L54
.L53:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L55:
	.align	2
.L54:
	.word	.LC25
	.size	file_type, .-file_type
	.section	.rodata
	.align	2
.LC26:
	.ascii	"cgi\000"
	.text
	.align	2
	.global	ends_in_cgi
	.syntax unified
	.arm
	.fpu softvfp
	.type	ends_in_cgi, %function
ends_in_cgi:
	@ 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	file_type
	mov	r3, r0
	ldr	r1, .L58
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L59:
	.align	2
.L58:
	.word	.LC26
	.size	ends_in_cgi, .-ends_in_cgi
	.align	2
	.global	do_exec
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_exec, %function
do_exec:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, .L61
	ldr	r0, [fp, #-20]
	bl	fdopen
	str	r0, [fp, #-8]
	mov	r1, #0
	ldr	r0, [fp, #-8]
	bl	header
	ldr	r0, [fp, #-8]
	bl	fflush
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	dup2
	mov	r1, #2
	ldr	r0, [fp, #-20]
	bl	dup2
	ldr	r0, [fp, #-20]
	bl	close
	mov	r2, #0
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-16]
	bl	execl
	ldr	r0, [fp, #-16]
	bl	perror
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L62:
	.align	2
.L61:
	.word	.LC14
	.size	do_exec, .-do_exec
	.section	.rodata
	.align	2
.LC27:
	.ascii	"html\000"
	.align	2
.LC28:
	.ascii	"text/html\000"
	.align	2
.LC29:
	.ascii	"gif\000"
	.align	2
.LC30:
	.ascii	"image/gif\000"
	.align	2
.LC31:
	.ascii	"jpg\000"
	.align	2
.LC32:
	.ascii	"image/jpeg\000"
	.align	2
.LC33:
	.ascii	"jpeg\000"
	.text
	.align	2
	.global	do_cat
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_cat, %function
do_cat:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	file_type
	str	r0, [fp, #-20]
	ldr	r3, .L71
	str	r3, [fp, #-24]
	ldr	r1, .L71+4
	ldr	r0, [fp, #-20]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L64
	ldr	r3, .L71+8
	str	r3, [fp, #-24]
	b	.L65
.L64:
	ldr	r1, .L71+12
	ldr	r0, [fp, #-20]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L66
	ldr	r3, .L71+16
	str	r3, [fp, #-24]
	b	.L65
.L66:
	ldr	r1, .L71+20
	ldr	r0, [fp, #-20]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L67
	ldr	r3, .L71+24
	str	r3, [fp, #-24]
	b	.L65
.L67:
	ldr	r1, .L71+28
	ldr	r0, [fp, #-20]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L65
	ldr	r3, .L71+24
	str	r3, [fp, #-24]
.L65:
	ldr	r1, .L71+32
	ldr	r0, [fp, #-36]
	bl	fdopen
	str	r0, [fp, #-16]
	ldr	r1, .L71+36
	ldr	r0, [fp, #-32]
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L68
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L68
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-16]
	bl	header
	ldr	r3, [fp, #-16]
	mov	r2, #2
	mov	r1, #1
	ldr	r0, .L71+40
	bl	fwrite
	b	.L69
.L70:
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-8]
	bl	putc
.L69:
	ldr	r0, [fp, #-12]
	bl	getc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L70
	ldr	r0, [fp, #-12]
	bl	fclose
	ldr	r0, [fp, #-16]
	bl	fclose
.L68:
	mov	r0, #0
	bl	exit
.L72:
	.align	2
.L71:
	.word	.LC22
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC30
	.word	.LC31
	.word	.LC32
	.word	.LC33
	.word	.LC14
	.word	.LC1
	.word	.LC4
	.size	do_cat, .-do_cat
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
