	.file	"90411.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Calculate CRC8\nUsage: crc8 [options]\n\t-f <file>\tfile name\n\t-n <size>\tmaximum size to be calculated\n\t-h\t\tshow this help"
	.text
	.type	help, @function
help:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	help, .-help
	.type	add_to_crc8, @function
add_to_crc8:
.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	QWORD PTR -32[rbp], rsi
	mov	BYTE PTR -20[rbp], al
	movzx	eax, BYTE PTR -20[rbp]
	mov	BYTE PTR -6[rbp], al
	mov	BYTE PTR -5[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L3
.L5:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	xor	al, BYTE PTR -6[rbp]
	and	eax, 1
	mov	BYTE PTR -5[rbp], al
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	shr	al
	mov	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], dl
	shr	BYTE PTR -6[rbp]
	cmp	BYTE PTR -5[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	xor	eax, -116
	mov	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], dl
.L4:
	add	DWORD PTR -4[rbp], 1
.L3:
	cmp	DWORD PTR -4[rbp], 8
	jne	.L5
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	add_to_crc8, .-add_to_crc8
	.globl	crc8
	.type	crc8, @function
crc8:
.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	mov	BYTE PTR -13[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	lea	rdx, -13[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	add_to_crc8
	add	DWORD PTR -12[rbp], 1
.L8:
	mov	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -28[rbp], eax
	jne	.L9
	movzx	eax, BYTE PTR -13[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	crc8, .-crc8
	.section	.rodata
	.align 8
.LC1:
	.string	"size should be a dec or hex value"
.LC2:
	.string	":f:n:h"
.LC3:
	.string	"r"
.LC4:
	.string	"cannot open the file"
.LC5:
	.string	"cannot allocate memory"
.LC6:
	.string	"%x\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR stdin[rip]
	mov	QWORD PTR -24[rbp], rax
	mov	QWORD PTR -8[rbp], 0
	mov	QWORD PTR -16[rbp], 0
	mov	DWORD PTR -36[rbp], 0
	mov	DWORD PTR -32[rbp], 0
	mov	DWORD PTR -28[rbp], 0
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	jmp	.L13
.L21:
	cmp	DWORD PTR -28[rbp], 102
	je	.L14
	cmp	DWORD PTR -28[rbp], 110
	je	.L15
	jmp	.L25
.L14:
	mov	rax, QWORD PTR optarg[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L13
.L15:
	mov	rax, QWORD PTR optarg[rip]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 48
	jne	.L17
	mov	rax, QWORD PTR optarg[rip]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	call	tolower@PLT
	cmp	eax, 120
	jne	.L17
	mov	rax, QWORD PTR optarg[rip]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR -36[rbp], eax
	jmp	.L18
.L17:
	mov	rax, QWORD PTR optarg[rip]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	DWORD PTR -36[rbp], eax
.L18:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L13
	lea	rdi, .LC1[rip]
	call	perror@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	neg	eax
	jmp	.L20
.L25:
	call	help
.L13:
	mov	rcx, QWORD PTR -64[rbp]
	mov	eax, DWORD PTR -52[rbp]
	lea	rdx, .LC2[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	jne	.L21
	cmp	QWORD PTR -16[rbp], 0
	je	.L22
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L22
	lea	rdi, .LC4[rip]
	call	perror@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	neg	eax
	jmp	.L20
.L22:
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L23
	lea	rdi, .LC5[rip]
	call	perror@PLT
	jmp	.L24
.L23:
	mov	edx, DWORD PTR -36[rbp]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -32[rbp], eax
	mov	edx, DWORD PTR -32[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	crc8
	movzx	eax, al
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L24:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"90411.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Calculate CRC8\012Usage: crc8 [options]\012\011-f <"
	.ascii	"file>\011file name\012\011-n <size>\011maximum size"
	.ascii	" to be calculated\012\011-h\011\011show this help\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	help, %function
help:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L2
	bl	puts
	mov	r0, #0
	bl	exit
.L3:
	.align	2
.L2:
	.word	.LC0
	.size	help, .-help
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	add_to_crc8, %function
add_to_crc8:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	mov	r3, r0
	str	r1, [fp, #-20]
	strb	r3, [fp, #-13]
	ldrb	r3, [fp, #-13]
	strb	r3, [fp, #-10]
	mov	r3, #0
	strb	r3, [fp, #-9]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L5
.L7:
	ldr	r3, [fp, #-20]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldrb	r3, [fp, #-10]
	eor	r3, r3, r2
	and	r3, r3, #255
	and	r3, r3, #1
	strb	r3, [fp, #-9]
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsr	r3, r3, #1
	and	r2, r3, #255
	ldr	r3, [fp, #-20]
	strb	r2, [r3]
	ldrb	r3, [fp, #-10]	@ zero_extendqisi2
	lsr	r3, r3, #1
	strb	r3, [fp, #-10]
	ldrb	r3, [fp, #-9]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	eor	r3, r3, #115
	mvn	r3, r3
	and	r2, r3, #255
	ldr	r3, [fp, #-20]
	strb	r2, [r3]
.L6:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L5:
	ldr	r3, [fp, #-8]
	cmp	r3, #8
	bne	.L7
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	add_to_crc8, .-add_to_crc8
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	crc8
	.syntax unified
	.arm
	.fpu softvfp
	.type	crc8, %function
crc8:
	@ 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, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	strb	r3, [fp, #-13]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L10
.L11:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r2, fp, #13
	mov	r1, r2
	mov	r0, r3
	bl	add_to_crc8
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L10:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	bne	.L11
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC1
	.size	crc8, .-crc8
	.section	.rodata
	.align	2
.LC2:
	.ascii	"size should be a dec or hex value\000"
	.align	2
.LC3:
	.ascii	":f:n:h\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.ascii	"cannot open the file\000"
	.align	2
.LC6:
	.ascii	"cannot allocate memory\000"
	.align	2
.LC7:
	.ascii	"%x\012\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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L30
	ldr	r3, [r3]
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	b	.L17
.L25:
	ldr	r3, [fp, #-8]
	cmp	r3, #102
	beq	.L18
	ldr	r3, [fp, #-8]
	cmp	r3, #110
	beq	.L19
	b	.L29
.L18:
	ldr	r3, .L30+4
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	b	.L17
.L19:
	ldr	r3, .L30+4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #48
	bne	.L21
	ldr	r3, .L30+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	tolower
	mov	r3, r0
	cmp	r3, #120
	bne	.L21
	ldr	r3, .L30+4
	ldr	r3, [r3]
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	str	r0, [fp, #-20]
	b	.L22
.L21:
	ldr	r3, .L30+4
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	str	r0, [fp, #-20]
.L22:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L17
	ldr	r0, .L30+8
	bl	perror
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	rsb	r3, r3, #0
	b	.L24
.L29:
	bl	help
.L17:
	ldr	r2, .L30+12
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	getopt
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L25
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L26
	ldr	r1, .L30+16
	ldr	r0, [fp, #-24]
	bl	fopen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L26
	ldr	r0, .L30+20
	bl	perror
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	rsb	r3, r3, #0
	b	.L24
.L26:
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L27
	ldr	r0, .L30+24
	bl	perror
	b	.L28
.L27:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-20]
	mov	r1, #1
	ldr	r0, [fp, #-16]
	bl	fread
	str	r0, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	crc8
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L30+28
	bl	printf
	ldr	r0, [fp, #-16]
	bl	free
.L28:
	ldr	r0, [fp, #-28]
	bl	fclose
	mov	r3, #0
.L24:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	stdin
	.word	optarg
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.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
