	.file	"18492.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Enter an hexadecimal number (optional 0x or 0X, max. 10 chars): "
.LC1:
	.string	"Your input in hex: %s\n"
	.align 8
.LC2:
	.string	"Your input converted to decimal: %u\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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -28[rbp], 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L2
.L4:
	mov	eax, DWORD PTR -28[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -28[rbp], edx
	mov	edx, DWORD PTR -24[rbp]
	cdqe
	mov	BYTE PTR -18[rbp+rax], dl
.L2:
	call	getchar@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 10
	je	.L3
	cmp	DWORD PTR -28[rbp], 8
	jle	.L4
.L3:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	mov	BYTE PTR -18[rbp+rax], 0
	lea	rax, -18[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -18[rbp]
	mov	rdi, rax
	call	htoi
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	htoi
	.type	htoi, @function
htoi:
.LFB1:
	.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
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 48
	jne	.L10
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 120
	je	.L9
	mov	rax, QWORD PTR -24[rbp]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 88
	jne	.L10
.L9:
	mov	DWORD PTR -8[rbp], 2
	jmp	.L10
.L14:
	cmp	BYTE PTR -11[rbp], 47
	jle	.L11
	cmp	BYTE PTR -11[rbp], 57
	jg	.L11
	movsx	ax, BYTE PTR -11[rbp]
	sub	eax, 48
	mov	WORD PTR -10[rbp], ax
	jmp	.L12
.L11:
	cmp	BYTE PTR -11[rbp], 96
	jle	.L13
	cmp	BYTE PTR -11[rbp], 102
	jg	.L13
	movsx	ax, BYTE PTR -11[rbp]
	sub	eax, 87
	mov	WORD PTR -10[rbp], ax
	jmp	.L12
.L13:
	cmp	BYTE PTR -11[rbp], 64
	jle	.L12
	cmp	BYTE PTR -11[rbp], 70
	jg	.L12
	movsx	ax, BYTE PTR -11[rbp]
	sub	eax, 55
	mov	WORD PTR -10[rbp], ax
.L12:
	mov	eax, DWORD PTR -4[rbp]
	sal	eax, 4
	mov	edx, eax
	movzx	eax, WORD PTR -10[rbp]
	add	eax, edx
	mov	DWORD PTR -4[rbp], eax
.L10:
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -8[rbp], edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -11[rbp], al
	cmp	BYTE PTR -11[rbp], 0
	jne	.L14
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	htoi, .-htoi
	.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	"18492.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter an hexadecimal number (optional 0x or 0X, max"
	.ascii	". 10 chars): \000"
	.align	2
.LC1:
	.ascii	"Your input in hex: %s\012\000"
	.align	2
.LC2:
	.ascii	"Your input converted to decimal: %u\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 = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r0, .L7+4
	bl	printf
	b	.L2
.L4:
	ldr	r3, [fp, #-28]
	add	r2, r3, #1
	str	r2, [fp, #-28]
	ldr	r2, [fp, #-24]
	and	r2, r2, #255
	sub	r1, fp, #4
	add	r3, r1, r3
	strb	r2, [r3, #-16]
.L2:
	bl	getchar
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #10
	beq	.L3
	ldr	r3, [fp, #-28]
	cmp	r3, #8
	ble	.L4
.L3:
	sub	r2, fp, #20
	ldr	r3, [fp, #-28]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L7+8
	bl	printf
	sub	r3, fp, #20
	mov	r0, r3
	bl	htoi
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L7+12
	bl	printf
	mov	r3, #0
	ldr	r2, .L7
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.align	2
	.global	htoi
	.syntax unified
	.arm
	.fpu softvfp
	.type	htoi, %function
htoi:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #48
	bne	.L12
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #120
	beq	.L11
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #88
	bne	.L12
.L11:
	mov	r3, #2
	str	r3, [fp, #-12]
	b	.L12
.L16:
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #47
	bls	.L13
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #57
	bhi	.L13
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	sub	r3, r3, #48
	strh	r3, [fp, #-14]	@ movhi
	b	.L14
.L13:
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #96
	bls	.L15
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #102
	bhi	.L15
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	sub	r3, r3, #87
	strh	r3, [fp, #-14]	@ movhi
	b	.L14
.L15:
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #64
	bls	.L14
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #70
	bhi	.L14
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	sub	r3, r3, #55
	strh	r3, [fp, #-14]	@ movhi
.L14:
	ldr	r3, [fp, #-8]
	lsl	r2, r3, #4
	ldrh	r3, [fp, #-14]
	add	r3, r2, r3
	str	r3, [fp, #-8]
.L12:
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, r2
	ldrb	r3, [r3]
	strb	r3, [fp, #-15]
	ldrb	r3, [fp, #-15]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L16
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	htoi, .-htoi
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
