	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Xref_Add                  ## -- Begin function HPDF_Xref_Add
	.p2align	4, 0x90
_HPDF_Xref_Add:                         ## @HPDF_Xref_Add
	.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	%rsi, %rbx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movl	(%rbx), %eax
	movq	_HPDF_OTYPE_DIRECT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_13
## %bb.4:
	movq	_HPDF_OTYPE_INDIRECT@GOTPCREL(%rip), %r12
	testl	%eax, (%r12)
	jne	LBB0_13
## %bb.5:
	movq	16(%r14), %rax
	movl	(%rax), %eax
	movq	_HPDF_LIMIT_MAX_XREF_ELEMENT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_6
## %bb.7:
	movl	8(%r14), %edi
	movl	$4, %esi
	callq	_HPDF_GetMem
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %r15
	movq	16(%r14), %rdi
	movq	%rax, %rsi
	callq	_HPDF_List_Add
	movq	_HPDF_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.11:
	movq	_HPDF_IN_USE_ENTRY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movq	$0, 16(%r15)
	movq	$0, (%r15)
	movq	%rbx, 8(%r15)
	movl	(%r14), %eax
	movq	16(%r14), %rdx
	movl	(%r12), %esi
	addl	(%rdx), %eax
	addl	%esi, %eax
	decl	%eax
	movl	%eax, (%rbx)
	movq	$0, 8(%rbx)
	movq	(%rcx), %rax
	jmp	LBB0_12
LBB0_1:
	movl	4(%r14), %edi
	callq	_HPDF_Error_GetCode
	movq	_HPDF_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
LBB0_13:
	movl	4(%r14), %edi
	movq	_HPDF_INVALID_OBJECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%edx, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_SetError                  ## TAILCALL
LBB0_2:
	movq	_HPDF_INVALID_OBJECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	4(%r14), %edi
	movq	_HPDF_XREF_COUNT_ERR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%edx, %edx
	callq	_HPDF_SetError
	jmp	LBB0_10
LBB0_9:
	movl	8(%r14), %edi
	movq	%r15, %rsi
	callq	_HPDF_FreeMem
LBB0_10:
	movl	8(%r14), %edi
	movq	%rbx, %rsi
	callq	_HPDF_Obj_ForceFree
	movl	4(%r14), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Error_GetCode             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Xref_Add\n"

	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.comm	_HPDF_INVALID_OBJECT,8,3        ## @HPDF_INVALID_OBJECT
	.comm	_HPDF_OTYPE_DIRECT,4,2          ## @HPDF_OTYPE_DIRECT
	.comm	_HPDF_OTYPE_INDIRECT,4,2        ## @HPDF_OTYPE_INDIRECT
	.comm	_HPDF_LIMIT_MAX_XREF_ELEMENT,4,2 ## @HPDF_LIMIT_MAX_XREF_ELEMENT
	.comm	_HPDF_XREF_COUNT_ERR,8,3        ## @HPDF_XREF_COUNT_ERR
	.comm	_HPDF_IN_USE_ENTRY,4,2          ## @HPDF_IN_USE_ENTRY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Xref_Add                  ; -- Begin function HPDF_Xref_Add
	.p2align	2
_HPDF_Xref_Add:                         ; @HPDF_Xref_Add
	.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_7
; %bb.1:
	ldr	w8, [x20]
Lloh2:
	adrp	x9, _HPDF_OTYPE_DIRECT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HPDF_OTYPE_DIRECT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.2:
Lloh5:
	adrp	x22, _HPDF_OTYPE_INDIRECT@GOTPAGE
Lloh6:
	ldr	x22, [x22, _HPDF_OTYPE_INDIRECT@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _HPDF_LIMIT_MAX_XREF_ELEMENT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HPDF_LIMIT_MAX_XREF_ELEMENT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.4:
	ldr	w0, [x19, #8]
	mov	w1, #4
	bl	_HPDF_GetMem
	cbz	x0, LBB0_13
; %bb.5:
	mov	x21, x0
	ldr	x0, [x19, #16]
	mov	x1, x21
	bl	_HPDF_List_Add
Lloh10:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
	ldr	x9, [x8]
	cmp	x0, x9
	b.ne	LBB0_12
; %bb.6:
Lloh12:
	adrp	x9, _HPDF_IN_USE_ENTRY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HPDF_IN_USE_ENTRY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	str	w9, [x21, #24]
	stp	x20, xzr, [x21, #8]
	str	xzr, [x21]
	ldr	w9, [x19]
	ldr	x10, [x19, #16]
	ldr	w10, [x10]
	ldr	w11, [x22]
	add	w9, w9, w10
	add	w9, w9, w11
	sub	w9, w9, #1
	str	w9, [x20]
	str	xzr, [x20, #8]
	b	LBB0_10
LBB0_7:
	ldr	w0, [x19, #4]
	bl	_HPDF_Error_GetCode
Lloh15:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
LBB0_8:
	ldr	w0, [x19, #4]
Lloh18:
	adrp	x8, _HPDF_INVALID_OBJECT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HPDF_INVALID_OBJECT@GOTPAGEOFF]
Lloh20:
	ldr	x1, [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_9:
Lloh21:
	adrp	x8, _HPDF_INVALID_OBJECT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HPDF_INVALID_OBJECT@GOTPAGEOFF]
LBB0_10:
	ldr	x0, [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_11:
	ldr	w0, [x19, #4]
Lloh23:
	adrp	x8, _HPDF_XREF_COUNT_ERR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HPDF_XREF_COUNT_ERR@GOTPAGEOFF]
Lloh25:
	ldr	x1, [x8]
	mov	w2, #0
	bl	_HPDF_SetError
	b	LBB0_13
LBB0_12:
	ldr	w0, [x19, #8]
	mov	x1, x21
	bl	_HPDF_FreeMem
LBB0_13:
	ldr	w0, [x19, #8]
	mov	x1, x20
	bl	_HPDF_Obj_ForceFree
	ldr	w0, [x19, #4]
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Xref_Add\n"

	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.comm	_HPDF_INVALID_OBJECT,8,3        ; @HPDF_INVALID_OBJECT
	.comm	_HPDF_OTYPE_DIRECT,4,2          ; @HPDF_OTYPE_DIRECT
	.comm	_HPDF_OTYPE_INDIRECT,4,2        ; @HPDF_OTYPE_INDIRECT
	.comm	_HPDF_LIMIT_MAX_XREF_ELEMENT,4,2 ; @HPDF_LIMIT_MAX_XREF_ELEMENT
	.comm	_HPDF_XREF_COUNT_ERR,8,3        ; @HPDF_XREF_COUNT_ERR
	.comm	_HPDF_IN_USE_ENTRY,4,2          ; @HPDF_IN_USE_ENTRY
.subsections_via_symbols
