	.file	"57290.c"
	.intel_syntax noprefix
	.text
	.globl	findLucky
	.type	findLucky, @function
findLucky:
.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, 1072
	mov	QWORD PTR -1064[rbp], rdi
	mov	DWORD PTR -1068[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdx, -1040[rbp]
	mov	eax, 0
	mov	ecx, 128
	mov	rdi, rdx
	rep stosq
	mov	DWORD PTR -1052[rbp], 0
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -1052[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -1064[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	movsx	rdx, eax
	movzx	edx, WORD PTR -1040[rbp+rdx*2]
	add	edx, 1
	cdqe
	mov	WORD PTR -1040[rbp+rax*2], dx
	add	DWORD PTR -1052[rbp], 1
.L2:
	mov	eax, DWORD PTR -1052[rbp]
	cmp	eax, DWORD PTR -1068[rbp]
	jl	.L3
	mov	DWORD PTR -1048[rbp], -1
	mov	DWORD PTR -1044[rbp], 1
	jmp	.L4
.L6:
	mov	eax, DWORD PTR -1044[rbp]
	cdqe
	movzx	eax, WORD PTR -1040[rbp+rax*2]
	cwde
	cmp	DWORD PTR -1044[rbp], eax
	jne	.L5
	mov	eax, DWORD PTR -1048[rbp]
	cmp	DWORD PTR -1044[rbp], eax
	cmovge	eax, DWORD PTR -1044[rbp]
	mov	DWORD PTR -1048[rbp], eax
.L5:
	add	DWORD PTR -1044[rbp], 1
.L4:
	cmp	DWORD PTR -1044[rbp], 500
	jle	.L6
	mov	eax, DWORD PTR -1048[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	findLucky, .-findLucky
	.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	"57290.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	findLucky
	.syntax unified
	.arm
	.fpu softvfp
	.type	findLucky, %function
findLucky:
	@ args = 0, pretend = 0, frame = 1048
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	sub	sp, sp, #8
	str	r0, [fp, #-1048]
	str	r1, [fp, #-1052]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-1044]
	b	.L2
.L3:
	ldr	r3, [fp, #-1044]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1048]
	add	r3, r2, r3
	ldr	r2, [r3]
	sub	r3, fp, #4
	sub	r3, r3, #1024
	sub	r3, r3, #4
	lsl	r1, r2, #1
	add	r3, r3, r1
	ldrsh	r3, [r3]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	add	r3, r3, #1
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #16
	asr	r1, r3, #16
	sub	r3, fp, #4
	sub	r3, r3, #1024
	sub	r3, r3, #4
	lsl	r2, r2, #1
	add	r3, r3, r2
	strh	r1, [r3]	@ movhi
	ldr	r3, [fp, #-1044]
	add	r3, r3, #1
	str	r3, [fp, #-1044]
.L2:
	ldr	r2, [fp, #-1044]
	ldr	r3, [fp, #-1052]
	cmp	r2, r3
	blt	.L3
	mvn	r3, #0
	str	r3, [fp, #-1040]
	mov	r3, #1
	str	r3, [fp, #-1036]
	b	.L4
.L6:
	sub	r3, fp, #4
	sub	r3, r3, #1024
	sub	r3, r3, #4
	ldr	r2, [fp, #-1036]
	lsl	r2, r2, #1
	add	r3, r3, r2
	ldrsh	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-1036]
	cmp	r3, r2
	bne	.L5
	ldr	r2, [fp, #-1040]
	ldr	r3, [fp, #-1036]
	cmp	r2, r3
	movge	r3, r2
	movlt	r3, r3
	str	r3, [fp, #-1040]
.L5:
	ldr	r3, [fp, #-1036]
	add	r3, r3, #1
	str	r3, [fp, #-1036]
.L4:
	ldr	r3, [fp, #-1036]
	cmp	r3, #500
	ble	.L6
	ldr	r3, [fp, #-1040]
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.size	findLucky, .-findLucky
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
