	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function listree_get_pos
_listree_get_pos:                       ## @listree_get_pos
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movl	(%rdi), %r9d
	leal	-1(%r9), %r10d
	movq	_NIL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %r12
	cmpq	%rax, %r12
	je	LBB0_1
## %bb.2:
	movq	_TF_PLUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_y_to_delta@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$24, %r12
	decl	%ebx
	movl	%ebx, %r10d
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %r12
	cmpq	%rax, %r12
	je	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r9d, %ebx
	subl	(%r12), %ebx
	movl	4(%r12), %r15d
	andl	$3, %r15d
	cmpl	%esi, 8(%r12)
	jg	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ecx, %ecx
	cmpl	%r8d, %r15d
	setne	%cl
	movq	24(%r12), %rdi
	addl	12(%rdi), %r13d
	addl	%ecx, %ebx
	addl	(%r11,%r15,4), %r13d
	addq	$16, %r12
	movl	%ebx, %r14d
	jmp	LBB0_8
LBB0_1:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
LBB0_9:
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	testl	%r14d, %r14d
	setns	%al
	movq	%rdx, %r15
	movq	%r10, %r12
	leal	(%r10,%rdx), %ecx
	cmpl	%ecx, %r14d
	setle	%cl
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	cmpl	%r9d, %r12d
	setl	%dl
	andb	%al, %dl
	andb	%cl, %dl
	movzbl	%dl, %edi
	callq	_assert
	movq	%r12, %rsi
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	incl	%esi
	decl	%r14d
	movq	8(%r8), %rax
	movl	%esi, %ecx
	subl	%r14d, %ecx
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movl	$-2, %ebx
	cmpl	$1, %ecx
	jg	LBB0_23
LBB0_11:
	movq	%r15, %rdi
	cmpl	$2, %ecx
	jl	LBB0_18
## %bb.12:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %esi
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	%esi, %ecx
	subl	%r14d, %ecx
	cmpl	$1, %ecx
	jle	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	leal	(%rsi,%r14), %ebx
	sarl	%ebx
	movslq	%ebx, %rcx
	cmpl	%edx, (%rax,%rcx,4)
	jg	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	jge	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%ebx, %r14d
	jmp	LBB0_17
LBB0_18:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_assert
	addl	%r13d, %r14d
	movl	%r14d, %ebx
	jmp	LBB0_23
LBB0_6:
	movq	_TF_MINUS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	xorl	%r15d, %eax
	xorl	%edi, %edi
	orl	%eax, %edx
	setne	%dil
	callq	_assert
	addl	%r13d, %ebx
	movq	24(%r12), %rax
	addl	12(%rax), %ebx
	xorl	%eax, %eax
	cmpl	(%r14), %r15d
	sete	%al
	subl	%eax, %ebx
	jmp	LBB0_23
LBB0_19:
	addl	%r13d, %ebx
	js	LBB0_20
## %bb.21:
	movq	16(%r8), %rax
	addl	12(%rax), %r12d
	xorl	%edi, %edi
	cmpl	%r12d, %ebx
	setl	%dil
	jmp	LBB0_22
LBB0_20:
	xorl	%edi, %edi
LBB0_22:
	callq	_assert
LBB0_23:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NIL,8,3                        ## @NIL
	.comm	_TF_MINUS,4,2                   ## @TF_MINUS
	.comm	_TF_PLUS,4,2                    ## @TF_PLUS
	.comm	_y_to_delta,8,3                 ## @y_to_delta
	.no_dead_strip	_listree_get_pos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function listree_get_pos
_listree_get_pos:                       ; @listree_get_pos
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w23, [x0]
	sub	w24, w23, #1
Lloh0:
	adrp	x8, _NIL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NIL@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x26, [x0, #16]
	cmp	x26, x8
	b.eq	LBB0_7
; %bb.1:
	mov	w25, #0
	mov	w22, #0
Lloh3:
	adrp	x9, _TF_PLUS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TF_PLUS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _y_to_delta@GOTPAGE
Lloh7:
	ldr	x10, [x10, _y_to_delta@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x11, x26, #24
	sub	w24, w27, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x26, [x11]
	cmp	x26, x8
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x26]
	sub	w27, w23, w11
	ldr	w11, [x26, #8]
	cmp	w11, w21
	b.gt	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w11, [x26, #4]
	and	x28, x11, #0x3
	b.eq	LBB0_19
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w28, w9
	cinc	w25, w27, ne
	ldr	x11, [x26, #24]
	ldr	w11, [x11, #12]
	ldr	w12, [x10, x28, lsl #2]
	add	w11, w11, w22
	add	w22, w11, w12
	add	x11, x26, #16
	b	LBB0_3
LBB0_7:
	mov	w22, #0
	mov	w25, #0
LBB0_8:
	cmp	w25, #0
	add	w8, w24, w19
	ccmp	w25, w8, #0, ge
	ccmp	w24, w23, #0, le
	cset	w0, lt
	bl	_assert
	add	w9, w24, #1
	sub	w24, w25, #1
	ldr	x8, [x20, #8]
	sub	w10, w9, w24
	cbnz	x8, LBB0_11
; %bb.9:
	cmp	w10, #1
	b.le	LBB0_11
; %bb.10:
	mov	w19, #-2
	b	LBB0_22
LBB0_11:
	cmp	w10, #2
	b.ge	LBB0_15
LBB0_12:
	mov	x0, x19
	bl	_assert
	add	w19, w24, w22
	b	LBB0_22
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	x9, x10
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	sub	w10, w9, w24
	cmp	w10, #1
	b.le	LBB0_12
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	add	w10, w9, w24
	asr	w10, w10, #1
	ldr	w11, [x8, w10, sxtw #2]
	cmp	w11, w21
	b.gt	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x24, x10
	b.lt	LBB0_14
; %bb.17:
	adds	w19, w10, w22
	b.mi	LBB0_20
; %bb.18:
	ldr	x8, [x20, #16]
	ldr	w8, [x8, #12]
	add	w8, w8, w23
	cmp	w19, w8
	cset	w0, lt
	b	LBB0_21
LBB0_19:
	cmp	w19, #0
Lloh9:
	adrp	x19, _TF_MINUS@GOTPAGE
Lloh10:
	ldr	x19, [x19, _TF_MINUS@GOTPAGEOFF]
	ldr	w8, [x19]
	ccmp	w28, w8, #0, eq
	cset	w0, ne
	bl	_assert
	ldr	x8, [x26, #24]
	ldr	w8, [x8, #12]
	add	w9, w27, w22
	add	w8, w9, w8
	ldr	w9, [x19]
	cmp	w28, w9
	cset	w9, eq
	sub	w19, w8, w9
	b	LBB0_22
LBB0_20:
	mov	w0, #0
LBB0_21:
	bl	_assert
LBB0_22:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NIL,8,3                        ; @NIL
	.comm	_TF_MINUS,4,2                   ; @TF_MINUS
	.comm	_TF_PLUS,4,2                    ; @TF_PLUS
	.comm	_y_to_delta,8,3                 ; @y_to_delta
	.no_dead_strip	_listree_get_pos
.subsections_via_symbols
