	.file	"841739.c"
	.intel_syntax noprefix
	.text
	.globl	count_characters
	.type	count_characters, @function
count_characters:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 2
	mov	rsi, -1
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -8[rbp], rax
	add	QWORD PTR -8[rbp], 1
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	count_characters, .-count_characters
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"w"
	.text
	.globl	main
	.type	main, @function
main:
.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, 320
	mov	DWORD PTR -308[rbp], edi
	mov	QWORD PTR -320[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -296[rbp], 0
	mov	rax, QWORD PTR -320[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -280[rbp], rax
	cmp	QWORD PTR -280[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	count_characters
	mov	DWORD PTR -284[rbp], eax
	mov	rax, QWORD PTR -280[rbp]
	mov	edx, 2
	mov	rsi, -1
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -284[rbp]
	mov	DWORD PTR -292[rbp], eax
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	ecx, eax
	mov	eax, DWORD PTR -296[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -296[rbp], edx
	mov	edx, ecx
	cdqe
	mov	BYTE PTR -272[rbp+rax], dl
	mov	rax, QWORD PTR -280[rbp]
	mov	edx, 1
	mov	rsi, -2
	mov	rdi, rax
	call	fseek@PLT
	sub	DWORD PTR -292[rbp], 1
.L5:
	cmp	DWORD PTR -292[rbp], 0
	jne	.L6
	jmp	.L13
.L4:
	mov	eax, 0
	jmp	.L11
.L13:
	mov	rax, QWORD PTR -320[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -280[rbp], rax
	mov	DWORD PTR -288[rbp], 0
	jmp	.L9
.L10:
	mov	eax, DWORD PTR -288[rbp]
	cdqe
	movzx	eax, BYTE PTR -272[rbp+rax]
	movsx	eax, al
	mov	rdx, QWORD PTR -280[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	add	DWORD PTR -288[rbp], 1
.L9:
	mov	eax, DWORD PTR -288[rbp]
	cmp	eax, DWORD PTR -284[rbp]
	jl	.L10
	mov	rax, QWORD PTR -280[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L11:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"841739.c"
	.text
	.align	2
	.global	count_characters
	.syntax unified
	.arm
	.fpu softvfp
	.type	count_characters, %function
count_characters:
	@ 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	r2, #2
	mvn	r1, #0
	ldr	r0, [fp, #-16]
	bl	fseek
	ldr	r0, [fp, #-16]
	bl	ftell
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	count_characters, .-count_characters
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"w\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 288
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #288
	str	r0, [fp, #-288]
	str	r1, [fp, #-292]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-284]
	ldr	r3, [fp, #-292]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L14+4
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-272]
	ldr	r3, [fp, #-272]
	cmp	r3, #0
	beq	.L4
	ldr	r0, [fp, #-272]
	bl	count_characters
	str	r0, [fp, #-268]
	mov	r2, #2
	mvn	r1, #0
	ldr	r0, [fp, #-272]
	bl	fseek
	ldr	r3, [fp, #-268]
	str	r3, [fp, #-280]
	b	.L5
.L6:
	ldr	r0, [fp, #-272]
	bl	fgetc
	mov	r1, r0
	ldr	r3, [fp, #-284]
	add	r2, r3, #1
	str	r2, [fp, #-284]
	and	r2, r1, #255
	sub	r1, fp, #4
	add	r3, r1, r3
	strb	r2, [r3, #-260]
	mov	r2, #1
	mvn	r1, #1
	ldr	r0, [fp, #-272]
	bl	fseek
	ldr	r3, [fp, #-280]
	sub	r3, r3, #1
	str	r3, [fp, #-280]
.L5:
	ldr	r3, [fp, #-280]
	cmp	r3, #0
	bne	.L6
	b	.L13
.L4:
	mov	r3, #0
	b	.L11
.L13:
	ldr	r3, [fp, #-292]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L14+8
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-272]
	mov	r3, #0
	str	r3, [fp, #-276]
	b	.L9
.L10:
	sub	r2, fp, #264
	ldr	r3, [fp, #-276]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r1, [fp, #-272]
	mov	r0, r3
	bl	putc
	ldr	r3, [fp, #-276]
	add	r3, r3, #1
	str	r3, [fp, #-276]
.L9:
	ldr	r2, [fp, #-276]
	ldr	r3, [fp, #-268]
	cmp	r2, r3
	blt	.L10
	ldr	r0, [fp, #-272]
	bl	fclose
	mov	r3, #0
.L11:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
