	.file	"12637341.c"
	.intel_syntax noprefix
	.text
	.globl	dec_to_base_n
	.type	dec_to_base_n, @function
dec_to_base_n:
.LFB6:
	.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	DWORD PTR -72[rbp], esi
	mov	QWORD PTR -80[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movabs	rax, 5208208757389214273
	movabs	rdx, 5786930140093827657
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	movabs	rax, 6365651522798441041
	mov	QWORD PTR -32[rbp], rax
	mov	WORD PTR -24[rbp], 23129
	mov	DWORD PTR -60[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -68[rbp]
	cdq
	idiv	DWORD PTR -72[rbp]
	mov	DWORD PTR -56[rbp], edx
	mov	eax, DWORD PTR -68[rbp]
	cdq
	idiv	DWORD PTR -72[rbp]
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -72[rbp], 9
	jle	.L3
	cmp	DWORD PTR -56[rbp], 9
	jle	.L3
	mov	eax, DWORD PTR -56[rbp]
	sub	eax, 10
	mov	DWORD PTR -52[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -80[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	movzx	eax, BYTE PTR -48[rbp+rax]
	mov	BYTE PTR [rdx], al
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -56[rbp]
	lea	ecx, 48[rax]
	mov	eax, DWORD PTR -60[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	edx, ecx
	mov	BYTE PTR [rax], dl
.L4:
	add	DWORD PTR -60[rbp], 1
.L2:
	cmp	DWORD PTR -68[rbp], 0
	jne	.L5
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	dec_to_base_n, .-dec_to_base_n
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Case %d:\n"
	.align 8
.LC2:
	.string	"Cheapest base(s) for number %d: "
.LC3:
	.string	"%d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 392
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, -396[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -380[rbp], 1
	jmp	.L8
.L28:
	lea	rax, -368[rbp]
	mov	edx, 144
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -384[rbp], 0
	jmp	.L9
.L10:
	lea	rdx, -368[rbp]
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -384[rbp], 1
.L9:
	cmp	DWORD PTR -384[rbp], 35
	jle	.L10
	lea	rax, -388[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -380[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L27:
	lea	rax, -224[rbp]
	mov	edx, 148
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -392[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -392[rbp]
	test	eax, eax
	jne	.L12
	mov	eax, DWORD PTR -392[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -376[rbp], 2
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -376[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -376[rbp], 1
.L13:
	cmp	DWORD PTR -376[rbp], 36
	jle	.L14
	mov	edi, 10
	call	putchar@PLT
	jmp	.L11
.L12:
	mov	DWORD PTR -376[rbp], 2
	jmp	.L15
.L20:
	lea	rax, -64[rbp]
	mov	edx, 36
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	eax, DWORD PTR -392[rbp]
	lea	rdx, -64[rbp]
	mov	ecx, DWORD PTR -376[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	dec_to_base_n
	mov	DWORD PTR -384[rbp], 0
	jmp	.L16
.L19:
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	movzx	eax, BYTE PTR -64[rbp+rax]
	cmp	al, 64
	jle	.L17
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	movzx	eax, BYTE PTR -64[rbp+rax]
	cmp	al, 90
	jg	.L17
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	edx, DWORD PTR -224[rbp+rax*4]
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	movzx	eax, BYTE PTR -64[rbp+rax]
	movsx	eax, al
	sub	eax, 55
	cdqe
	mov	eax, DWORD PTR -368[rbp+rax*4]
	add	edx, eax
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	DWORD PTR -224[rbp+rax*4], edx
	jmp	.L18
.L17:
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	edx, DWORD PTR -224[rbp+rax*4]
	mov	eax, DWORD PTR -384[rbp]
	cdqe
	movzx	eax, BYTE PTR -64[rbp+rax]
	movsx	eax, al
	sub	eax, 48
	cdqe
	mov	eax, DWORD PTR -368[rbp+rax*4]
	add	edx, eax
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	DWORD PTR -224[rbp+rax*4], edx
.L18:
	add	DWORD PTR -384[rbp], 1
.L16:
	mov	eax, DWORD PTR -384[rbp]
	movsx	rbx, eax
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	jb	.L19
	add	DWORD PTR -376[rbp], 1
.L15:
	cmp	DWORD PTR -376[rbp], 36
	jle	.L20
	mov	DWORD PTR -372[rbp], 129
	mov	DWORD PTR -376[rbp], 2
	jmp	.L21
.L23:
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	eax, DWORD PTR -224[rbp+rax*4]
	cmp	DWORD PTR -372[rbp], eax
	jl	.L22
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	eax, DWORD PTR -224[rbp+rax*4]
	test	eax, eax
	je	.L22
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	eax, DWORD PTR -224[rbp+rax*4]
	mov	DWORD PTR -372[rbp], eax
.L22:
	add	DWORD PTR -376[rbp], 1
.L21:
	cmp	DWORD PTR -376[rbp], 36
	jle	.L23
	mov	eax, DWORD PTR -392[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -376[rbp], 2
	jmp	.L24
.L26:
	mov	eax, DWORD PTR -376[rbp]
	cdqe
	mov	eax, DWORD PTR -224[rbp+rax*4]
	cmp	DWORD PTR -372[rbp], eax
	jne	.L25
	mov	eax, DWORD PTR -376[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L25:
	add	DWORD PTR -376[rbp], 1
.L24:
	cmp	DWORD PTR -376[rbp], 36
	jle	.L26
	mov	edi, 10
	call	putchar@PLT
.L11:
	mov	eax, DWORD PTR -388[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -388[rbp], edx
	test	eax, eax
	jne	.L27
	add	DWORD PTR -380[rbp], 1
.L8:
	mov	eax, DWORD PTR -396[rbp]
	cmp	DWORD PTR -380[rbp], eax
	jle	.L28
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"12637341.c"
	.text
	.global	__aeabi_idivmod
	.global	__aeabi_idiv
	.section	.rodata
	.align	2
.LC0:
	.ascii	"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dec_to_base_n
	.syntax unified
	.arm
	.fpu softvfp
	.type	dec_to_base_n, %function
dec_to_base_n:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #64
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	str	r2, [fp, #-64]
	ldr	r3, .L7
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L7+4
	sub	ip, fp, #36
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stmia	ip!, {r0, r1}
	strh	r2, [ip]	@ movhi
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L2
.L5:
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-60]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	str	r3, [fp, #-44]
	ldr	r1, [fp, #-60]
	ldr	r0, [fp, #-56]
	bl	__aeabi_idiv
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-60]
	cmp	r3, #9
	ble	.L3
	ldr	r3, [fp, #-44]
	cmp	r3, #9
	ble	.L3
	ldr	r3, [fp, #-44]
	sub	r3, r3, #10
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-64]
	add	r3, r2, r3
	sub	r1, fp, #36
	ldr	r2, [fp, #-40]
	add	r2, r1, r2
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	b	.L4
.L3:
	ldr	r3, [fp, #-44]
	and	r2, r3, #255
	ldr	r3, [fp, #-48]
	ldr	r1, [fp, #-64]
	add	r3, r1, r3
	add	r2, r2, #48
	and	r2, r2, #255
	strb	r2, [r3]
.L4:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L2:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L5
	nop
	ldr	r3, .L7
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L6
	bl	__stack_chk_fail
.L6:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC1
	.word	.LC0
	.size	dec_to_base_n, .-dec_to_base_n
	.section	.rodata
	.align	2
.LC2:
	.ascii	"%d\000"
	.align	2
.LC3:
	.ascii	"Case %d:\012\000"
	.align	2
.LC4:
	.ascii	"Cheapest base(s) for number %d: \000"
	.align	2
.LC5:
	.ascii	"%d \000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 360
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #360
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #364
	mov	r1, r3
	ldr	r0, .L33+4
	bl	__isoc99_scanf
	mov	r3, #1
	str	r3, [fp, #-348]
	b	.L10
.L30:
	sub	r3, fp, #336
	mov	r2, #144
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-352]
	b	.L11
.L12:
	sub	r2, fp, #336
	ldr	r3, [fp, #-352]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L33+4
	bl	__isoc99_scanf
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L11:
	ldr	r3, [fp, #-352]
	cmp	r3, #35
	ble	.L12
	sub	r3, fp, #356
	mov	r1, r3
	ldr	r0, .L33+4
	bl	__isoc99_scanf
	ldr	r1, [fp, #-348]
	ldr	r0, .L33+8
	bl	printf
	b	.L13
.L29:
	sub	r3, fp, #192
	mov	r2, #148
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #360
	mov	r1, r3
	ldr	r0, .L33+4
	bl	__isoc99_scanf
	ldr	r3, [fp, #-360]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-360]
	mov	r1, r3
	ldr	r0, .L33+12
	bl	printf
	mov	r3, #2
	str	r3, [fp, #-344]
	b	.L15
.L16:
	ldr	r1, [fp, #-344]
	ldr	r0, .L33+16
	bl	printf
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L15:
	ldr	r3, [fp, #-344]
	cmp	r3, #36
	ble	.L16
	mov	r0, #10
	bl	putchar
	b	.L13
.L14:
	mov	r3, #2
	str	r3, [fp, #-344]
	b	.L17
.L22:
	sub	r3, fp, #44
	mov	r2, #36
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-360]
	sub	r2, fp, #44
	ldr	r1, [fp, #-344]
	mov	r0, r3
	bl	dec_to_base_n
	mov	r3, #0
	str	r3, [fp, #-352]
	b	.L18
.L21:
	sub	r2, fp, #44
	ldr	r3, [fp, #-352]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #64
	bls	.L19
	sub	r2, fp, #44
	ldr	r3, [fp, #-352]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #90
	bhi	.L19
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-188]
	sub	r1, fp, #44
	ldr	r3, [fp, #-352]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #55
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-332]
	add	r2, r2, r3
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-188]
	b	.L20
.L19:
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r2, [r3, #-188]
	sub	r1, fp, #44
	ldr	r3, [fp, #-352]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	sub	r3, r3, #48
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	ldr	r3, [r3, #-332]
	add	r2, r2, r3
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-188]
.L20:
	ldr	r3, [fp, #-352]
	add	r3, r3, #1
	str	r3, [fp, #-352]
.L18:
	sub	r3, fp, #44
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-352]
	cmp	r2, r3
	bhi	.L21
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L17:
	ldr	r3, [fp, #-344]
	cmp	r3, #36
	ble	.L22
	mov	r3, #129
	str	r3, [fp, #-340]
	mov	r3, #2
	str	r3, [fp, #-344]
	b	.L23
.L25:
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-188]
	ldr	r2, [fp, #-340]
	cmp	r2, r3
	blt	.L24
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-188]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-188]
	str	r3, [fp, #-340]
.L24:
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L23:
	ldr	r3, [fp, #-344]
	cmp	r3, #36
	ble	.L25
	ldr	r3, [fp, #-360]
	mov	r1, r3
	ldr	r0, .L33+12
	bl	printf
	mov	r3, #2
	str	r3, [fp, #-344]
	b	.L26
.L28:
	ldr	r3, [fp, #-344]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-188]
	ldr	r2, [fp, #-340]
	cmp	r2, r3
	bne	.L27
	ldr	r1, [fp, #-344]
	ldr	r0, .L33+16
	bl	printf
.L27:
	ldr	r3, [fp, #-344]
	add	r3, r3, #1
	str	r3, [fp, #-344]
.L26:
	ldr	r3, [fp, #-344]
	cmp	r3, #36
	ble	.L28
	mov	r0, #10
	bl	putchar
.L13:
	ldr	r3, [fp, #-356]
	sub	r2, r3, #1
	str	r2, [fp, #-356]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [fp, #-348]
	add	r3, r3, #1
	str	r3, [fp, #-348]
.L10:
	ldr	r3, [fp, #-364]
	ldr	r2, [fp, #-348]
	cmp	r2, r3
	ble	.L30
	mov	r3, #0
	ldr	r2, .L33
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC6
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
