	.file	"339090.c"
	.intel_syntax noprefix
	.text
	.globl	binsearch
	.type	binsearch, @function
binsearch:
.LFB0:
	.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -24[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -24[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L2
.L6:
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	jge	.L3
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L4
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	jmp	.L2
.L4:
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L5
.L2:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L6
	mov	eax, -1
.L5:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binsearch, .-binsearch
	.globl	binsearch2
	.type	binsearch2, @function
binsearch2:
.LFB1:
	.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	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -24[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -24[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	jge	.L9
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
.L10:
	mov	edx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -8[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
.L8:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L11
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	jne	.L12
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L13
.L12:
	mov	eax, -1
.L13:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	binsearch2, .-binsearch2
	.section	.rodata
.LC0:
	.string	"Elem %d not found.\n"
.LC1:
	.string	"%d found at index %d.\n"
	.align 8
.LC2:
	.string	"binsearch() took %lu clocks (%lu seconds)\n"
	.align 8
.LC3:
	.string	"binsearch2() took %lu clocks (%lu seconds)\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	r11, -77824[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 2224
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -80028[rbp], -1
	mov	DWORD PTR -80032[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -80032[rbp]
	cdqe
	mov	edx, DWORD PTR -80032[rbp]
	mov	DWORD PTR -80016[rbp+rax*4], edx
	add	DWORD PTR -80032[rbp], 1
.L15:
	cmp	DWORD PTR -80032[rbp], 19999
	jle	.L16
	mov	DWORD PTR -80032[rbp], 0
	call	clock@PLT
	mov	QWORD PTR -80024[rbp], rax
	jmp	.L17
.L18:
	lea	rcx, -80016[rbp]
	mov	eax, DWORD PTR -80028[rbp]
	mov	edx, 20000
	mov	rsi, rcx
	mov	edi, eax
	call	binsearch
	mov	DWORD PTR -80036[rbp], eax
	add	DWORD PTR -80032[rbp], 1
.L17:
	cmp	DWORD PTR -80032[rbp], 99999
	jle	.L18
	call	clock@PLT
	sub	rax, QWORD PTR -80024[rbp]
	mov	QWORD PTR -80024[rbp], rax
	cmp	DWORD PTR -80036[rbp], 0
	jns	.L19
	mov	eax, DWORD PTR -80028[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L20
.L19:
	mov	edx, DWORD PTR -80036[rbp]
	mov	eax, DWORD PTR -80028[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L20:
	mov	rax, QWORD PTR -80024[rbp]
	movabs	rdx, 4835703278458516699
	mul	rdx
	shr	rdx, 18
	mov	rax, QWORD PTR -80024[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -80032[rbp], 0
	call	clock@PLT
	mov	QWORD PTR -80024[rbp], rax
	jmp	.L21
.L22:
	lea	rcx, -80016[rbp]
	mov	eax, DWORD PTR -80028[rbp]
	mov	edx, 20000
	mov	rsi, rcx
	mov	edi, eax
	call	binsearch2
	mov	DWORD PTR -80036[rbp], eax
	add	DWORD PTR -80032[rbp], 1
.L21:
	cmp	DWORD PTR -80032[rbp], 99999
	jle	.L22
	call	clock@PLT
	sub	rax, QWORD PTR -80024[rbp]
	mov	QWORD PTR -80024[rbp], rax
	cmp	DWORD PTR -80036[rbp], 0
	jns	.L23
	mov	eax, DWORD PTR -80028[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L24
.L23:
	mov	edx, DWORD PTR -80036[rbp]
	mov	eax, DWORD PTR -80028[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
.L24:
	mov	rax, QWORD PTR -80024[rbp]
	movabs	rdx, 4835703278458516699
	mul	rdx
	shr	rdx, 18
	mov	rax, QWORD PTR -80024[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"339090.c"
	.text
	.align	2
	.global	binsearch
	.syntax unified
	.arm
	.fpu softvfp
	.type	binsearch, %function
binsearch:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L2
.L6:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bge	.L3
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L2
.L3:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	ble	.L4
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L2
.L4:
	ldr	r3, [fp, #-8]
	b	.L5
.L2:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L6
	mvn	r3, #0
.L5:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binsearch, .-binsearch
	.align	2
	.global	binsearch2
	.syntax unified
	.arm
	.fpu softvfp
	.type	binsearch2, %function
binsearch2:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L8
.L11:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bge	.L9
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L10
.L9:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L10:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
.L8:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L11
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bne	.L12
	ldr	r3, [fp, #-8]
	b	.L13
.L12:
	mvn	r3, #0
.L13:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binsearch2, .-binsearch2
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Elem %d not found.\012\000"
	.align	2
.LC1:
	.ascii	"%d found at index %d.\012\000"
	.align	2
.LC2:
	.ascii	"binsearch() took %lu clocks (%lu seconds)\012\000"
	.align	2
.LC3:
	.ascii	"binsearch2() took %lu clocks (%lu seconds)\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80024
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #79872
	sub	sp, sp, #156
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	mvn	r3, #0
	str	r3, [r2, #-2188]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2192]
	b	.L15
.L16:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	lsl	r3, r3, #2
	add	r3, r2, r3
	sub	r2, fp, #77824
	sub	r2, r2, #12
	ldr	r2, [r2, #-2192]
	str	r2, [r3, #-2180]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	add	r3, r3, #1
	str	r3, [r2, #-2192]
.L15:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	ldr	r2, .L27+4
	cmp	r3, r2
	ble	.L16
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2192]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r4, r3
	bl	clock
	str	r0, [r4, #-2184]
	b	.L17
.L18:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #79872
	sub	r3, r3, #12
	sub	r3, r3, #132
	sub	r2, fp, #77824
	sub	r2, r2, #12
	mov	r0, r2
	ldr	r2, .L27+8
	mov	r1, r3
	ldr	r0, [r0, #-2188]
	bl	binsearch
	str	r0, [r4, #-2196]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	add	r3, r3, #1
	str	r3, [r2, #-2192]
.L17:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	ldr	r2, .L27+12
	cmp	r3, r2
	blt	.L18
	bl	clock
	mov	r2, r0
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2184]
	sub	r3, r2, r3
	str	r3, [r1, #-2184]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2196]
	cmp	r3, #0
	bge	.L19
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r1, [r3, #-2188]
	ldr	r0, .L27+16
	bl	printf
	b	.L20
.L19:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r2, [r2, #-2196]
	ldr	r1, [r3, #-2188]
	ldr	r0, .L27+20
	bl	printf
.L20:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r1, [r3, #-2184]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2184]
	ldr	r2, .L27+24
	umull	r0, r3, r2, r3
	lsr	r3, r3, #18
	mov	r2, r3
	ldr	r0, .L27+28
	bl	printf
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-2192]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r4, r3
	bl	clock
	str	r0, [r4, #-2184]
	b	.L21
.L22:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #79872
	sub	r3, r3, #12
	sub	r3, r3, #132
	sub	r2, fp, #77824
	sub	r2, r2, #12
	mov	r0, r2
	ldr	r2, .L27+8
	mov	r1, r3
	ldr	r0, [r0, #-2188]
	bl	binsearch2
	str	r0, [r4, #-2196]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	add	r3, r3, #1
	str	r3, [r2, #-2192]
.L21:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2192]
	ldr	r2, .L27+12
	cmp	r3, r2
	blt	.L22
	bl	clock
	mov	r2, r0
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2184]
	sub	r3, r2, r3
	str	r3, [r1, #-2184]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2196]
	cmp	r3, #0
	bge	.L23
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r1, [r3, #-2188]
	ldr	r0, .L27+16
	bl	printf
	b	.L24
.L23:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r2, [r2, #-2196]
	ldr	r1, [r3, #-2188]
	ldr	r0, .L27+20
	bl	printf
.L24:
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r1, [r3, #-2184]
	sub	r3, fp, #77824
	sub	r3, r3, #12
	ldr	r3, [r3, #-2184]
	ldr	r2, .L27+24
	umull	r0, r3, r2, r3
	lsr	r3, r3, #18
	mov	r2, r3
	ldr	r0, .L27+32
	bl	printf
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC4
	.word	19999
	.word	20000
	.word	100000
	.word	.LC0
	.word	.LC1
	.word	1125899907
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
