	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function BeforeWrite
_BeforeWrite:                           ## @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, %r15
	movq	_HPDF_OCLASS_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_HPDF_Dict_GetItem
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_CountChild
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_HPDF_PTRACE
	testl	%ebx, %ebx
	jne	LBB0_2
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Dict_RemoveElement        ## TAILCALL
LBB0_2:
	movl	%r15d, %edi
	callq	_HPDF_Outline_GetOpened
	movl	%ebx, %edx
	negl	%edx
	testl	%eax, %eax
	cmovnel	%ebx, %edx
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	movslq	%r14d, %rax
	movl	%edx, (%rax)
LBB0_5:
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	testl	%edx, %edx
	je	LBB0_5
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Dict_AddNumber            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Count"

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

	.comm	_HPDF_OK,4,2                    ## @HPDF_OK
	.no_dead_strip	_BeforeWrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function BeforeWrite
_BeforeWrite:                           ; @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_NUMBER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HPDF_OCLASS_NUMBER@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
	mov	x0, x19
	bl	_CountChild
	mov	x20, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_HPDF_PTRACE
	cbnz	w20, LBB0_3
; %bb.1:
	cbz	w21, LBB0_3
; %bb.2:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@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_RemoveElement
LBB0_3:
	sxtw	x21, w21
	mov	x0, x19
	bl	_HPDF_Outline_GetOpened
	cmp	w0, #0
	cneg	w2, w20, eq
	cbz	w21, LBB0_6
; %bb.4:
	str	w2, [x21]
LBB0_5:
Lloh9:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh11:
	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_6:
	cbz	w2, LBB0_5
; %bb.7:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@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_AddNumber
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Count"

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

	.comm	_HPDF_OK,4,2                    ; @HPDF_OK
	.no_dead_strip	_BeforeWrite
.subsections_via_symbols
