	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_List_Insert               ## -- Begin function HPDF_List_Insert
	.p2align	4, 0x90
_HPDF_List_Insert:                      ## @HPDF_List_Insert
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %rbx
	callq	_HPDF_List_Find
	movl	%eax, %r12d
	movq	8(%rbx), %rax
	movslq	(%rbx), %rcx
	movq	-8(%rax,%rcx,8), %r15
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	testl	%r12d, %r12d
	js	LBB0_6
## %bb.1:
	movl	(%rbx), %eax
	addl	$-2, %eax
	cmpl	%r12d, %eax
	jge	LBB0_3
## %bb.2:
	movl	%r12d, %eax
	jmp	LBB0_5
LBB0_6:
	movq	_HPDF_ITEM_NOT_FOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movslq	%eax, %rcx
	movl	%r12d, %eax
	incq	%rcx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rdx
	movq	-8(%rdx,%rcx,8), %rsi
	movq	%rsi, (%rdx,%rcx,8)
	decq	%rcx
	cmpq	%rax, %rcx
	jg	LBB0_4
LBB0_5:
	movq	8(%rbx), %rcx
	movq	%r14, (%rcx,%rax,8)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_List_Add                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_List_Insert\n"

	.comm	_HPDF_ITEM_NOT_FOUND,4,2        ## @HPDF_ITEM_NOT_FOUND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_List_Insert               ; -- Begin function HPDF_List_Insert
	.p2align	2
_HPDF_List_Insert:                      ; @HPDF_List_Insert
	.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, x2
	mov	x20, x0
	bl	_HPDF_List_Find
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldrsw	x9, [x20]
	add	x8, x8, x9, lsl #3
	ldur	x21, [x8, #-8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	tbnz	w22, #31, LBB0_3
; %bb.1:
	ldr	w8, [x20]
	sub	w8, w8, #2
	cmp	w8, w22
	b.ge	LBB0_4
; %bb.2:
	mov	w8, w22
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _HPDF_ITEM_NOT_FOUND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HPDF_ITEM_NOT_FOUND@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	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_4:
	sxtw	x9, w8
	mov	w8, w22
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20, #8]
	add	x10, x10, x9, lsl #3
	ldr	x11, [x10]
	str	x11, [x10, #8]
	sub	x10, x9, #1
	cmp	x9, x8
	mov	x9, x10
	b.gt	LBB0_5
LBB0_6:
	ldr	x9, [x20, #8]
	str	x19, [x9, x8, lsl #3]
	mov	x0, x20
	mov	x1, x21
	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
	b	_HPDF_List_Add
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_List_Insert\n"

	.comm	_HPDF_ITEM_NOT_FOUND,4,2        ; @HPDF_ITEM_NOT_FOUND
.subsections_via_symbols
