	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_history                    ## -- Begin function get_history
	.p2align	4, 0x90
_get_history:                           ## @get_history
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movl	%edx, %r15d
	movl	%esi, %r14d
	callq	_get_user
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %rcx
	movl	(%rax), %esi
	testl	%esi, %esi
	je	LBB0_10
## %bb.2:
	xorl	%eax, %eax
	subl	%r14d, %esi
	je	LBB0_11
## %bb.3:
	movq	_HISTORY_EVENTS@GOTPCREL(%rip), %r8
	movl	(%r8), %edx
	cmpl	%edx, %esi
	ja	LBB0_10
## %bb.4:
	movq	8(%rcx), %r9
	testq	%r9, %r9
	je	LBB0_10
## %bb.5:
	cmpl	%r15d, %esi
	movl	%esi, %eax
	cmovgl	%r15d, %eax
	testl	%r15d, %r15d
	cmovlel	%esi, %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.6:
	leal	1(%r14), %esi
	decl	%edx
	andl	%esi, %edx
	movl	%edx, %esi
	addl	%edx, %esi
	addl	%edx, %edx
	incl	%edx
	movslq	%edx, %rdx
	movl	(%r9,%rdx,4), %ecx
	movslq	%esi, %rdx
	movl	(%r9,%rdx,4), %edx
	movl	%ecx, %esi
	orl	%edx, %esi
	je	LBB0_10
## %bb.7:
	addl	$2, %r14d
	movl	%eax, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %edi
	shrl	$24, %edi
	movl	%edi, (%rbx)
	movl	%edx, 4(%rbx)
	andl	$16777215, %ecx                 ## imm = 0xFFFFFF
	movl	%ecx, 8(%rbx)
	cmpl	$2, %esi
	jl	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	decl	%esi
	movl	(%r8), %ecx
	decl	%ecx
	andl	%r14d, %ecx
	leal	(%rcx,%rcx), %edx
	incl	%edx
	movl	%ecx, %edi
	addl	%ecx, %edi
	movslq	%edx, %rcx
	movl	(%r9,%rcx,4), %ecx
	movslq	%edi, %rdx
	movl	(%r9,%rdx,4), %edx
	incl	%r14d
	addq	$12, %rbx
	movl	%ecx, %edi
	orl	%edx, %edi
	jne	LBB0_8
LBB0_10:
	movl	$-1, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HISTORY_EVENTS,4,2             ## @HISTORY_EVENTS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_history                    ; -- Begin function get_history
	.p2align	2
_get_history:                           ; @get_history
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	bl	_get_user
	cbz	x0, LBB0_11
; %bb.1:
	ldr	w8, [x0]
	cbz	w8, LBB0_11
; %bb.2:
	subs	w10, w8, w20
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_12
LBB0_4:
Lloh0:
	adrp	x8, _HISTORY_EVENTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HISTORY_EVENTS@GOTPAGEOFF]
	ldr	w11, [x8]
	cmp	w10, w11
	b.hi	LBB0_11
; %bb.5:
	ldr	x9, [x0, #8]
	cbz	x9, LBB0_11
; %bb.6:
	cmp	w10, w21
	ccmp	w21, #0, #4, gt
	csel	w10, w21, w10, gt
	cmp	w10, #1
	b.lt	LBB0_13
; %bb.7:
	add	w12, w20, #1
	sub	w11, w11, #1
	and	w11, w11, w12
	lsl	w12, w11, #1
	add	x12, x9, w12, sxtw #2
	ldr	w13, [x12, #4]
	sbfiz	x11, x11, #3, #32
	ldr	w14, [x9, x11]
	orr	w11, w13, w14
	cbz	w11, LBB0_11
; %bb.8:
	add	w11, w20, #2
	mov	x12, x10
	mov	w0, #-1
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w15, w13, #24
	stp	w15, w14, [x19]
	and	w13, w13, #0xffffff
	str	w13, [x19, #8]
	cmp	w12, #2
	b.lt	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sub	w12, w12, #1
	ldr	w13, [x8]
	sub	w13, w13, #1
	and	w13, w13, w11
	lsl	w15, w13, #1
	sbfiz	x13, x13, #3, #32
	ldr	w14, [x9, x13]
	add	x13, x9, w15, sxtw #2
	ldr	w13, [x13, #4]
	add	w11, w11, #1
	add	x19, x19, #12
	orr	w15, w13, w14
	cbnz	w15, LBB0_9
	b	LBB0_12
LBB0_11:
	mov	w0, #-1
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x0, x10
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_HISTORY_EVENTS,4,2             ; @HISTORY_EVENTS
.subsections_via_symbols
