	.file	"161080732.c"
	.intel_syntax noprefix
	.text
	.globl	memory
	.bss
	.align 32
	.type	memory, @object
	.size	memory, 131070
memory:
	.zero	131070
	.globl	reg
	.align 16
	.type	reg, @object
	.size	reg, 20
reg:
	.zero	20
	.text
	.globl	sign_extend
	.type	sign_extend, @function
sign_extend:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	DWORD PTR -8[rbp], esi
	mov	WORD PTR -4[rbp], ax
	movzx	edx, WORD PTR -4[rbp]
	mov	eax, DWORD PTR -8[rbp]
	sub	eax, 1
	mov	ecx, eax
	sar	edx, cl
	mov	eax, edx
	and	eax, 1
	test	eax, eax
	je	.L2
	mov	eax, DWORD PTR -8[rbp]
	mov	edx, 65535
	mov	ecx, eax
	sal	edx, cl
	mov	eax, edx
	mov	edx, eax
	movzx	eax, WORD PTR -4[rbp]
	or	eax, edx
	mov	WORD PTR -4[rbp], ax
.L2:
	movzx	eax, WORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	sign_extend, .-sign_extend
	.globl	swap16
	.type	swap16, @function
swap16:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	WORD PTR -4[rbp], ax
	movzx	eax, WORD PTR -4[rbp]
	sal	eax, 8
	mov	edx, eax
	movzx	eax, WORD PTR -4[rbp]
	shr	ax, 8
	or	eax, edx
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	swap16, .-swap16
	.globl	update_flags
	.type	update_flags, @function
