	.file	"145452576.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	r12
	push	rbx
	sub	rsp, 96
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r12, rax
	lea	rax, -88[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, 1
	jg	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L3
.L2:
	mov	ebx, DWORD PTR -88[rbp]
	movsx	rax, ebx
	sub	rax, 1
	mov	QWORD PTR -56[rbp], rax
	movsx	rax, ebx
	mov	QWORD PTR -128[rbp], rax
	mov	QWORD PTR -120[rbp], 0
	movsx	rax, ebx
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, ebx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 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
.L4:
	cmp	rsp, rdx
	je	.L5
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L4
.L5:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L6
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L6:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -72[rbp], 0
	mov	DWORD PTR -76[rbp], 0
	mov	DWORD PTR -80[rbp], 0
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -80[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	add	DWORD PTR -76[rbp], eax
	add	DWORD PTR -80[rbp], 1
.L7:
	mov	eax, DWORD PTR -88[rbp]
	cmp	DWORD PTR -80[rbp], eax
	jl	.L8
	mov	edx, DWORD PTR -76[rbp]
	movsx	rax, edx
	imul	rax, rax, 1431655766
	shr	rax, 32
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	add	ecx, ecx
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	test	eax, eax
	jne	.L9
	mov	DWORD PTR -84[rbp], 0
	mov	eax, DWORD PTR -76[rbp]
	movsx	rdx, eax
	imul	rdx, rdx, 1431655766
	shr	rdx, 32
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -64[rbp], eax
	movsx	rax, ebx
	sal	rax, 2
	shr	rax, 2
	mov	DWORD PTR -60[rbp], eax
	mov	DWORD PTR -68[rbp], 0
	jmp	.L10
.L13:
	mov	rax, QWORD PTR -48[rbp]
	mov	edx, DWORD PTR -84[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	add	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	je	.L11
	cmp	DWORD PTR -68[rbp], 0
	jne	.L12
.L11:
	mov	DWORD PTR -68[rbp], 0
	add	DWORD PTR -72[rbp], 1
	add	DWORD PTR -84[rbp], 1
	jmp	.L10
.L12:
	add	DWORD PTR -84[rbp], 1
.L10:
	mov	eax, DWORD PTR -84[rbp]
	cmp	eax, DWORD PTR -60[rbp]
	jne	.L13
.L9:
	mov	eax, 2
	cmp	DWORD PTR -72[rbp], 2
	cmovge	eax, DWORD PTR -72[rbp]
	sub	eax, 2
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
.L3:
	mov	rsp, r12
	mov	rsi, QWORD PTR -40[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"145452576.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"0\000"
	.align	2
.LC2:
	.ascii	"%d\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 = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #56
	str	r0, [fp, #-64]
	str	r1, [fp, #-68]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	sub	r3, fp, #56
	mov	r1, r3
	ldr	r0, .L13+4
	bl	__isoc99_scanf
	ldr	r3, [fp, #-56]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L13+8
	bl	puts
	mov	r3, #0
	b	.L3
.L2:
	ldr	r4, [fp, #-56]
	sub	r3, r4, #1
	str	r3, [fp, #-32]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, r4
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L4
.L5:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L13+4
	bl	__isoc99_scanf
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-48]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-44]
	add	r3, r2, r3
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L4:
	ldr	r3, [fp, #-56]
	ldr	r2, [fp, #-48]
	cmp	r2, r3
	blt	.L5
	ldr	r1, [fp, #-44]
	ldr	r3, .L13+12
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L6
	mov	r3, #0
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-44]
	ldr	r2, .L13+12
	smull	r1, r2, r3, r2
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-24]
	mov	r3, r4
	lsl	r3, r3, #2
	lsr	r3, r3, #2
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L7
.L10:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-52]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	beq	.L8
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L9
.L8:
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
	b	.L7
.L9:
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L7:
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bne	.L10
.L6:
	ldr	r3, [fp, #-40]
	cmp	r3, #2
	movge	r3, r3
	movlt	r3, #2
	sub	r3, r3, #2
	mov	r1, r3
	ldr	r0, .L13+16
	bl	printf
	mov	r3, #0
.L3:
	mov	sp, r5
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	1431655766
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
