	.file	"54824596.c"
	.intel_syntax noprefix
	.text
	.local	verbose
	.comm	verbose,4,4
	.local	verify
	.comm	verify,4,4
	.local	size
	.comm	size,4,4
	.section	.rodata
.LC0:
	.string	"Sorry, unimplemented for now"
	.align 8
.LC1:
	.string	"USAGE: checkum -[vhcs] infile outfile\n\t-v\tverbose\n\t-h\thelp\n\t-c\tcheck checksum\n\t-s\tprint the ipl size"
.LC2:
	.string	"\"%s\", Illegal option\n"
	.align 8
.LC3:
	.string	"Didn't specify an input file name"
	.align 8
.LC4:
	.string	"Didn't specify an output file name"
.LC5:
	.string	"Couldn't open %s\n"
.LC6:
	.string	"Couldn't write"
	.align 8
.LC7:
	.string	"The calculated checksum is:\n\t0x%x,\n\t%u\n"
.LC8:
	.string	"%u is the new file size\n"
	.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -44[rbp], 1
	mov	DWORD PTR -40[rbp], 0
	jmp	.L2
.L9:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 118
	je	.L3
	cmp	eax, 118
	jg	.L4
	cmp	eax, 115
	je	.L5
	cmp	eax, 115
	jg	.L4
	cmp	eax, 99
	je	.L6
	cmp	eax, 104
	je	.L7
	jmp	.L4
.L3:
	mov	eax, DWORD PTR verbose[rip]
	add	eax, 1
	mov	DWORD PTR verbose[rip], eax
	jmp	.L8
.L6:
	mov	eax, DWORD PTR verify[rip]
	add	eax, 1
	mov	DWORD PTR verify[rip], eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR size[rip]
	add	eax, 1
	mov	DWORD PTR size[rip], eax
	jmp	.L8
.L7:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L4:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	add	DWORD PTR -44[rbp], 1
.L2:
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L9
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR -44[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L10
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L11
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], -1
	jne	.L12
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L12:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -32[rbp], eax
	cmp	DWORD PTR -32[rbp], -1
	jne	.L13
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR verbose[rip]
	cmp	eax, 2
	jle	.L15
	mov	edi, 10
	call	putchar@PLT
	jmp	.L15
.L18:
	mov	eax, DWORD PTR verbose[rip]
	cmp	eax, 2
	jle	.L16
	mov	edi, 46
	call	putchar@PLT