update_flags:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, edi
	mov	WORD PTR -4[rbp], ax
	movzx	eax, WORD PTR -4[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	test	ax, ax
	jne	.L7
	mov	WORD PTR reg[rip+18], 2
	jmp	.L10
.L7:
	movzx	eax, WORD PTR -4[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	test	ax, ax
	jns	.L9
	mov	WORD PTR reg[rip+18], 4
	jmp	.L10
.L9:
	mov	WORD PTR reg[rip+18], 1
.L10:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	update_flags, .-update_flags
	.globl	read_image_file
	.type	read_image_file, @function
read_image_file:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -28[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 2
	mov	rdi, rax
	call	fread@PLT
	movzx	eax, WORD PTR -28[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	swap16
	mov	WORD PTR -28[rbp], ax
	movzx	eax, WORD PTR -28[rbp]
	not	eax
	mov	WORD PTR -26[rbp], ax
	movzx	eax, WORD PTR -28[rbp]
	movzx	eax, ax
	lea	rdx, [rax+rax]
	lea	rax, memory[rip]
	add	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	movzx	edx, WORD PTR -26[rbp]
	mov	rcx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	fread@PLT
	mov	QWORD PTR -16[rbp], rax
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	mov	edi, eax
	call	swap16
	mov	rdx, QWORD PTR -24[rbp]
	mov	WORD PTR [rdx], ax
	add	QWORD PTR -24[rbp], 2
.L12:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, -1[rax]
	mov	QWORD PTR -16[rbp], rdx
	test	rax, rax
	jne	.L13
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	read_image_file, .-read_image_file
	.section	.rodata
.LC0:
	.string	"rb"
	.text
	.globl	read_image
	.type	read_image, @function
read_image:
.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L16
	mov	eax, 0
	jmp	.L17
.L16:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	read_image_file
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	read_image, .-read_image
	.globl	check_key
	.type	check_key, @function
check_key:
.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, 176
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 0
	mov	ecx, 16
	lea	rdx, -144[rbp]
	mov	rdi, rdx
#APP
# 157 "the_stack_data/161080732.c" 1
	cld; rep; stosq
# 0 "" 2
#NO_APP
	mov	eax, edi
	mov	edx, ecx
	mov	DWORD PTR -168[rbp], edx
	mov	DWORD PTR -164[rbp], eax
	mov	rax, QWORD PTR -144[rbp]
	or	rax, 1
	mov	QWORD PTR -144[rbp], rax
	mov	QWORD PTR -160[rbp], 0
	mov	QWORD PTR -152[rbp], 0
	lea	rdx, -160[rbp]
	lea	rax, -144[rbp]
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 1
	call	select@PLT
	test	eax, eax
	setne	al
	movzx	eax, al
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	check_key, .-check_key
	.globl	mem_write
	.type	mem_write, @function
mem_write:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edx, edi
	mov	eax, esi
	mov	WORD PTR -4[rbp], dx
	mov	WORD PTR -8[rbp], ax
	movzx	eax, WORD PTR -4[rbp]
	cdqe
	lea	rcx, [rax+rax]
	lea	rdx, memory[rip]
	movzx	eax, WORD PTR -8[rbp]
	mov	WORD PTR [rcx+rdx], ax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	mem_write, .-mem_write
	.globl	mem_read
	.type	mem_read, @function
mem_read:
.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, 16
	mov	eax, edi
	mov	WORD PTR -4[rbp], ax
	cmp	WORD PTR -4[rbp], -512
	jne	.L23
	mov	eax, 0
	call	check_key
	test	ax, ax
	je	.L24
	mov	WORD PTR memory[rip+130048], -32768
	call	getchar@PLT
	mov	WORD PTR memory[rip+130052], ax
	jmp	.L23
.L24:
	mov	WORD PTR memory[rip+130048], 0
.L23:
	movzx	eax, WORD PTR -4[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, memory[rip]
	movzx	eax, WORD PTR [rdx+rax]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	mem_read, .-mem_read
	.globl	original_tio
	.bss
	.align 32
	.type	original_tio, @object
	.size	original_tio, 60
original_tio:
	.zero	60
	.text
	.globl	disable_input_buffering
	.type	disable_input_buffering, @function
disable_input_buffering:
.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, 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, original_tio[rip]
	mov	edi, 0
	call	tcgetattr@PLT
	mov	rax, QWORD PTR original_tio[rip]
	mov	rdx, QWORD PTR original_tio[rip+8]
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR original_tio[rip+16]
	mov	rdx, QWORD PTR original_tio[rip+24]
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR original_tio[rip+32]
	mov	rdx, QWORD PTR original_tio[rip+40]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR original_tio[rip+48]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR original_tio[rip+56]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -11
	mov	DWORD PTR -68[rbp], eax
	lea	rax, -80[rbp]
	mov	rdx, rax
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	disable_input_buffering, .-disable_input_buffering
	.globl	restore_input_buffering
	.type	restore_input_buffering, @function
restore_input_buffering:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdx, original_tio[rip]
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	restore_input_buffering, .-restore_input_buffering
	.globl	handle_interrupt
	.type	handle_interrupt, @function
handle_interrupt:
.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	DWORD PTR -4[rbp], edi
	mov	eax, 0
	call	restore_input_buffering
	mov	edi, 10
	call	putchar@PLT
	mov	edi, -2
	call	exit@PLT
	.cfi_endproc
.LFE16:
	.size	handle_interrupt, .-handle_interrupt
	.section	.rodata
.LC1:
	.string	"lc3 [image-file1] ..."
.LC2:
	.string	"failed to load image: %s\n"
.LC3:
	.string	"Enter a character: "
.LC4:
	.string	"HALT"
	.text
	.globl	main
	.type	main, @function
main:
.LFB17:
	.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, 136
	.cfi_offset 3, -24
	mov	DWORD PTR -132[rbp], edi
	mov	QWORD PTR -144[rbp], rsi
	cmp	DWORD PTR -132[rbp], 1
	jg	.L31
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 2
	call	exit@PLT
.L31:
	mov	DWORD PTR -40[rbp], 1
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -144[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	read_image
	test	eax, eax
	jne	.L33
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -144[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L33:
	add	DWORD PTR -40[rbp], 1
.L32:
	mov	eax, DWORD PTR -40[rbp]
	cmp	eax, DWORD PTR -132[rbp]
	jl	.L34
	lea	rsi, handle_interrupt[rip]
	mov	edi, 2
	call	signal@PLT
	mov	eax, 0
	call	disable_input_buffering
	mov	WORD PTR reg[rip+16], 12288
	mov	DWORD PTR -36[rbp], 1
	jmp	.L35
.L72:
	movzx	eax, WORD PTR reg[rip+16]
	lea	edx, 1[rax]
	mov	WORD PTR reg[rip+16], dx
	movzx	eax, ax
	mov	edi, eax
	call	mem_read
	mov	WORD PTR -112[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 12
	mov	WORD PTR -110[rbp], ax
	movzx	eax, WORD PTR -110[rbp]
	cmp	eax, 15
	ja	.L36
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L38[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L38[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L38:
	.long	.L51-.L38
	.long	.L50-.L38
	.long	.L49-.L38
	.long	.L48-.L38
	.long	.L47-.L38
	.long	.L46-.L38
	.long	.L45-.L38
	.long	.L44-.L38
	.long	.L36-.L38
	.long	.L43-.L38
	.long	.L42-.L38
	.long	.L41-.L38
	.long	.L40-.L38
	.long	.L36-.L38
	.long	.L39-.L38
	.long	.L37-.L38
	.text
.L50:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -54[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -52[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 5
	and	eax, 1
	mov	WORD PTR -50[rbp], ax
	cmp	WORD PTR -50[rbp], 0
	je	.L52
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 31
	mov	esi, 5
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -46[rbp], ax
	movzx	eax, WORD PTR -52[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	ecx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -54[rbp]
	movzx	edx, WORD PTR -46[rbp]
	add	ecx, edx
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	mov	WORD PTR [rdx+rax], cx
	jmp	.L53
.L52:
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 7
	mov	WORD PTR -48[rbp], ax
	movzx	eax, WORD PTR -52[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	ecx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -48[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	edx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -54[rbp]
	add	ecx, edx
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	mov	WORD PTR [rdx+rax], cx
.L53:
	movzx	eax, WORD PTR -54[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L46:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -78[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -76[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 5
	and	eax, 1
	mov	WORD PTR -74[rbp], ax
	cmp	WORD PTR -74[rbp], 0
	je	.L54
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 31
	mov	esi, 5
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -70[rbp], ax
	movzx	eax, WORD PTR -76[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, WORD PTR -78[rbp]
	and	ax, WORD PTR -70[rbp]
	movsx	rdx, edx
	lea	rcx, [rdx+rdx]
	lea	rdx, reg[rip]
	mov	WORD PTR [rcx+rdx], ax
	jmp	.L55
.L54:
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 7
	mov	WORD PTR -72[rbp], ax
	movzx	eax, WORD PTR -76[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	ecx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -72[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	edx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -78[rbp]
	and	ecx, edx
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	mov	WORD PTR [rdx+rax], cx
.L55:
	movzx	eax, WORD PTR -78[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L43:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -94[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -92[rbp], ax
	movzx	eax, WORD PTR -92[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	edx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -94[rbp]
	mov	ecx, edx
	not	ecx
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	mov	WORD PTR [rdx+rax], cx
	movzx	eax, WORD PTR -94[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L51:
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -44[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -42[rbp], ax
	movzx	eax, WORD PTR reg[rip+18]
	and	ax, WORD PTR -42[rbp]
	test	ax, ax
	je	.L35
	movzx	edx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -44[rbp]
	add	eax, edx
	mov	WORD PTR reg[rip+16], ax
	jmp	.L35
.L40:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -104[rbp], ax
	movzx	eax, WORD PTR -104[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	mov	WORD PTR reg[rip+16], ax
	jmp	.L35
.L47:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -68[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 2047
	mov	esi, 11
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -66[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 11
	and	eax, 1
	mov	WORD PTR -64[rbp], ax
	movzx	eax, WORD PTR reg[rip+16]
	mov	WORD PTR reg[rip+14], ax
	cmp	WORD PTR -64[rbp], 0
	je	.L57
	movzx	edx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -66[rbp]
	add	eax, edx
	mov	WORD PTR reg[rip+16], ax
	jmp	.L35
.L57:
	movzx	eax, WORD PTR -68[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	mov	WORD PTR reg[rip+16], ax
	jmp	.L35
.L49:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -58[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -56[rbp], ax
	movzx	edx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -56[rbp]
	add	eax, edx
	movzx	eax, ax
	movzx	ebx, WORD PTR -58[rbp]
	mov	edi, eax
	call	mem_read
	movsx	rdx, ebx
	lea	rcx, [rdx+rdx]
	lea	rdx, reg[rip]
	mov	WORD PTR [rcx+rdx], ax
	movzx	eax, WORD PTR -58[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L42:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -98[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -96[rbp], ax
	movzx	edx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -96[rbp]
	add	eax, edx
	movzx	eax, ax
	mov	edi, eax
	call	mem_read
	movzx	eax, ax
	movzx	ebx, WORD PTR -98[rbp]
	mov	edi, eax
	call	mem_read
	movsx	rdx, ebx
	lea	rcx, [rdx+rdx]
	lea	rdx, reg[rip]
	mov	WORD PTR [rcx+rdx], ax
	movzx	eax, WORD PTR -98[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L45:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -84[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -82[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 63
	mov	esi, 6
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -80[rbp], ax
	movzx	eax, WORD PTR -82[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	edx, WORD PTR [rdx+rax]
	movzx	eax, WORD PTR -80[rbp]
	add	eax, edx
	movzx	eax, ax
	movzx	ebx, WORD PTR -84[rbp]
	mov	edi, eax
	call	mem_read
	movsx	rdx, ebx
	lea	rcx, [rdx+rdx]
	lea	rdx, reg[rip]
	mov	WORD PTR [rcx+rdx], ax
	movzx	eax, WORD PTR -84[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L39:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -108[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -106[rbp], ax
	movzx	ecx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -108[rbp]
	movzx	edx, WORD PTR -106[rbp]
	add	ecx, edx
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	mov	WORD PTR [rdx+rax], cx
	movzx	eax, WORD PTR -108[rbp]
	mov	edi, eax
	call	update_flags
	jmp	.L35
.L48:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -62[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -60[rbp], ax
	movzx	eax, WORD PTR -62[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	movzx	ecx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -60[rbp]
	add	eax, ecx
	movzx	eax, ax
	mov	esi, edx
	mov	edi, eax
	call	mem_write
	jmp	.L35
.L41:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -102[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 511
	mov	esi, 9
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -100[rbp], ax
	movzx	eax, WORD PTR -102[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	ebx, ax
	movzx	edx, WORD PTR reg[rip+16]
	movzx	eax, WORD PTR -100[rbp]
	add	eax, edx
	movzx	eax, ax
	mov	edi, eax
	call	mem_read
	movzx	eax, ax
	mov	esi, ebx
	mov	edi, eax
	call	mem_write
	jmp	.L35
.L44:
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 9
	and	eax, 7
	mov	WORD PTR -90[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	shr	ax, 6
	and	eax, 7
	mov	WORD PTR -88[rbp], ax
	movzx	eax, WORD PTR -112[rbp]
	and	eax, 63
	mov	esi, 6
	mov	edi, eax
	call	sign_extend
	mov	WORD PTR -86[rbp], ax
	movzx	eax, WORD PTR -90[rbp]
	cdqe
	lea	rdx, [rax+rax]
	lea	rax, reg[rip]
	movzx	eax, WORD PTR [rdx+rax]
	movzx	edx, ax
	movzx	eax, WORD PTR -88[rbp]
	cdqe
	lea	rcx, [rax+rax]
	lea	rax, reg[rip]
	movzx	ecx, WORD PTR [rcx+rax]
	movzx	eax, WORD PTR -86[rbp]
	add	eax, ecx
	movzx	eax, ax
	mov	esi, edx
	mov	edi, eax
	call	mem_write
	jmp	.L35
.L37:
	movzx	eax, WORD PTR -112[rbp]
	movzx	eax, al
	sub	eax, 32
	cmp	eax, 5
	ja	.L35
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L61[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L61[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L61:
	.long	.L66-.L61
	.long	.L65-.L61
	.long	.L64-.L61
	.long	.L63-.L61
	.long	.L62-.L61
	.long	.L60-.L61
	.text
.L66:
	call	getchar@PLT
	mov	WORD PTR reg[rip], ax
	jmp	.L59
.L65:
	mov	rdx, QWORD PTR stdout[rip]
	movzx	eax, WORD PTR reg[rip]
	movsx	eax, al
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L59
.L64:
	movzx	eax, WORD PTR reg[rip]
	movzx	eax, ax
	lea	rdx, [rax+rax]
	lea	rax, memory[rip]
	add	rax, rdx
	mov	QWORD PTR -32[rbp], rax
	jmp	.L67
.L68:
	mov	rdx, QWORD PTR stdout[rip]
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR [rax]
	movsx	eax, al
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	add	QWORD PTR -32[rbp], 2
.L67:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR [rax]
	test	ax, ax
	jne	.L68
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L59
.L63:
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	call	getchar@PLT
	mov	BYTE PTR -113[rbp], al
	mov	rdx, QWORD PTR stdout[rip]
	movsx	eax, BYTE PTR -113[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	movsx	ax, BYTE PTR -113[rbp]
	mov	WORD PTR reg[rip], ax
	jmp	.L59
.L62:
	movzx	eax, WORD PTR reg[rip]
	movzx	eax, ax
	lea	rdx, [rax+rax]
	lea	rax, memory[rip]
	add	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	jmp	.L69
.L71:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR [rax]
	mov	BYTE PTR -115[rbp], al
	mov	rdx, QWORD PTR stdout[rip]
	movsx	eax, BYTE PTR -115[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR [rax]
	shr	ax, 8
	mov	BYTE PTR -114[rbp], al
	cmp	BYTE PTR -114[rbp], 0
	je	.L70
	mov	rdx, QWORD PTR stdout[rip]
	movsx	eax, BYTE PTR -114[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
.L70:
	add	QWORD PTR -24[rbp], 2
.L69:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR [rax]
	test	ax, ax
	jne	.L71
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	jmp	.L59
.L60:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	DWORD PTR -36[rbp], 0
	nop
.L59:
	jmp	.L35
.L36:
	call	abort@PLT
.L35:
	cmp	DWORD PTR -36[rbp], 0
	jne	.L72
	mov	eax, 0
	call	restore_input_buffering
	mov	eax, 0
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.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	"161080732.c"
	.text
	.comm	memory,131070,4
	.comm	reg,20,4
	.align	2
	.global	sign_extend
	.syntax unified
	.arm
	.fpu softvfp
	.type	sign_extend, %function
sign_extend:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	str	r1, [fp, #-12]
	strh	r3, [fp, #-6]	@ movhi
	ldrh	r2, [fp, #-6]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	asr	r3, r2, r3
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L2
	ldr	r2, .L4
	ldr	r3, [fp, #-12]
	lsl	r3, r2, r3
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldrsh	r3, [fp, #-6]
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	strh	r3, [fp, #-6]	@ movhi
.L2:
	ldrh	r3, [fp, #-6]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L5:
	.align	2
.L4:
	.word	65535
	.size	sign_extend, .-sign_extend
	.align	2
	.global	swap16
	.syntax unified
	.arm
	.fpu softvfp
	.type	swap16, %function
swap16:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	strh	r3, [fp, #-6]	@ movhi
	ldrh	r3, [fp, #-6]
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldrh	r3, [fp, #-6]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #16
	asr	r3, r3, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r3, r3, #16
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	swap16, .-swap16
	.align	2
	.global	update_flags
	.syntax unified
	.arm
	.fpu softvfp
	.type	update_flags, %function
update_flags:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	strh	r3, [fp, #-6]	@ movhi
	ldrh	r3, [fp, #-6]
	ldr	r2, .L13
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	cmp	r3, #0
	bne	.L9
	ldr	r3, .L13
	mov	r2, #2
	strh	r2, [r3, #18]	@ movhi
	b	.L12
.L9:
	ldrh	r3, [fp, #-6]
	ldr	r2, .L13
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	lsl	r3, r3, #16
	asr	r3, r3, #16
	cmp	r3, #0
	bge	.L11
	ldr	r3, .L13
	mov	r2, #4
	strh	r2, [r3, #18]	@ movhi
	b	.L12
.L11:
	ldr	r3, .L13
	mov	r2, #1
	strh	r2, [r3, #18]	@ movhi
.L12:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L14:
	.align	2
.L13:
	.word	reg
	.size	update_flags, .-update_flags
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read_image_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_image_file, %function
read_image_file:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #20
	ldr	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #2
	bl	fread
	ldrh	r3, [fp, #-20]
	mov	r0, r3
	bl	swap16
	mov	r3, r0
	strh	r3, [fp, #-20]	@ movhi
	ldrh	r3, [fp, #-20]
	mvn	r3, r3
	strh	r3, [fp, #-18]	@ movhi
	ldrh	r3, [fp, #-20]
	lsl	r3, r3, #1
	ldr	r2, .L19+4
	add	r3, r3, r2
	str	r3, [fp, #-16]
	ldrh	r2, [fp, #-18]
	ldr	r3, [fp, #-24]
	mov	r1, #2
	ldr	r0, [fp, #-16]
	bl	fread
	str	r0, [fp, #-12]
	b	.L16
.L17:
	ldr	r3, [fp, #-16]
	ldrh	r3, [r3]
	mov	r0, r3
	bl	swap16
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-16]
	add	r3, r3, #2
	str	r3, [fp, #-16]
.L16:
	ldr	r3, [fp, #-12]
	sub	r2, r3, #1
	str	r2, [fp, #-12]
	cmp	r3, #0
	bne	.L17
	nop
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	memory
	.size	read_image_file, .-read_image_file
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rb\000"
	.text
	.align	2
	.global	read_image
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_image, %function
read_image:
	@ 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, .L24
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L22
	mov	r3, #0
	b	.L23
.L22:
	ldr	r0, [fp, #-8]
	bl	read_image_file
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r3, #1
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC1
	.size	read_image, .-read_image
	.section	.rodata
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	check_key
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_key, %function
check_key:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #160
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #136
	str	r3, [fp, #-148]
	mov	r3, #0
	str	r3, [fp, #-152]
	b	.L27
.L28:
	ldr	r3, [fp, #-148]
	ldr	r2, [fp, #-152]
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-152]
	add	r3, r3, #1
	str	r3, [fp, #-152]
.L27:
	ldr	r3, [fp, #-152]
	cmp	r3, #31
	bls	.L28
	ldr	r3, [fp, #-136]
	orr	r3, r3, #1
	str	r3, [fp, #-136]
	mov	r3, #0
	str	r3, [fp, #-144]
	mov	r3, #0
	str	r3, [fp, #-140]
	sub	r1, fp, #136
	sub	r3, fp, #144
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r0, #1
	bl	select
	mov	r3, r0
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L31
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L30
	bl	__stack_chk_fail
.L30:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC2
	.size	check_key, .-check_key
	.align	2
	.global	mem_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	mem_write, %function
mem_write:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, r0
	mov	r2, r1
	strh	r3, [fp, #-6]	@ movhi
	mov	r3, r2	@ movhi
	strh	r3, [fp, #-8]	@ movhi
	ldrh	r3, [fp, #-6]
	ldr	r2, .L34
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [fp, #-8]	@ movhi
	strh	r2, [r3]	@ movhi
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L35:
	.align	2
.L34:
	.word	memory
	.size	mem_write, .-mem_write
	.align	2
	.global	mem_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	mem_read, %function
mem_read:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, r0
	strh	r3, [fp, #-6]	@ movhi
	ldrh	r3, [fp, #-6]
	cmp	r3, #65024
	bne	.L37
	bl	check_key
	mov	r3, r0
	cmp	r3, #0
	beq	.L38
	ldr	r3, .L40
	add	r3, r3, #126976
	add	r3, r3, #3072
	mov	r2, #32768
	strh	r2, [r3]	@ movhi
	bl	getchar
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, .L40
	add	r3, r3, #126976
	add	r3, r3, #3072
	add	r3, r3, #4
	strh	r2, [r3]	@ movhi
	b	.L37
.L38:
	ldr	r3, .L40
	add	r3, r3, #126976
	add	r3, r3, #3072
	mov	r2, #0
	strh	r2, [r3]	@ movhi
.L37:
	ldrh	r3, [fp, #-6]
	ldr	r2, .L40
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L41:
	.align	2
.L40:
	.word	memory
	.size	mem_read, .-mem_read
	.comm	original_tio,60,4
	.section	.rodata
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	disable_input_buffering
	.syntax unified
	.arm
	.fpu softvfp
	.type	disable_input_buffering, %function
disable_input_buffering:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	ldr	r3, .L44
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L44+4
	mov	r0, #0
	bl	tcgetattr
	ldr	r3, .L44+4
	sub	ip, fp, #68
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-56]
	bic	r3, r3, #10
	str	r3, [fp, #-56]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	ldr	r3, .L44
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L43
	bl	__stack_chk_fail
.L43:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L45:
	.align	2
.L44:
	.word	.LC3
	.word	original_tio
	.size	disable_input_buffering, .-disable_input_buffering
	.align	2
	.global	restore_input_buffering
	.syntax unified
	.arm
	.fpu softvfp
	.type	restore_input_buffering, %function
restore_input_buffering:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r2, .L47
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	nop
	pop	{fp, pc}
.L48:
	.align	2
.L47:
	.word	original_tio
	.size	restore_input_buffering, .-restore_input_buffering
	.align	2
	.global	handle_interrupt
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_interrupt, %function
handle_interrupt:
	@ 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]
	bl	restore_input_buffering
	mov	r0, #10
	bl	putchar
	mvn	r0, #1
	bl	exit
	.size	handle_interrupt, .-handle_interrupt
	.section	.rodata
	.align	2
.LC4:
	.ascii	"lc3 [image-file1] ...\000"
	.align	2
.LC5:
	.ascii	"failed to load image: %s\012\000"
	.align	2
.LC6:
	.ascii	"Enter a character: \000"
	.align	2
.LC7:
	.ascii	"HALT\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #108
	str	r0, [fp, #-112]
	str	r1, [fp, #-116]
	ldr	r3, [fp, #-112]
	cmp	r3, #1
	bgt	.L51
	ldr	r0, .L94
	bl	puts
	mov	r0, #2
	bl	exit
.L51:
	mov	r3, #1
	str	r3, [fp, #-28]
	b	.L52
.L54:
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-116]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	read_image
	mov	r3, r0
	cmp	r3, #0
	bne	.L53
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-116]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L94+4
	bl	printf
	mov	r0, #1
	bl	exit
.L53:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L52:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-112]
	cmp	r2, r3
	blt	.L54
	ldr	r1, .L94+8
	mov	r0, #2
	bl	signal
	bl	disable_input_buffering
	ldr	r3, .L94+12
	mov	r2, #12288
	strh	r2, [r3, #16]	@ movhi
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L55
.L92:
	ldr	r3, .L94+12
	ldrh	r3, [r3, #16]
	add	r2, r3, #1
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	strh	r2, [r1, #16]	@ movhi
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	strh	r3, [fp, #-100]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #12
	strh	r3, [fp, #-98]	@ movhi
	ldrh	r3, [fp, #-98]
	cmp	r3, #15
	ldrls	pc, [pc, r3, asl #2]
	b	.L56
.L58:
	.word	.L71
	.word	.L70
	.word	.L69
	.word	.L68
	.word	.L67
	.word	.L66
	.word	.L65
	.word	.L64
	.word	.L56
	.word	.L63
	.word	.L62
	.word	.L61
	.word	.L60
	.word	.L56
	.word	.L59
	.word	.L57
.L70:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-42]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-40]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #5
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	strh	r3, [fp, #-38]	@ movhi
	ldrh	r3, [fp, #-38]
	cmp	r3, #0
	beq	.L72
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #31
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #5
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-34]	@ movhi
	ldrh	r3, [fp, #-40]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r1, [r3]
	ldrh	r3, [fp, #-42]
	ldrh	r2, [fp, #-34]	@ movhi
	add	r2, r1, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	b	.L73
.L72:
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #7
	strh	r3, [fp, #-36]	@ movhi
	ldrh	r3, [fp, #-40]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r1, [r3]
	ldrh	r3, [fp, #-36]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [r3]
	ldrh	r3, [fp, #-42]
	add	r2, r1, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
.L73:
	ldrh	r3, [fp, #-42]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L66:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-66]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-64]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #5
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	strh	r3, [fp, #-62]	@ movhi
	ldrh	r3, [fp, #-62]
	cmp	r3, #0
	beq	.L74
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #31
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #5
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-58]	@ movhi
	ldrh	r3, [fp, #-64]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r1, [r3]
	ldrh	r3, [fp, #-66]
	ldrh	r2, [fp, #-58]	@ movhi
	and	r2, r2, r1
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	b	.L75
.L74:
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #7
	strh	r3, [fp, #-60]	@ movhi
	ldrh	r3, [fp, #-64]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r1, [r3]
	ldrh	r3, [fp, #-60]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [r3]
	ldrh	r3, [fp, #-66]
	and	r2, r2, r1
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
.L75:
	ldrh	r3, [fp, #-66]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L63:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-82]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-80]	@ movhi
	ldrh	r3, [fp, #-80]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [r3]
	ldrh	r3, [fp, #-82]
	mvn	r2, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldrh	r3, [fp, #-82]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L71:
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-32]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-30]	@ movhi
	ldr	r3, .L94+12
	ldrh	r2, [r3, #18]
	ldrh	r3, [fp, #-30]	@ movhi
	and	r3, r3, r2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	cmp	r3, #0
	beq	.L55
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-32]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L94+12
	strh	r3, [r2, #16]	@ movhi
	b	.L55
.L60:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-92]	@ movhi
	ldrh	r3, [fp, #-92]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	ldr	r2, .L94+12
	strh	r3, [r2, #16]	@ movhi
	b	.L55
.L67:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-56]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #21
	lsr	r3, r3, #21
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #11
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-54]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #11
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #1
	strh	r3, [fp, #-52]	@ movhi
	ldr	r3, .L94+12
	ldrh	r3, [r3, #16]
	ldr	r2, .L94+12
	strh	r3, [r2, #14]	@ movhi
	ldrh	r3, [fp, #-52]
	cmp	r3, #0
	beq	.L77
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-54]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L94+12
	strh	r3, [r2, #16]	@ movhi
	b	.L55
.L77:
	ldrh	r3, [fp, #-56]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	ldr	r2, .L94+12
	strh	r3, [r2, #16]	@ movhi
	b	.L55
.L69:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-46]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-44]	@ movhi
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-44]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldrh	r4, [fp, #-46]
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	mov	r1, r3
	ldr	r2, .L94+12
	lsl	r3, r4, #1
	add	r3, r2, r3
	strh	r1, [r3]	@ movhi
	ldrh	r3, [fp, #-46]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L62:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-86]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-84]	@ movhi
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-84]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	ldrh	r4, [fp, #-86]
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	mov	r1, r3
	ldr	r2, .L94+12
	lsl	r3, r4, #1
	add	r3, r2, r3
	strh	r1, [r3]	@ movhi
	ldrh	r3, [fp, #-86]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L65:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-72]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-70]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #63
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #6
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-68]	@ movhi
	ldrh	r3, [fp, #-70]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [r3]
	ldrh	r3, [fp, #-68]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldrh	r4, [fp, #-72]
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	mov	r1, r3
	ldr	r2, .L94+12
	lsl	r3, r4, #1
	add	r3, r2, r3
	strh	r1, [r3]	@ movhi
	ldrh	r3, [fp, #-72]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L59:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-96]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-94]	@ movhi
	ldr	r3, .L94+12
	ldrh	r1, [r3, #16]
	ldrh	r3, [fp, #-96]
	ldrh	r2, [fp, #-94]	@ movhi
	add	r2, r1, r2
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	strh	r2, [r3]	@ movhi
	ldrh	r3, [fp, #-96]
	mov	r0, r3
	bl	update_flags
	b	.L55
.L68:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-50]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-48]	@ movhi
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-48]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-50]
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	ldrh	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	mem_write
	b	.L55
.L61:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-90]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	lsl	r3, r3, #23
	lsr	r3, r3, #23
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #9
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-88]	@ movhi
	ldr	r3, .L94+12
	ldrh	r2, [r3, #16]
	ldrh	r3, [fp, #-88]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	mem_read
	mov	r3, r0
	mov	r0, r3
	ldrh	r3, [fp, #-90]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	mov	r1, r3
	bl	mem_write
	b	.L55
.L64:
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #9
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-78]	@ movhi
	ldrh	r3, [fp, #-100]
	lsr	r3, r3, #6
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	and	r3, r3, #7
	strh	r3, [fp, #-76]	@ movhi
	ldrh	r3, [fp, #-100]	@ movhi
	and	r3, r3, #63
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r1, #6
	mov	r0, r3
	bl	sign_extend
	mov	r3, r0
	strh	r3, [fp, #-74]	@ movhi
	ldrh	r3, [fp, #-76]
	ldr	r2, .L94+12
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r2, [r3]
	ldrh	r3, [fp, #-74]	@ movhi
	add	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-78]
	ldr	r1, .L94+12
	lsl	r3, r3, #1
	add	r3, r1, r3
	ldrh	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	mem_write
	b	.L55
.L57:
	ldrh	r3, [fp, #-100]
	and	r3, r3, #255
	sub	r3, r3, #32
	cmp	r3, #5
	ldrls	pc, [pc, r3, asl #2]
	b	.L55
.L81:
	.word	.L86
	.word	.L85
	.word	.L84
	.word	.L83
	.word	.L82
	.word	.L80
.L86:
	bl	getchar
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L94+12
	strh	r3, [r2]	@ movhi
	b	.L79
.L85:
	ldr	r3, .L94+12
	ldrh	r3, [r3]
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	putc
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L79
.L84:
	ldr	r3, .L94+12
	ldrh	r3, [r3]
	lsl	r3, r3, #1
	ldr	r2, .L94+20
	add	r3, r3, r2
	str	r3, [fp, #-20]
	b	.L87
.L88:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3]
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	putc
	ldr	r3, [fp, #-20]
	add	r3, r3, #2
	str	r3, [fp, #-20]
.L87:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3]
	cmp	r3, #0
	bne	.L88
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L79
.L83:
	ldr	r0, .L94+24
	bl	printf
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-101]
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	ldr	r2, .L94+16
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	putc
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	ldr	r2, .L94+12
	strh	r3, [r2]	@ movhi
	b	.L79
.L82:
	ldr	r3, .L94+12
	ldrh	r3, [r3]
	lsl	r3, r3, #1
	ldr	r2, .L94+20
	add	r3, r3, r2
	str	r3, [fp, #-16]
	b	.L89
.L91:
	ldr	r3, [fp, #-16]
	ldrh	r3, [r3]
	strb	r3, [fp, #-103]
	ldrb	r3, [fp, #-103]	@ zero_extendqisi2
	ldr	r2, .L94+16
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	putc
	ldr	r3, [fp, #-16]
	ldrh	r3, [r3]
	lsr	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strb	r3, [fp, #-102]
	ldrb	r3, [fp, #-102]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L90
	ldrb	r3, [fp, #-102]	@ zero_extendqisi2
	ldr	r2, .L94+16
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	putc
.L90:
	ldr	r3, [fp, #-16]
	add	r3, r3, #2
	str	r3, [fp, #-16]
.L89:
	ldr	r3, [fp, #-16]
	ldrh	r3, [r3]
	cmp	r3, #0
	bne	.L91
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	b	.L79
.L80:
	ldr	r0, .L94+28
	bl	puts
	ldr	r3, .L94+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r3, #0
	str	r3, [fp, #-24]
	nop
.L79:
	b	.L55
.L56:
	bl	abort
.L55:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L92
	bl	restore_input_buffering
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L95:
	.align	2
.L94:
	.word	.LC4
	.word	.LC5
	.word	handle_interrupt
	.word	reg
	.word	stdout
	.word	memory
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
