	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Pages_BeforeWrite              ## -- Begin function Pages_BeforeWrite
	.p2align	4, 0x90
_Pages_BeforeWrite:                     ## @Pages_BeforeWrite
	.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	%rdi, %rbx
	movq	_HPDF_OCLASS_ARRAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_HPDF_Dict_GetItem
	movl	%eax, %r15d
	movq	_HPDF_OCLASS_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_HPDF_Dict_GetItem
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
	callq	_HPDF_PTRACE
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.5:
	movslq	%r14d, %r14
	movq	%rbx, %rdi
	callq	_GetPageCount
	movl	%eax, (%r14)
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%rbx), %edi
	movq	_HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_SetError                  ## TAILCALL
LBB0_2:
	movl	4(%rbx), %r14d
	movq	%rbx, %rdi
	callq	_GetPageCount
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_HPDF_Number_New
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Dict_Add                  ## TAILCALL
LBB0_6:
	movl	(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Error_GetCode             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Kids"

	.comm	_HPDF_OCLASS_ARRAY,4,2          ## @HPDF_OCLASS_ARRAY
L_.str.1:                               ## @.str.1
	.asciz	"Count"

	.comm	_HPDF_OCLASS_NUMBER,4,2         ## @HPDF_OCLASS_NUMBER
L_.str.2:                               ## @.str.2
	.asciz	" HPDF_Pages_BeforeWrite\n"

	.comm	_HPDF_PAGES_MISSING_KIDS_ENTRY,4,2 ## @HPDF_PAGES_MISSING_KIDS_ENTRY
	.comm	_HPDF_OK,4,2                    ## @HPDF_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Pages_BeforeWrite              ; -- Begin function Pages_BeforeWrite
	.p2align	2
_Pages_BeforeWrite:                     ; @Pages_BeforeWrite
	.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, x0
Lloh0:
	adrp	x8, _HPDF_OCLASS_ARRAY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HPDF_OCLASS_ARRAY@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_HPDF_Dict_GetItem
	mov	x21, x0
Lloh5:
	adrp	x8, _HPDF_OCLASS_NUMBER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HPDF_OCLASS_NUMBER@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_HPDF_Dict_GetItem
	mov	x20, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_HPDF_PTRACE
	cbz	w21, LBB0_3
; %bb.1:
	sxtw	x20, w20
	cbz	w20, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_GetPageCount
	str	w0, [x20]
Lloh12:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh14:
	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_3:
	ldr	w0, [x19]
Lloh15:
	adrp	x8, _HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HPDF_PAGES_MISSING_KIDS_ENTRY@GOTPAGEOFF]
Lloh17:
	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_4:
	ldr	w20, [x19, #4]
	mov	x0, x19
	bl	_GetPageCount
	mov	x1, x0
	mov	x0, x20
	bl	_HPDF_Number_New
	cbz	x0, LBB0_6
; %bb.5:
	mov	x2, x0
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, 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_Dict_Add
LBB0_6:
	ldr	w0, [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_Error_GetCode
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Kids"

	.comm	_HPDF_OCLASS_ARRAY,4,2          ; @HPDF_OCLASS_ARRAY
l_.str.1:                               ; @.str.1
	.asciz	"Count"

	.comm	_HPDF_OCLASS_NUMBER,4,2         ; @HPDF_OCLASS_NUMBER
l_.str.2:                               ; @.str.2
	.asciz	" HPDF_Pages_BeforeWrite\n"

	.comm	_HPDF_PAGES_MISSING_KIDS_ENTRY,4,2 ; @HPDF_PAGES_MISSING_KIDS_ENTRY
	.comm	_HPDF_OK,4,2                    ; @HPDF_OK
.subsections_via_symbols
