	.file	"144037.c"
	.intel_syntax noprefix
	.text
	.globl	binary_search
	.type	binary_search, @function
binary_search:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -28[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 -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L3
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jle	.L5
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
.L2:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L6
	mov	eax, -1
.L4:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	binary_search, .-binary_search
	.globl	binary_search_first
	.type	binary_search_first, @function
binary_search_first:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L8
.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
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jg	.L9
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
.L8:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L10
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L11
	mov	eax, DWORD PTR -12[rbp]
	jmp	.L12
.L11:
	mov	eax, -1
.L12:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	binary_search_first, .-binary_search_first
	.globl	binary_search_last
	.type	binary_search_last, @function
binary_search_last:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L14
.L16:
	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 -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L15
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	jmp	.L14
.L15:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
.L14:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L16
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L17
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L18
.L17:
	mov	eax, -1
.L18:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	binary_search_last, .-binary_search_last
	.globl	binary_search_first_r
	.type	binary_search_first_r, @function
binary_search_first_r:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L20
	mov	eax, -1
	jmp	.L21
.L20:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L22
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	binary_search_first_r
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	je	.L23
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L21
.L23:
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L21
.L22:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L25
	mov	eax, -1
	jmp	.L21
.L25:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jle	.L26
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -4[rbp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	binary_search_first_r
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	je	.L27
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	add	DWORD PTR -8[rbp], eax
	jmp	.L27
.L26:
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	binary_search_first_r
	mov	DWORD PTR -8[rbp], eax
.L27:
	mov	eax, DWORD PTR -8[rbp]
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	binary_search_first_r, .-binary_search_first_r
	.globl	binary_search_last_r
	.type	binary_search_last_r, @function
binary_search_last_r:
.LFB10:
	.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L29
	mov	eax, -1
	jmp	.L30
.L29:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jne	.L31
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -8[rbp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	binary_search_last_r
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	je	.L32
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	add	DWORD PTR -8[rbp], eax
.L32:
	mov	eax, DWORD PTR -8[rbp]
	jmp	.L30
.L31:
	cmp	DWORD PTR -8[rbp], 0
	jne	.L33
	mov	eax, -1
	jmp	.L30
.L33:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jle	.L34
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -8[rbp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	binary_search_last_r
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	je	.L35
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	add	DWORD PTR -4[rbp], eax
	jmp	.L35
.L34:
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -8[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	binary_search_last_r
	mov	DWORD PTR -4[rbp], eax
.L35:
	mov	eax, DWORD PTR -4[rbp]
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	binary_search_last_r, .-binary_search_last_r
	.globl	binary_search_first_bigger
	.type	binary_search_first_bigger, @function
binary_search_first_bigger:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L37
.L42:
	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 -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jg	.L38
	cmp	DWORD PTR -4[rbp], 0
	je	.L39
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jle	.L40
.L39:
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L41
.L40:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L37
.L38:
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
.L37:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L42
	mov	eax, -1
.L41:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	binary_search_first_bigger, .-binary_search_first_bigger
	.globl	binary_search_first_bigger_r
	.type	binary_search_first_bigger_r, @function
binary_search_first_bigger_r:
.LFB12:
	.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L44
	mov	eax, -1
	jmp	.L45
.L44:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jg	.L46
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	binary_search_first_bigger_r
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	jne	.L47
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L47
.L46:
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -4[rbp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	binary_search_first_bigger_r
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	je	.L47
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	add	DWORD PTR -8[rbp], eax
.L47:
	mov	eax, DWORD PTR -8[rbp]
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	binary_search_first_bigger_r, .-binary_search_first_bigger_r
	.globl	binary_search_last_smaller
	.type	binary_search_last_smaller, @function
binary_search_last_smaller:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	jmp	.L49
.L54:
	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 -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L50
	cmp	DWORD PTR -4[rbp], 0
	je	.L51
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jge	.L52
.L51:
	mov	eax, DWORD PTR -4[rbp]
	jmp	.L53
.L52:
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	mov	DWORD PTR -12[rbp], eax
	jmp	.L49
.L50:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
.L49:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jle	.L54
	mov	eax, -1
.L53:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	binary_search_last_smaller, .-binary_search_last_smaller
	.globl	binary_search_last_smaller_r
	.type	binary_search_last_smaller_r, @function
binary_search_last_smaller_r:
.LFB14:
	.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	eax, DWORD PTR -28[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	jg	.L56
	mov	eax, -1
	jmp	.L57
.L56:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -32[rbp], eax
	jl	.L58
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, DWORD PTR -4[rbp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -32[rbp]
	mov	edx, eax
	mov	rdi, rcx
	call	binary_search_last_smaller_r
	mov	DWORD PTR -8[rbp], eax
	cmp	DWORD PTR -8[rbp], -1
	je	.L59
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	add	DWORD PTR -8[rbp], eax
	jmp	.L60
.L59:
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L60
.L58:
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	binary_search_last_smaller_r
	mov	DWORD PTR -8[rbp], eax
.L60:
	mov	eax, DWORD PTR -8[rbp]
.L57:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	binary_search_last_smaller_r, .-binary_search_last_smaller_r
	.section	.rodata
.LC0:
	.string	"Test Array:"
.LC1:
	.string	"%8d"
.LC2:
	.string	"first 19 at %d\n"
.LC3:
	.string	"19 not in arr "
.LC4:
	.string	"last 19 at %d\n"
.LC5:
	.string	"first bigger 12 at %d\n"
.LC6:
	.string	"12 not in arr "
.LC7:
	.string	"last smaller 12 at %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 1
	mov	DWORD PTR -44[rbp], 4
	mov	DWORD PTR -40[rbp], 5
	mov	DWORD PTR -36[rbp], 9
	mov	DWORD PTR -32[rbp], 12
	mov	DWORD PTR -28[rbp], 14
	mov	DWORD PTR -24[rbp], 19
	mov	DWORD PTR -20[rbp], 19
	mov	DWORD PTR -16[rbp], 31
	mov	DWORD PTR -12[rbp], 36
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	DWORD PTR -52[rbp], 0
	jmp	.L62
.L63:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	mov	eax, DWORD PTR -48[rbp+rax*4]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -52[rbp], 1
.L62:
	cmp	DWORD PTR -52[rbp], 9
	jle	.L63
	mov	edi, 10
	call	putchar@PLT
	lea	rax, -48[rbp]
	mov	edx, 19
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_first
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L64
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L65
.L64:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L65:
	lea	rax, -48[rbp]
	mov	edx, 19
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_first_r
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L66
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L67
.L66:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L67:
	lea	rax, -48[rbp]
	mov	edx, 19
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_last
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L68
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L69
.L68:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L69:
	lea	rax, -48[rbp]
	mov	edx, 19
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_last_r
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L70
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L71
.L70:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L71:
	lea	rax, -48[rbp]
	mov	edx, 12
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_first_bigger
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L72
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L73
.L72:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L73:
	lea	rax, -48[rbp]
	mov	edx, 12
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_first_bigger_r
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L74
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L75
.L74:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L75:
	lea	rax, -48[rbp]
	mov	edx, 12
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_last_smaller
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L76
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L77
.L76:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L77:
	lea	rax, -48[rbp]
	mov	edx, 12
	mov	esi, 10
	mov	rdi, rax
	call	binary_search_last_smaller_r
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L78
	mov	eax, DWORD PTR -52[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L79
.L78:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L79:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L81
	call	__stack_chk_fail@PLT
.L81:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	"144037.c"
	.text
	.align	2
	.global	binary_search
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search, %function
binary_search:
	@ 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, #-28]
	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, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bne	.L3
	ldr	r3, [fp, #-8]
	b	.L4
.L3:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	ble	.L5
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L2
.L5:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L6
	mvn	r3, #0
.L4:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binary_search, .-binary_search
	.align	2
	.global	binary_search_first
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_first, %function
binary_search_first:
	@ 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, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L8
.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]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bgt	.L9
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L8
.L9:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L8:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L10
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bne	.L11
	ldr	r3, [fp, #-16]
	b	.L12
.L11:
	mvn	r3, #0
.L12:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binary_search_first, .-binary_search_first
	.align	2
	.global	binary_search_last
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_last, %function
binary_search_last:
	@ 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, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L14
.L16:
	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, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L15
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L14
.L15:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L14:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L16
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bne	.L17
	ldr	r3, [fp, #-12]
	b	.L18
.L17:
	mvn	r3, #0
.L18:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binary_search_last, .-binary_search_last
	.align	2
	.global	binary_search_first_r
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_first_r, %function
binary_search_first_r:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L20
	mvn	r3, #0
	b	.L21
.L20:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bne	.L22
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	binary_search_first_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L23
	ldr	r3, [fp, #-12]
	b	.L21
.L23:
	ldr	r3, [fp, #-8]
	b	.L21
.L22:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L25
	mvn	r3, #0
	b	.L21
.L25:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	ble	.L26
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	bl	binary_search_first_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L27
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	b	.L27
.L26:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	binary_search_first_r
	str	r0, [fp, #-12]
.L27:
	ldr	r3, [fp, #-12]
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	binary_search_first_r, .-binary_search_first_r
	.align	2
	.global	binary_search_last_r
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_last_r, %function
binary_search_last_r:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L29
	mvn	r3, #0
	b	.L30
.L29:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bne	.L31
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	bl	binary_search_last_r
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	beq	.L32
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L32:
	ldr	r3, [fp, #-12]
	b	.L30
.L31:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L33
	mvn	r3, #0
	b	.L30
.L33:
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	ble	.L34
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	bl	binary_search_last_r
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	beq	.L35
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	b	.L35
.L34:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	binary_search_last_r
	str	r0, [fp, #-8]
.L35:
	ldr	r3, [fp, #-8]
.L30:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	binary_search_last_r, .-binary_search_last_r
	.align	2
	.global	binary_search_first_bigger
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_first_bigger, %function
binary_search_first_bigger:
	@ 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, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L37
.L42:
	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, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bgt	.L38
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L39
	ldr	r3, [fp, #-8]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	ble	.L40
.L39:
	ldr	r3, [fp, #-8]
	b	.L41
.L40:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L37
.L38:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L37:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L42
	mvn	r3, #0
.L41:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binary_search_first_bigger, .-binary_search_first_bigger
	.align	2
	.global	binary_search_first_bigger_r
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_first_bigger_r, %function
binary_search_first_bigger_r:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L44
	mvn	r3, #0
	b	.L45
.L44:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bgt	.L46
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	binary_search_first_bigger_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L47
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-12]
	b	.L47
.L46:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	bl	binary_search_first_bigger_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L47
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L47:
	ldr	r3, [fp, #-12]
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	binary_search_first_bigger_r, .-binary_search_first_bigger_r
	.align	2
	.global	binary_search_last_smaller
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_last_smaller, %function
binary_search_last_smaller:
	@ 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, #-28]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L49
.L54:
	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, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L50
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L51
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	bge	.L52
.L51:
	ldr	r3, [fp, #-8]
	b	.L53
.L52:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	b	.L49
.L50:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
.L49:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	ble	.L54
	mvn	r3, #0
.L53:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	binary_search_last_smaller, .-binary_search_last_smaller
	.align	2
	.global	binary_search_last_smaller_r
	.syntax unified
	.arm
	.fpu softvfp
	.type	binary_search_last_smaller_r, %function
binary_search_last_smaller_r:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L56
	mvn	r3, #0
	b	.L57
.L56:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L58
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	bl	binary_search_last_smaller_r
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	beq	.L59
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
	b	.L60
.L59:
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-12]
	b	.L60
.L58:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-16]
	bl	binary_search_last_smaller_r
	str	r0, [fp, #-12]
.L60:
	ldr	r3, [fp, #-12]
.L57:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	binary_search_last_smaller_r, .-binary_search_last_smaller_r
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Test Array:\000"
	.align	2
.LC2:
	.ascii	"%8d\000"
	.align	2
.LC3:
	.ascii	"first 19 at %d\012\000"
	.align	2
.LC4:
	.ascii	"19 not in arr \000"
	.align	2
.LC5:
	.ascii	"last 19 at %d\012\000"
	.align	2
.LC6:
	.ascii	"first bigger 12 at %d\012\000"
	.align	2
.LC7:
	.ascii	"12 not in arr \000"
	.align	2
.LC8:
	.ascii	"last smaller 12 at %d\012\000"
	.align	2
.LC0:
	.word	1
	.word	4
	.word	5
	.word	9
	.word	12
	.word	14
	.word	19
	.word	19
	.word	31
	.word	36
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L82
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L82+4
	sub	ip, fp, #48
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	ldr	r0, .L82+8
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L62
.L63:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-44]
	mov	r1, r3
	ldr	r0, .L82+12
	bl	printf
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L62:
	ldr	r3, [fp, #-52]
	cmp	r3, #9
	ble	.L63
	mov	r0, #10
	bl	putchar
	sub	r3, fp, #48
	mov	r2, #19
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_first
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L64
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+16
	bl	printf
	b	.L65
.L64:
	ldr	r0, .L82+20
	bl	puts
.L65:
	sub	r3, fp, #48
	mov	r2, #19
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_first_r
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L66
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+16
	bl	printf
	b	.L67
.L66:
	ldr	r0, .L82+20
	bl	puts
.L67:
	sub	r3, fp, #48
	mov	r2, #19
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_last
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L68
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+24
	bl	printf
	b	.L69
.L68:
	ldr	r0, .L82+20
	bl	puts
.L69:
	sub	r3, fp, #48
	mov	r2, #19
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_last_r
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L70
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+24
	bl	printf
	b	.L71
.L70:
	ldr	r0, .L82+20
	bl	puts
.L71:
	sub	r3, fp, #48
	mov	r2, #12
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_first_bigger
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L72
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+28
	bl	printf
	b	.L73
.L72:
	ldr	r0, .L82+32
	bl	puts
.L73:
	sub	r3, fp, #48
	mov	r2, #12
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_first_bigger_r
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L74
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+28
	bl	printf
	b	.L75
.L74:
	ldr	r0, .L82+32
	bl	puts
.L75:
	sub	r3, fp, #48
	mov	r2, #12
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_last_smaller
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L76
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+36
	bl	printf
	b	.L77
.L76:
	ldr	r0, .L82+32
	bl	puts
.L77:
	sub	r3, fp, #48
	mov	r2, #12
	mov	r1, #10
	mov	r0, r3
	bl	binary_search_last_smaller_r
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	beq	.L78
	ldr	r1, [fp, #-52]
	ldr	r0, .L82+36
	bl	printf
	b	.L79
.L78:
	ldr	r0, .L82+32
	bl	puts
.L79:
	mov	r3, #0
	ldr	r2, .L82
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L81
	bl	__stack_chk_fail
.L81:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L83:
	.align	2
.L82:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
