	.file	"767701.c"
	.intel_syntax noprefix
	.text
	.globl	array_until_k
	.type	array_until_k, @function
array_until_k:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 1
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -20[rbp]
	sar	eax
	imul	eax, DWORD PTR -24[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	lea	rsi, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rsi
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -12[rbp], 1
.L2:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jge	.L3
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	array_until_k, .-array_until_k
	.globl	sum_until_k
	.type	sum_until_k, @function
sum_until_k:
.LFB7:
	.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	DWORD PTR -24[rbp], esi
	mov	QWORD PTR -8[rbp], 0
	mov	DWORD PTR -12[rbp], 1
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -12[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -20[rbp]
	sar	eax
	imul	eax, DWORD PTR -24[rbp]
	add	eax, edx
	cdqe
	add	QWORD PTR -8[rbp], rax
	add	DWORD PTR -12[rbp], 1
.L6:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jge	.L7
	mov	rax, QWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sum_until_k, .-sum_until_k
	.globl	best_guess_k
	.type	best_guess_k, @function
best_guess_k:
.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, 24
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -16[rbp], 0
	cmp	DWORD PTR -20[rbp], 100
	jg	.L10
	mov	eax, DWORD PTR -16[rbp]
	jmp	.L11
.L10:
	cmp	DWORD PTR -20[rbp], 1000
	jg	.L12
	mov	DWORD PTR -12[rbp], 2
	jmp	.L19
.L12:
	cmp	DWORD PTR -20[rbp], 100000
	jg	.L14
	mov	DWORD PTR -12[rbp], 10
	jmp	.L19
.L14:
	cmp	DWORD PTR -20[rbp], 10000000
	jg	.L15
	mov	DWORD PTR -12[rbp], 50
	jmp	.L19
.L15:
	mov	DWORD PTR -12[rbp], 250
.L19:
	mov	edx, DWORD PTR -24[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, edx
	mov	edi, eax
	call	sum_until_k
	mov	QWORD PTR -8[rbp], rax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	cmp	QWORD PTR -8[rbp], rax
	jge	.L16
	mov	eax, DWORD PTR -12[rbp]
	add	DWORD PTR -16[rbp], eax
	jmp	.L19
.L16:
	mov	eax, DWORD PTR -12[rbp]
	sub	DWORD PTR -16[rbp], eax
	nop
	mov	eax, DWORD PTR -16[rbp]
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	best_guess_k, .-best_guess_k
	.globl	distributeCandies
	.type	distributeCandies, @function
distributeCandies:
.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	DWORD PTR -56[rbp], esi
	mov	QWORD PTR -64[rbp], rdx
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -56[rbp]
	mov	DWORD PTR [rax], edx
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -16[rbp], 0
	mov	edx, DWORD PTR -56[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, edx
	mov	edi, eax
	call	best_guess_k
	mov	DWORD PTR -40[rbp], eax
	jmp	.L22
.L23:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	eax, DWORD PTR -40[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -40[rbp], edx
	mov	edx, DWORD PTR -56[rbp]
	mov	esi, edx
	mov	edi, eax
	call	sum_until_k
	mov	QWORD PTR -16[rbp], rax
.L22:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	cmp	QWORD PTR -16[rbp], rax
	jle	.L23
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	cmp	QWORD PTR -16[rbp], rax
	jne	.L24
	mov	eax, DWORD PTR -40[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	mov	edi, edx
	call	array_until_k
	jmp	.L25
.L24:
	mov	eax, DWORD PTR -52[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	sub	eax, edx
	mov	DWORD PTR -36[rbp], eax
	mov	eax, 2
	cmp	DWORD PTR -40[rbp], 2
	cmovge	eax, DWORD PTR -40[rbp]
	sub	eax, 2
	mov	DWORD PTR -40[rbp], eax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L26
	mov	eax, DWORD PTR -56[rbp]
	cdqe
	mov	esi, 4
	mov	rdi, rax
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	sub	DWORD PTR -40[rbp], 1
	jmp	.L27
.L26:
	mov	edx, DWORD PTR -56[rbp]
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, edx
	mov	edi, eax
	call	array_until_k
	mov	QWORD PTR -8[rbp], rax
.L27:
	add	DWORD PTR -40[rbp], 1
	mov	DWORD PTR -32[rbp], 1
	jmp	.L28
.L31:
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -40[rbp]
	add	eax, 1
	imul	eax, DWORD PTR -40[rbp]
	sar	eax
	imul	eax, DWORD PTR -56[rbp]
	add	edx, eax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rcx, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rcx
	mov	ecx, DWORD PTR [rax]
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L29
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -36[rbp]
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	jmp	.L30
.L29:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR [rax]
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -28[rbp]
	add	edx, ecx
	mov	DWORD PTR [rax], edx
	mov	eax, DWORD PTR -28[rbp]
	sub	DWORD PTR -36[rbp], eax
	add	DWORD PTR -32[rbp], 1
.L28:
	mov	eax, DWORD PTR -56[rbp]
	cmp	eax, DWORD PTR -32[rbp]
	jge	.L31
.L30:
	mov	rax, QWORD PTR -8[rbp]
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	distributeCandies, .-distributeCandies
	.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	"767701.c"
	.text
	.align	2
	.global	array_until_k
	.syntax unified
	.arm
	.fpu softvfp
	.type	array_until_k, %function
array_until_k:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	mul	r1, r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldr	r2, [fp, #-16]
	mul	r3, r2, r3
	asr	r3, r3, #1
	ldr	r2, [fp, #-20]
	mul	r2, r3, r2
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r0, [fp, #-8]
	add	r3, r0, r3
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bge	.L3
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	array_until_k, .-array_until_k
	.align	2
	.global	sum_until_k
	.syntax unified
	.arm
	.fpu softvfp
	.type	sum_until_k, %function
sum_until_k:
	@ 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]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L6
.L7:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldr	r2, [fp, #-8]
	mul	r2, r3, r2
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	ldr	r1, [fp, #-16]
	mul	r3, r1, r3
	asr	r3, r3, #1
	ldr	r1, [fp, #-20]
	mul	r3, r1, r3
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L6:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	bge	.L7
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	sum_until_k, .-sum_until_k
	.align	2
	.global	best_guess_k
	.syntax unified
	.arm
	.fpu softvfp
	.type	best_guess_k, %function
best_guess_k:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r3, #100
	bgt	.L10
	ldr	r3, [fp, #-16]
	b	.L11
.L10:
	ldr	r3, [fp, #-24]
	cmp	r3, #1000
	bgt	.L12
	mov	r3, #2
	str	r3, [fp, #-12]
	b	.L19
.L12:
	ldr	r3, [fp, #-24]
	ldr	r2, .L21
	cmp	r3, r2
	bgt	.L14
	mov	r3, #10
	str	r3, [fp, #-12]
	b	.L19
.L14:
	ldr	r3, [fp, #-24]
	ldr	r2, .L21+4
	cmp	r3, r2
	bgt	.L15
	mov	r3, #50
	str	r3, [fp, #-12]
	b	.L19
.L15:
	mov	r3, #250
	str	r3, [fp, #-12]
.L19:
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-16]
	bl	sum_until_k
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bge	.L16
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	b	.L19
.L16:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	str	r3, [fp, #-16]
	nop
	ldr	r3, [fp, #-16]
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	100000
	.word	10000000
	.size	best_guess_k, .-best_guess_k
	.align	2
	.global	distributeCandies
	.syntax unified
	.arm
	.fpu softvfp
	.type	distributeCandies, %function
distributeCandies:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	ldr	r3, [fp, #-48]
	ldr	r2, [fp, #-44]
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-40]
	bl	best_guess_k
	str	r0, [fp, #-24]
	b	.L24
.L25:
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	str	r2, [fp, #-24]
	ldr	r1, [fp, #-44]
	mov	r0, r3
	bl	sum_until_k
	str	r0, [fp, #-28]
.L24:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bge	.L25
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bne	.L26
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	ldr	r1, [fp, #-44]
	mov	r0, r3
	bl	array_until_k
	mov	r3, r0
	b	.L27
.L26:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-32]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	movge	r3, r3
	movlt	r3, #2
	sub	r3, r3, #2
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L28
	ldr	r3, [fp, #-44]
	mov	r1, #4
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	str	r3, [fp, #-24]
	b	.L29
.L28:
	ldr	r1, [fp, #-44]
	ldr	r0, [fp, #-24]
	bl	array_until_k
	str	r0, [fp, #-16]
.L29:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L30
.L33:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	mul	r2, r3, r2
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	ldr	r1, [fp, #-24]
	mul	r3, r1, r3
	asr	r3, r3, #1
	ldr	r1, [fp, #-44]
	mul	r3, r1, r3
	add	r2, r2, r3
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r1, [fp, #-16]
	add	r3, r1, r3
	ldr	r3, [r3]
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	blt	.L31
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	add	r2, r1, r2
	str	r2, [r3]
	b	.L32
.L31:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r1, [r3]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	add	r2, r1, r2
	str	r2, [r3]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L30:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bge	.L33
.L32:
	ldr	r3, [fp, #-16]
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	distributeCandies, .-distributeCandies
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
