	.file	"452628.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Validated!"
.LC1:
	.string	"Error in barcode!"
	.align 8
.LC2:
	.string	"\nStep(1)\nSum of the digits in the odd-numbered positions times 3: %d\n\nStep(2)\nSum of the digits in the even-numbered positions plus the value of Step(1): %d\n\nCheck digit = %d\n\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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	UPC_input
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	odd_postition_sum
	mov	edx, eax
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	mov	DWORD PTR -76[rbp], eax
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	even_position_sum
	mov	edx, DWORD PTR -76[rbp]
	add	eax, edx
	mov	DWORD PTR -72[rbp], eax
	mov	eax, DWORD PTR -72[rbp]
	mov	edi, eax
	call	calculate_check_digit
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cmp	DWORD PTR -68[rbp], eax
	jne	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L3
.L2:
	lea	rdi, .LC1[rip]
	call	puts@PLT
.L3:
	mov	ecx, DWORD PTR -68[rbp]
	mov	edx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.string	"Enter the 12 digit barcode separated by spaces: "
.LC4:
	.string	"%d%d%d%d%d%d%d%d%d%d%d%d"
	.text
	.globl	UPC_input
	.type	UPC_input, @function
UPC_input:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 24
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	QWORD PTR -40[rbp], rdi
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rbx, 44[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r11, 40[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r10, 36[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r9, 32[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r8, 28[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rdi, 24[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, 20[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r13, 16[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	r12, 12[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, 8[rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 4[rax]
	mov	rax, QWORD PTR -40[rbp]
	sub	rsp, 8
	push	rbx
	push	r11
	push	r10
	push	r9
	push	r8
	push	rdi
	push	rsi
	mov	r9, r13
	mov	r8, r12
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	rsp, 64
	nop
	lea	rsp, -24[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	UPC_input, .-UPC_input
	.globl	odd_postition_sum
	.type	odd_postition_sum, @function
odd_postition_sum:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L8
.L10:
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 1
	test	eax, eax
	jne	.L9
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	add	DWORD PTR -8[rbp], eax
.L9:
	add	DWORD PTR -4[rbp], 1
.L8:
	cmp	DWORD PTR -4[rbp], 11
	jle	.L10
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	odd_postition_sum, .-odd_postition_sum
	.globl	even_position_sum
	.type	even_position_sum, @function
even_position_sum:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L13
.L15:
	mov	eax, DWORD PTR -4[rbp]
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	cmp	eax, 1
	jne	.L14
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	add	DWORD PTR -8[rbp], eax
.L14:
	add	DWORD PTR -4[rbp], 1
.L13:
	cmp	DWORD PTR -4[rbp], 10
	jle	.L15
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	even_position_sum, .-even_position_sum
	.globl	calculate_check_digit
	.type	calculate_check_digit, @function
calculate_check_digit:
.LFB4:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	ecx, DWORD PTR -20[rbp]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, ecx
	sar	esi, 31
	sub	eax, esi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	mov	edx, ecx
	sub	edx, eax
	test	edx, edx
	jne	.L18
	mov	DWORD PTR -4[rbp], 0
	jmp	.L19
.L18:
	mov	edx, DWORD PTR -20[rbp]
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	mov	ecx, edx
	sub	ecx, eax
	mov	eax, 10
	sub	eax, ecx
	mov	DWORD PTR -4[rbp], eax
.L19:
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	calculate_check_digit, .-calculate_check_digit
	.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	"452628.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Validated!\000"
	.align	2
.LC1:
	.ascii	"Error in barcode!\000"
	.align	2
.LC2:
	.ascii	"\012Step(1)\012Sum of the digits in the odd-numbere"
	.ascii	"d positions times 3: %d\012\012Step(2)\012Sum of th"
	.ascii	"e digits in the even-numbered positions plus the va"
	.ascii	"lue of Step(1): %d\012\012Check digit = %d\012\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #56
	mov	r0, r3
	bl	UPC_input
	sub	r3, fp, #56
	mov	r0, r3
	bl	odd_postition_sum
	mov	r2, r0
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	str	r3, [fp, #-68]
	sub	r3, fp, #56
	mov	r0, r3
	bl	even_position_sum
	mov	r2, r0
	ldr	r3, [fp, #-68]
	add	r3, r3, r2
	str	r3, [fp, #-64]
	ldr	r0, [fp, #-64]
	bl	calculate_check_digit
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-60]
	cmp	r2, r3
	bne	.L2
	ldr	r0, .L6+4
	bl	puts
	b	.L3
.L2:
	ldr	r0, .L6+8
	bl	puts
.L3:
	ldr	r3, [fp, #-60]
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-68]
	ldr	r0, .L6+12
	bl	printf
	mov	r3, #0
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Enter the 12 digit barcode separated by spaces: \000"
	.align	2
.LC5:
	.ascii	"%d%d%d%d%d%d%d%d%d%d%d%d\000"
	.text
	.align	2
	.global	UPC_input
	.syntax unified
	.arm
	.fpu softvfp
	.type	UPC_input, %function
UPC_input:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #52
	str	r0, [fp, #-32]
	ldr	r0, .L9
	bl	printf
	ldr	r3, [fp, #-32]
	add	r7, r3, #4
	ldr	r3, [fp, #-32]
	add	r8, r3, #8
	ldr	r3, [fp, #-32]
	add	r3, r3, #12
	ldr	r2, [fp, #-32]
	add	r2, r2, #16
	ldr	r1, [fp, #-32]
	add	r1, r1, #20
	ldr	r0, [fp, #-32]
	add	r0, r0, #24
	ldr	ip, [fp, #-32]
	add	ip, ip, #28
	ldr	lr, [fp, #-32]
	add	lr, lr, #32
	ldr	r4, [fp, #-32]
	add	r4, r4, #36
	ldr	r5, [fp, #-32]
	add	r5, r5, #40
	ldr	r6, [fp, #-32]
	add	r6, r6, #44
	str	r6, [sp, #32]
	str	r5, [sp, #28]
	str	r4, [sp, #24]
	str	lr, [sp, #20]
	str	ip, [sp, #16]
	str	r0, [sp, #12]
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r3, r8
	mov	r2, r7
	ldr	r1, [fp, #-32]
	ldr	r0, .L9+4
	bl	__isoc99_scanf
	nop
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC4
	.word	.LC5
	.size	UPC_input, .-UPC_input
	.align	2
	.global	odd_postition_sum
	.syntax unified
	.arm
	.fpu softvfp
	.type	odd_postition_sum, %function
odd_postition_sum:
	@ 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
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L12
.L14:
	ldr	r3, [fp, #-8]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L13:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L12:
	ldr	r3, [fp, #-8]
	cmp	r3, #11
	ble	.L14
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	odd_postition_sum, .-odd_postition_sum
	.align	2
	.global	even_position_sum
	.syntax unified
	.arm
	.fpu softvfp
	.type	even_position_sum, %function
even_position_sum:
	@ 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
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L17
.L19:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	cmp	r3, #1
	bne	.L18
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L18:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L17:
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	ble	.L19
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	even_position_sum, .-even_position_sum
	.align	2
	.global	calculate_check_digit
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculate_check_digit, %function
calculate_check_digit:
	@ 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
	str	r0, [fp, #-16]
	ldr	r1, [fp, #-16]
	ldr	r3, .L25
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L22
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L23
.L22:
	ldr	r1, [fp, #-16]
	ldr	r3, .L25
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	rsb	r3, r2, #10
	str	r3, [fp, #-8]
.L23:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L26:
	.align	2
.L25:
	.word	1717986919
	.size	calculate_check_digit, .-calculate_check_digit
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
