	.file	"346256.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Input a credit card to number to be validated"
.LC1:
	.string	"Please insert numbers only"
.LC2:
	.string	"%d"
.LC3:
	.string	"AMEX"
.LC4:
	.string	"MASTERCARD"
.LC5:
	.string	"VISA"
.LC6:
	.string	"UNKNOWN"
.LC7:
	.string	"INVALID"
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 152
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -80[rbp]
	mov	esi, 20
	mov	rdi, rax
	call	fgets@PLT
	jmp	.L2
.L3:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -80[rbp]
	mov	esi, 20
	mov	rdi, rax
	call	fgets@PLT
.L2:
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	movzx	eax, BYTE PTR -80[rbp]
	movsx	rax, al
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	je	.L3
	mov	DWORD PTR -148[rbp], 0
	mov	DWORD PTR -152[rbp], 0
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -152[rbp]
	cdqe
	movzx	eax, BYTE PTR -80[rbp+rax]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	js	.L5
	cmp	DWORD PTR -128[rbp], 9
	jg	.L5
	add	DWORD PTR -148[rbp], 1
.L5:
	add	DWORD PTR -152[rbp], 1
.L4:
	cmp	DWORD PTR -152[rbp], 19
	jle	.L6
	mov	eax, DWORD PTR -148[rbp]
	mov	rdx, rsp
	mov	rbx, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -120[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -176[rbp], rdx
	mov	QWORD PTR -168[rbp], 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L7:
	cmp	rsp, rdx
	je	.L8
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L7
.L8:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L9
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L9:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -112[rbp], rax
	mov	DWORD PTR -152[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -148[rbp]
	sub	eax, DWORD PTR -152[rbp]
	sub	eax, 1
	cdqe
	movzx	ecx, BYTE PTR -80[rbp+rax]
	mov	rdx, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -152[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	add	DWORD PTR -152[rbp], 1
.L10:
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, DWORD PTR -148[rbp]
	jl	.L11
	mov	eax, DWORD PTR -148[rbp]
	mov	rdx, rsp
	mov	r12, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -104[rbp], rdx
	movsx	rdx, eax
	mov	QWORD PTR -192[rbp], rdx
	mov	QWORD PTR -184[rbp], 0
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L12:
	cmp	rsp, rdx
	je	.L13
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L12
.L13:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L14
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L14:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -96[rbp], rax
	mov	DWORD PTR -156[rbp], 0
	mov	DWORD PTR -160[rbp], 0
	mov	DWORD PTR -152[rbp], 0
	jmp	.L15
.L20:
	mov	rdx, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR -152[rbp]
	cdqe
	movzx	eax, BYTE PTR [rdx+rax]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -128[rbp], eax
	mov	eax, DWORD PTR -152[rbp]
	add	eax, 1
	and	eax, 1
	test	eax, eax
	jne	.L16
	mov	eax, DWORD PTR -128[rbp]
	add	eax, eax
	mov	DWORD PTR -124[rbp], eax
	mov	edx, DWORD PTR -124[rbp]
	lea	rax, -82[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -144[rbp], 0
	jmp	.L17
.L18:
	mov	eax, DWORD PTR -144[rbp]
	cdqe
	movzx	ecx, BYTE PTR -82[rbp+rax]
	mov	rdx, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR -160[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	add	DWORD PTR -160[rbp], 1
	add	DWORD PTR -144[rbp], 1
.L17:
	cmp	DWORD PTR -144[rbp], 1
	jle	.L18
	jmp	.L19
.L16:
	mov	eax, DWORD PTR -128[rbp]
	add	DWORD PTR -156[rbp], eax
.L19:
	add	DWORD PTR -152[rbp], 1
.L15:
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, DWORD PTR -148[rbp]
	jl	.L20
	mov	DWORD PTR -140[rbp], 0
	mov	DWORD PTR -152[rbp], 0
	jmp	.L21
.L23:
	mov	rdx, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR -152[rbp]
	cdqe
	movzx	eax, BYTE PTR [rdx+rax]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	jle	.L22
	cmp	DWORD PTR -128[rbp], 9
	jg	.L22
	mov	eax, DWORD PTR -128[rbp]
	add	DWORD PTR -140[rbp], eax
.L22:
	add	DWORD PTR -152[rbp], 1
.L21:
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, DWORD PTR -148[rbp]
	jl	.L23
	mov	edx, DWORD PTR -140[rbp]
	mov	eax, DWORD PTR -156[rbp]
	lea	ecx, [rdx+rax]
	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
	sub	ecx, eax
	mov	edx, ecx
	test	edx, edx
	jne	.L24
	movzx	eax, BYTE PTR -80[rbp]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -136[rbp], eax
	movzx	eax, BYTE PTR -79[rbp]
	movsx	eax, al
	sub	eax, 48
	mov	DWORD PTR -132[rbp], eax
	cmp	DWORD PTR -136[rbp], 3
	jne	.L25
	cmp	DWORD PTR -132[rbp], 4
	je	.L26
	cmp	DWORD PTR -132[rbp], 7
	jne	.L25
.L26:
	lea	rdi, .LC3[rip]
	call	puts@PLT
	jmp	.L31
.L25:
	cmp	DWORD PTR -136[rbp], 5
	jne	.L28
	cmp	DWORD PTR -132[rbp], 1
	je	.L29
	cmp	DWORD PTR -132[rbp], 2
	je	.L29
	cmp	DWORD PTR -132[rbp], 3
	je	.L29
	cmp	DWORD PTR -132[rbp], 4
	je	.L29
	cmp	DWORD PTR -132[rbp], 5
	jne	.L28
.L29:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	jmp	.L31
.L28:
	cmp	DWORD PTR -136[rbp], 4
	jne	.L30
	lea	rdi, .LC5[rip]
	call	puts@PLT
	jmp	.L31
.L30:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L31
.L24:
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L31:
	mov	eax, 0
	mov	rsp, r12
	mov	rsp, rbx
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.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	"346256.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Input a credit card to number to be validated\000"
	.align	2
.LC1:
	.ascii	"Please insert numbers only\000"
	.align	2
.LC2:
	.ascii	"%d\000"
	.align	2
.LC3:
	.ascii	"AMEX\000"
	.align	2
.LC4:
	.ascii	"MASTERCARD\000"
	.align	2
.LC5:
	.ascii	"VISA\000"
	.align	2
.LC6:
	.ascii	"UNKNOWN\000"
	.align	2
.LC7:
	.ascii	"INVALID\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #80
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r0, .L28+4
	bl	puts
	ldr	r3, .L28+8
	ldr	r2, [r3]
	sub	r3, fp, #32
	mov	r1, #20
	mov	r0, r3
	bl	fgets
	b	.L2
.L3:
	ldr	r0, .L28+12
	bl	puts
	ldr	r3, .L28+8
	ldr	r2, [r3]
	sub	r3, fp, #32
	mov	r1, #20
	mov	r0, r3
	bl	fgets
.L2:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldrb	r3, [fp, #-32]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	beq	.L3
	mov	r3, #0
	str	r3, [fp, #-80]
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L4
.L6:
	sub	r2, fp, #32
	ldr	r3, [fp, #-84]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	blt	.L5
	ldr	r3, [fp, #-44]
	cmp	r3, #9
	bgt	.L5
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L5:
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L4:
	ldr	r3, [fp, #-84]
	cmp	r3, #19
	ble	.L6
	ldr	ip, [fp, #-80]
	mov	r3, sp
	mov	r4, r3
	sub	r3, ip, #1
	str	r3, [fp, #-68]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L7
.L8:
	ldr	r2, [fp, #-80]
	ldr	r3, [fp, #-84]
	sub	r3, r2, r3
	sub	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	ldrb	r1, [r3, #-20]	@ zero_extendqisi2
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-84]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L7:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-80]
	cmp	r2, r3
	blt	.L8
	ldr	ip, [fp, #-80]
	mov	r3, sp
	mov	r5, r3
	sub	r3, ip, #1
	str	r3, [fp, #-60]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-88]
	mov	r3, #0
	str	r3, [fp, #-92]
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L9
.L14:
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-84]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L10
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #1
	str	r3, [fp, #-40]
	sub	r3, fp, #36
	ldr	r2, [fp, #-40]
	ldr	r1, .L28+16
	mov	r0, r3
	bl	sprintf
	mov	r3, #0
	str	r3, [fp, #-76]
	b	.L11
.L12:
	sub	r2, fp, #36
	ldr	r3, [fp, #-76]
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-92]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-92]
	add	r3, r3, #1
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
.L11:
	ldr	r3, [fp, #-76]
	cmp	r3, #1
	ble	.L12
	b	.L13
.L10:
	ldr	r2, [fp, #-88]
	ldr	r3, [fp, #-44]
	add	r3, r2, r3
	str	r3, [fp, #-88]
.L13:
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L9:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-80]
	cmp	r2, r3
	blt	.L14
	mov	r3, #0
	str	r3, [fp, #-72]
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L15
.L17:
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-84]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	ble	.L16
	ldr	r3, [fp, #-44]
	cmp	r3, #9
	bgt	.L16
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-44]
	add	r3, r2, r3
	str	r3, [fp, #-72]
.L16:
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L15:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-80]
	cmp	r2, r3
	blt	.L17
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-88]
	add	r1, r2, r3
	ldr	r3, .L28+20
	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	.L18
	ldrb	r3, [fp, #-32]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-52]
	ldrb	r3, [fp, #-31]	@ zero_extendqisi2
	sub	r3, r3, #48
	str	r3, [fp, #-48]
	ldr	r3, [fp, #-52]
	cmp	r3, #3
	bne	.L19
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	beq	.L20
	ldr	r3, [fp, #-48]
	cmp	r3, #7
	bne	.L19
.L20:
	ldr	r0, .L28+24
	bl	puts
	b	.L25
.L19:
	ldr	r3, [fp, #-52]
	cmp	r3, #5
	bne	.L22
	ldr	r3, [fp, #-48]
	cmp	r3, #1
	beq	.L23
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	beq	.L23
	ldr	r3, [fp, #-48]
	cmp	r3, #3
	beq	.L23
	ldr	r3, [fp, #-48]
	cmp	r3, #4
	beq	.L23
	ldr	r3, [fp, #-48]
	cmp	r3, #5
	bne	.L22
.L23:
	ldr	r0, .L28+28
	bl	puts
	b	.L25
.L22:
	ldr	r3, [fp, #-52]
	cmp	r3, #4
	bne	.L24
	ldr	r0, .L28+32
	bl	puts
	b	.L25
.L24:
	ldr	r0, .L28+36
	bl	puts
	b	.L25
.L18:
	ldr	r0, .L28+40
	bl	puts
.L25:
	mov	r3, #0
	mov	sp, r5
	mov	sp, r4
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC8
	.word	.LC0
	.word	stdin
	.word	.LC1
	.word	.LC2
	.word	1717986919
	.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
