	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Page_InsertBefore         ## -- Begin function HPDF_Page_InsertBefore
	.p2align	4, 0x90
_HPDF_Page_InsertBefore:                ## @HPDF_Page_InsertBefore
	.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	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	(%rbx), %rax
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.6:
	movq	_HPDF_OCLASS_DICT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_HPDF_Dict_GetItem
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movl	8(%r15), %edi
	movq	_HPDF_PAGE_CANNOT_SET_PARENT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %esi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_SetError                  ## TAILCALL
LBB0_1:
	movq	_HPDF_INVALID_PARAMETER@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_HPDF_PAGE_CANNOT_SET_PARENT@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_HPDF_Dict_Add
	movq	_HPDF_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.10:
	movq	_HPDF_OCLASS_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_HPDF_Dict_GetItem
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	(%r14), %rcx
	movq	%r15, (%rcx)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Array_Insert              ## TAILCALL
LBB0_11:
	movl	8(%r15), %edi
	movq	_HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Page_InsertBefore\n"

	.comm	_HPDF_INVALID_PARAMETER,4,2     ## @HPDF_INVALID_PARAMETER
	.comm	_HPDF_PAGE_CANNOT_SET_PARENT,4,2 ## @HPDF_PAGE_CANNOT_SET_PARENT
L_.str.1:                               ## @.str.1
	.asciz	"Parent"

	.comm	_HPDF_OCLASS_DICT,4,2           ## @HPDF_OCLASS_DICT
	.comm	_HPDF_OK,4,2                    ## @HPDF_OK
L_.str.2:                               ## @.str.2
	.asciz	"Kids"

	.comm	_HPDF_OCLASS_ARRAY,4,2          ## @HPDF_OCLASS_ARRAY
	.comm	_HPDF_PAGES_MISSING_KIDS_ENTRY,4,2 ## @HPDF_PAGES_MISSING_KIDS_ENTRY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Page_InsertBefore         ; -- Begin function HPDF_Page_InsertBefore
	.p2align	2
_HPDF_Page_InsertBefore:                ; @HPDF_Page_InsertBefore
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	cbz	x20, LBB0_5
; %bb.1:
	ldr	x8, [x20]
	ldr	x21, [x8]
	cbz	x21, LBB0_6
; %bb.2:
Lloh2:
	adrp	x8, _HPDF_OCLASS_DICT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HPDF_OCLASS_DICT@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_HPDF_Dict_GetItem
	cbz	x0, LBB0_9
; %bb.3:
	ldr	w0, [x21, #8]
Lloh7:
	adrp	x8, _HPDF_PAGE_CANNOT_SET_PARENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HPDF_PAGE_CANNOT_SET_PARENT@GOTPAGEOFF]
LBB0_4:
	ldr	w1, [x8]
	mov	w2, #0
	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_SetError
LBB0_5:
Lloh9:
	adrp	x8, _HPDF_INVALID_PARAMETER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HPDF_INVALID_PARAMETER@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _HPDF_PAGE_CANNOT_SET_PARENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HPDF_PAGE_CANNOT_SET_PARENT@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
LBB0_8:
	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_9:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_HPDF_Dict_Add
Lloh15:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.10:
Lloh18:
	adrp	x8, _HPDF_OCLASS_ARRAY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HPDF_OCLASS_ARRAY@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_HPDF_Dict_GetItem
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x19]
	str	x21, [x8]
	mov	x1, x20
	mov	x2, x19
	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_Array_Insert
LBB0_12:
	ldr	w0, [x21, #8]
Lloh23:
	adrp	x8, _HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Page_InsertBefore\n"

	.comm	_HPDF_INVALID_PARAMETER,4,2     ; @HPDF_INVALID_PARAMETER
	.comm	_HPDF_PAGE_CANNOT_SET_PARENT,4,2 ; @HPDF_PAGE_CANNOT_SET_PARENT
l_.str.1:                               ; @.str.1
	.asciz	"Parent"

	.comm	_HPDF_OCLASS_DICT,4,2           ; @HPDF_OCLASS_DICT
	.comm	_HPDF_OK,4,2                    ; @HPDF_OK
l_.str.2:                               ; @.str.2
	.asciz	"Kids"

	.comm	_HPDF_OCLASS_ARRAY,4,2          ; @HPDF_OCLASS_ARRAY
	.comm	_HPDF_PAGES_MISSING_KIDS_ENTRY,4,2 ; @HPDF_PAGES_MISSING_KIDS_ENTRY
.subsections_via_symbols
