	.file	"446063.c"
	.intel_syntax noprefix
	.text
	.globl	my_open
	.type	my_open, @function
my_open:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 114
	je	.L2
	cmp	eax, 119
	je	.L3
	jmp	.L9
.L2:
	mov	DWORD PTR -20[rbp], 0
	mov	DWORD PTR -16[rbp], 1
	jmp	.L5
.L3:
	mov	DWORD PTR -20[rbp], 577
	mov	DWORD PTR -16[rbp], 2
	jmp	.L5
.L9:
	mov	eax, 0
	jmp	.L6
.L5:
	mov	ecx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 438
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L7
	mov	eax, 0
	jmp	.L6
.L7:
	mov	edi, 1048
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L8
	mov	eax, 0
	jmp	.L6
.L8:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -16[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -12[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 12[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 1040[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	my_open, .-my_open
	.globl	my_getc
	.type	my_getc, @function
my_getc:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	eax, 1
	jne	.L11
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	lea	rcx, -13[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L12
	mov	edi, 1
	call	exit@PLT
.L12:
	cmp	DWORD PTR -12[rbp], 0
	jne	.L13
	mov	eax, -1
	jmp	.L15
.L11:
	mov	eax, 0
	jmp	.L15
.L13:
	movzx	eax, BYTE PTR -13[rbp]
	movsx	eax, al
.L15:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	my_getc, .-my_getc
	.globl	my_putc
	.type	my_putc, @function
my_putc:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	eax, 2
	jne	.L18
	mov	rax, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR [rax]
	lea	rcx, -20[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L19
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	eax, DWORD PTR -20[rbp]
	jmp	.L17
.L18:
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	my_putc, .-my_putc
	.globl	my_getc_buf
	.type	my_getc_buf, @function
my_getc_buf:
.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	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	and	eax, 1
	test	eax, eax
	jne	.L22
	mov	eax, -1
	jmp	.L23
.L22:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	test	eax, eax
	jg	.L24
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, 12[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rdx], eax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 12[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 1040[rax], rdx
.L24:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	test	eax, eax
	jle	.L25
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 1040[rax]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 1040[rdx], rcx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	jmp	.L23
.L25:
	mov	eax, -1
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	my_getc_buf, .-my_getc_buf
	.globl	my_putc_buf
	.type	my_putc_buf, @function
my_putc_buf:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	and	eax, 2
	test	eax, eax
	jne	.L28
	mov	eax, -1
	jmp	.L29
.L28:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	cmp	eax, 1023
	jle	.L30
	mov	rax, QWORD PTR -16[rbp]
	lea	rcx, 12[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edx, 1024
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	cmp	eax, 1024
	je	.L31
	mov	eax, -1
	jmp	.L29
.L31:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 12[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 1040[rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 8[rax], 0
.L30:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 1040[rax]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 1040[rdx], rcx
	mov	edx, DWORD PTR -4[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 8[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	eax, DWORD PTR -4[rbp]
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	my_putc_buf, .-my_putc_buf
	.globl	my_close
	.type	my_close, @function
my_close:
.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	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	and	eax, 2
	test	eax, eax
	je	.L33
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 8[rax]
	test	eax, eax
	jle	.L33
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, 12[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	rdx, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 8[rdx]
	cmp	eax, edx
	je	.L33
	mov	eax, -1
	jmp	.L34
.L33:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	my_close, .-my_close
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"w"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	my_open
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L36
	mov	edi, 1
	call	exit@PLT
.L36:
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	my_open
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L38
	mov	edi, 2
	call	exit@PLT
.L39:
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	my_putc
.L38:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	my_getc
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], -1
	jne	.L39
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	my_close
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	my_close
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	"446063.c"
	.text
	.align	2
	.global	my_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_open, %function
my_open:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-28]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #114
	beq	.L2
	cmp	r3, #119
	beq	.L3
	b	.L9
.L2:
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L5
.L3:
	ldr	r3, .L10
	str	r3, [fp, #-20]
	mov	r3, #2
	str	r3, [fp, #-16]
	b	.L5
.L9:
	mov	r3, #0
	b	.L6
.L5:
	ldr	r2, .L10+4
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L7
	mov	r3, #0
	b	.L6
.L7:
	mov	r0, #1040
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L8
	mov	r3, #0
	b	.L6
.L8:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	add	r2, r3, #12
	ldr	r3, [fp, #-8]
	str	r2, [r3, #1036]
	ldr	r3, [fp, #-8]
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	577
	.word	438
	.size	my_open, .-my_open
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	my_getc
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_getc, %function
my_getc:
	@ 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
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	cmp	r3, #1
	bne	.L13
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	sub	r1, fp, #13
	mov	r2, #1
	mov	r0, r3
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L14
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L15
	mvn	r3, #0
	b	.L17
.L13:
	mov	r3, #0
	b	.L17
.L15:
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
.L17:
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC0
	.size	my_getc, .-my_getc
	.align	2
	.global	my_putc
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_putc, %function
my_putc:
	@ 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	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	cmp	r3, #2
	bne	.L22
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	sub	r1, fp, #16
	mov	r2, #1
	mov	r0, r3
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L23
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, [fp, #-16]
	b	.L21
.L22:
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	my_putc, .-my_putc
	.align	2
	.global	my_getc_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_getc_buf, %function
my_getc_buf:
	@ 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]
	ldr	r3, [r3, #4]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L26
	mvn	r3, #0
	b	.L27
.L26:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bgt	.L28
	ldr	r3, [fp, #-8]
	ldr	r0, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #12
	mov	r2, #1024
	mov	r1, r3
	bl	read
	mov	r2, r0
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	add	r2, r3, #12
	ldr	r3, [fp, #-8]
	str	r2, [r3, #1036]
.L28:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	ble	.L29
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	sub	r2, r3, #1
	ldr	r3, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #1036]
	add	r1, r3, #1
	ldr	r2, [fp, #-8]
	str	r1, [r2, #1036]
	ldrb	r3, [r3]	@ zero_extendqisi2
	b	.L27
.L29:
	mvn	r3, #0
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	my_getc_buf, .-my_getc_buf
	.align	2
	.global	my_putc_buf
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_putc_buf, %function
my_putc_buf:
	@ 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, #-12]
	ldr	r3, [r3, #4]
	and	r3, r3, #2
	cmp	r3, #0
	bne	.L32
	mvn	r3, #0
	b	.L33
.L32:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #1024
	blt	.L34
	ldr	r3, [fp, #-12]
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #12
	mov	r2, #1024
	mov	r1, r3
	bl	write
	mov	r3, r0
	cmp	r3, #1024
	beq	.L35
	mvn	r3, #0
	b	.L33
.L35:
	ldr	r3, [fp, #-12]
	add	r2, r3, #12
	ldr	r3, [fp, #-12]
	str	r2, [r3, #1036]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #8]
.L34:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #1036]
	add	r1, r3, #1
	ldr	r2, [fp, #-12]
	str	r1, [r2, #1036]
	ldr	r2, [fp, #-8]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	add	r2, r3, #1
	ldr	r3, [fp, #-12]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
.L33:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	my_putc_buf, .-my_putc_buf
	.align	2
	.global	my_close
	.syntax unified
	.arm
	.fpu softvfp
	.type	my_close, %function
my_close:
	@ 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]
	ldr	r3, [r3, #4]
	and	r3, r3, #2
	cmp	r3, #0
	beq	.L37
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	ble	.L37
	ldr	r3, [fp, #-8]
	ldr	r0, [r3]
	ldr	r3, [fp, #-8]
	add	r1, r3, #12
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	mov	r2, r3
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r2, r3
	beq	.L37
	mvn	r3, #0
	b	.L38
.L37:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r0, [fp, #-8]
	bl	free
	mov	r3, #0
.L38:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	my_close, .-my_close
	.section	.rodata
	.align	2
.LC1:
	.ascii	"r\000"
	.align	2
.LC2:
	.ascii	"w\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L45
	mov	r0, r3
	bl	my_open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L40
	mov	r0, #1
	bl	exit
.L40:
	ldr	r3, [fp, #-28]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L45+4
	mov	r0, r3
	bl	my_open
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L42
	mov	r0, #2
	bl	exit
.L43:
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	my_putc
.L42:
	ldr	r0, [fp, #-16]
	bl	my_getc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L43
	ldr	r0, [fp, #-16]
	bl	my_close
	ldr	r0, [fp, #-12]
	bl	my_close
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L46:
	.align	2
.L45:
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
