	.file	"19534.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"%s: invalid option -%c\n"
.LC1:
	.string	"an"
.LC2:
	.string	"a"
.LC3:
	.string	"w"
.LC4:
	.string	"%s: %s: %s\n"
.LC5:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	DWORD PTR -24[rbp], 1
	mov	DWORD PTR -20[rbp], 0
	jmp	.L2
.L6:
	cmp	DWORD PTR -12[rbp], 110
	je	.L3
	cmp	DWORD PTR -12[rbp], 110
	jg	.L2
	cmp	DWORD PTR -12[rbp], 63
	je	.L4
	cmp	DWORD PTR -12[rbp], 97
	jne	.L2
	mov	DWORD PTR -20[rbp], 1
	jmp	.L2
.L3:
	mov	DWORD PTR -24[rbp], 0
	jmp	.L2
.L4:
	mov	ecx, DWORD PTR optopt[rip]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	printUsage
	mov	eax, 2
	jmp	.L5
.L2:
	mov	rcx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	lea	rdx, .LC1[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L6
	mov	edx, DWORD PTR optind[rip]
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, edx
	test	eax, eax
	jg	.L7
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	printUsage
	mov	eax, 2
	jmp	.L5
.L7:
	cmp	DWORD PTR -20[rbp], 0
	je	.L8
	lea	rax, .LC2[rip]
	jmp	.L9
.L8:
	lea	rax, .LC3[rip]
.L9:
	mov	edx, DWORD PTR optind[rip]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -48[rbp]
	add	rdx, rcx
	mov	rdx, QWORD PTR [rdx]
	mov	rsi, rax
	mov	rdi, rdx
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L10
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	r8, rsi
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L5
.L10:
	mov	eax, DWORD PTR optind[rip]
	add	eax, 1
	mov	DWORD PTR -16[rbp], eax
	jmp	.L11
.L15:
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	test	eax, eax
	js	.L19
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, 1
	cmp	DWORD PTR -16[rbp], eax
	jge	.L14
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	mov	edi, 32
	call	fputc@PLT
	cmp	eax, -1
	je	.L20
.L14:
	add	DWORD PTR -16[rbp], 1
.L11:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L15
	cmp	DWORD PTR -24[rbp], 0
	je	.L21
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
	cmp	eax, -1
	jne	.L21
	jmp	.L13
.L19:
	nop
	jmp	.L13
.L20:
	nop
.L13:
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
	jmp	.L17
.L21:
	nop
.L17:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	eax, -1
	jne	.L18
	mov	eax, DWORD PTR optind[rip]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	perror@PLT
.L18:
	mov	eax, 0
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC6:
	.string	"Usage: %s [-an] filename [string]...\n"
	.align 8
.LC7:
	.string	"Opens a file and writes a string.\n"
	.align 8
.LC8:
	.string	"\t-a\tOpen file in append mode (do not truncate)\n"
.LC9:
	.string	"\t-n\tDo not add newline\n"
	.text
	.globl	printUsage
	.type	printUsage, @function
printUsage:
.LFB1:
	.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, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 34
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 47
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	printUsage, .-printUsage
	.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	"19534.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s: invalid option -%c\012\000"
	.align	2
.LC1:
	.ascii	"an\000"
	.align	2
.LC2:
	.ascii	"a\000"
	.align	2
.LC3:
	.ascii	"w\000"
	.align	2
.LC4:
	.ascii	"%s: %s: %s\012\000"
	.align	2
.LC5:
	.ascii	"%s\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #44
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	mov	r3, #1
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L2
.L6:
	ldr	r3, [fp, #-28]
	cmp	r3, #110
	beq	.L3
	ldr	r3, [fp, #-28]
	cmp	r3, #110
	bgt	.L2
	ldr	r3, [fp, #-28]
	cmp	r3, #63
	beq	.L4
	ldr	r3, [fp, #-28]
	cmp	r3, #97
	bne	.L2
	mov	r3, #1
	str	r3, [fp, #-36]
	b	.L2
.L3:
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L2
.L4:
	ldr	r3, .L22
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r2, [r3]
	ldr	r3, .L22+4
	ldr	r3, [r3]
	ldr	r1, .L22+8
	bl	fprintf
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r0, r3
	bl	printUsage
	mov	r3, #2
	b	.L5
.L2:
	ldr	r2, .L22+12
	ldr	r1, [fp, #-52]
	ldr	r0, [fp, #-48]
	bl	getopt
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L22+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-48]
	sub	r3, r2, r3
	cmp	r3, #0
	bgt	.L7
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r0, r3
	bl	printUsage
	mov	r3, #2
	b	.L5
.L7:
	ldr	r3, .L22+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L8
	ldr	r3, .L22+20
	b	.L9
.L8:
	ldr	r3, .L22+24
.L9:
	mov	r1, r3
	mov	r0, r2
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L10
	ldr	r3, .L22
	ldr	r4, [r3]
	ldr	r3, [fp, #-52]
	ldr	r5, [r3]
	ldr	r3, .L22+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r6, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	str	r3, [sp]
	mov	r3, r6
	mov	r2, r5
	ldr	r1, .L22+28
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L5
.L10:
	ldr	r3, .L22+16
	ldr	r3, [r3]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L11
.L15:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L22+32
	ldr	r0, [fp, #-24]
	bl	fprintf
	mov	r3, r0
	cmp	r3, #0
	blt	.L19
	ldr	r3, [fp, #-48]
	sub	r3, r3, #1
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bge	.L14
	ldr	r1, [fp, #-24]
	mov	r0, #32
	bl	fputc
	mov	r3, r0
	cmn	r3, #1
	beq	.L20
.L14:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L11:
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L15
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	beq	.L21
	ldr	r1, [fp, #-24]
	mov	r0, #10
	bl	fputc
	mov	r3, r0
	cmn	r3, #1
	bne	.L21
	b	.L13
.L19:
	nop
	b	.L13
.L20:
	nop
.L13:
	ldr	r3, .L22+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
	b	.L17
.L21:
	nop
.L17:
	ldr	r0, [fp, #-24]
	bl	fclose
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	ldr	r3, .L22+16
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	perror
.L18:
	mov	r3, #0
.L5:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L23:
	.align	2
.L22:
	.word	stderr
	.word	optopt
	.word	.LC0
	.word	.LC1
	.word	optind
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Usage: %s [-an] filename [string]...\012\000"
	.align	2
.LC7:
	.ascii	"Opens a file and writes a string.\012\000"
	.align	2
.LC8:
	.ascii	"\011-a\011Open file in append mode (do not truncate"
	.ascii	")\012\000"
	.align	2
.LC9:
	.ascii	"\011-n\011Do not add newline\012\000"
	.text
	.align	2
	.global	printUsage
	.syntax unified
	.arm
	.fpu softvfp
	.type	printUsage, %function
printUsage:
	@ 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, .L25
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	ldr	r1, .L25+4
	mov	r0, r3
	bl	fprintf
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #34
	mov	r1, #1
	ldr	r0, .L25+8
	bl	fwrite
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #47
	mov	r1, #1
	ldr	r0, .L25+12
	bl	fwrite
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L25+16
	bl	fwrite
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	stderr
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	printUsage, .-printUsage
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