.L16:
	mov	eax, DWORD PTR -52[rbp]
	add	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 4
	mov	DWORD PTR -40[rbp], eax
	lea	rcx, -52[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	cmp	eax, 4
	je	.L17
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L17:
	mov	eax, DWORD PTR verbose[rip]
	cmp	eax, 3
	jle	.L15
	mov	edi, 43
	call	putchar@PLT
.L15:
	lea	rcx, -52[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 4
	je	.L18
	mov	eax, DWORD PTR verbose[rip]
	cmp	eax, 2
	jle	.L19
	mov	edi, 10
	call	putchar@PLT
.L19:
	cmp	DWORD PTR -28[rbp], 0
	jle	.L20
	mov	edx, DWORD PTR -28[rbp]
	lea	rcx, -52[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	eax, DWORD PTR -52[rbp]
	add	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	add	DWORD PTR -40[rbp], eax
.L20:
	mov	eax, DWORD PTR -48[rbp]
	neg	eax
	mov	DWORD PTR -52[rbp], eax
	lea	rcx, -52[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 4
	mov	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR verbose[rip]
	test	eax, eax
	jle	.L21
	mov	eax, DWORD PTR -48[rbp]
	neg	eax
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	neg	eax
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L21:
	mov	DWORD PTR -52[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 4
	mov	DWORD PTR -40[rbp], eax
	lea	rcx, -52[rbp]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
.L22:
	mov	eax, DWORD PTR -40[rbp]
	and	eax, 2047
	test	eax, eax
	jne	.L23
	mov	eax, DWORD PTR size[rip]
	test	eax, eax
	jle	.L24
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
.L24:
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, DWORD PTR -36[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.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	"54824596.c"
	.text
	.local	verbose
	.comm	verbose,4,4
	.local	verify
	.comm	verify,4,4
	.local	size
	.comm	size,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Sorry, unimplemented for now\000"
	.align	2
.LC1:
	.ascii	"USAGE: checkum -[vhcs] infile outfile\012\011-v\011"
	.ascii	"verbose\012\011-h\011help\012\011-c\011check checks"
	.ascii	"um\012\011-s\011print the ipl size\000"
	.align	2
.LC2:
	.ascii	"\"%s\", Illegal option\012\000"
	.align	2
.LC3:
	.ascii	"Didn't specify an input file name\000"
	.align	2
.LC4:
	.ascii	"Didn't specify an output file name\000"
	.align	2
.LC5:
	.ascii	"Couldn't open %s\012\000"
	.align	2
.LC6:
	.ascii	"Couldn't write\000"
	.align	2
.LC7:
	.ascii	"The calculated checksum is:\012\0110x%x,\012\011%u\012"
	.ascii	"\000"
	.align	2
.LC8:
	.ascii	"%u is the new file size\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L2
.L10:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #99
	cmp	r3, #19
	ldrls	pc, [pc, r3, asl #2]
	b	.L3
.L5:
	.word	.L8
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L7
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L6
	.word	.L3
	.word	.L3
	.word	.L4
.L4:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L27+4
	str	r3, [r2]
	b	.L9
.L8:
	ldr	r3, .L27+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L27+8
	str	r3, [r2]
	ldr	r0, .L27+12
	bl	puts
	mov	r0, #1
	bl	exit
.L6:
	ldr	r3, .L27+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L27+16
	str	r3, [r2]
	b	.L9
.L7:
	ldr	r0, .L27+20
	bl	puts
	mov	r0, #0
	bl	exit
.L3:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L27+24
	bl	printf
	ldr	r0, .L27+20
	bl	puts
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L2:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L10
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L11
	ldr	r0, .L27+28
	bl	puts
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L12
	ldr	r0, .L27+32
	bl	puts
	mov	r0, #1
	bl	exit
.L12:
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	open
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L13
	ldr	r1, [fp, #-28]
	ldr	r0, .L27+36
	bl	printf
	mov	r0, #1
	bl	exit
.L13:
	ldr	r1, .L27+40
	ldr	r0, [fp, #-24]
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L14
	ldr	r1, [fp, #-24]
	ldr	r0, .L27+36
	bl	printf
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L16
	mov	r0, #10
	bl	putchar
	b	.L16
.L19:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L17
	mov	r0, #46
	bl	putchar
.L17:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-32]
	add	r3, r3, #4
	str	r3, [fp, #-32]
	sub	r3, fp, #44
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	write
	mov	r3, r0
	cmp	r3, #4
	beq	.L18
	ldr	r0, .L27+44
	bl	puts
.L18:
	ldr	r3, .L27+4
	ldr	r3, [r3]
	cmp	r3, #3
	ble	.L16
	mov	r0, #43
	bl	putchar
.L16:
	sub	r3, fp, #44
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-20]
	bl	read
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #4
	beq	.L19
	ldr	r3, .L27+4
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L20
	mov	r0, #10
	bl	putchar
.L20:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	ble	.L21
	sub	r3, fp, #44
	ldr	r2, [fp, #-12]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	write
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-32]
.L21:
	ldr	r3, [fp, #-40]
	rsb	r3, r3, #0
	str	r3, [fp, #-44]
	sub	r3, fp, #44
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	write
	ldr	r3, [fp, #-32]
	add	r3, r3, #4
	str	r3, [fp, #-32]
	ldr	r3, .L27+4
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L22
	ldr	r3, [fp, #-40]
	rsb	r1, r3, #0
	ldr	r3, [fp, #-40]
	rsb	r3, r3, #0
	mov	r2, r3
	ldr	r0, .L27+48
	bl	printf
.L22:
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L23
.L24:
	ldr	r3, [fp, #-32]
	add	r3, r3, #4
	str	r3, [fp, #-32]
	sub	r3, fp, #44
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	write
.L23:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #21
	lsr	r3, r3, #21
	cmp	r3, #0
	bne	.L24
	ldr	r3, .L27+16
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L25
	ldr	r1, [fp, #-32]
	ldr	r0, .L27+52
	bl	printf
.L25:
	ldr	r0, [fp, #-16]
	bl	close
	ldr	r0, [fp, #-20]
	bl	close
	mov	r0, #0
	bl	exit
.L28:
	.align	2
.L27:
	.word	.LC9
	.word	verbose
	.word	verify
	.word	.LC0
	.word	size
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	577
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
