	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_MemStream_InWrite         ## -- Begin function HPDF_MemStream_InWrite
	.p2align	4, 0x90
_HPDF_MemStream_InWrite:                ## @HPDF_MemStream_InWrite
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movslq	8(%rdi), %r13
	movq	(%r13), %rbx
	subq	8(%r13), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	(%r12), %rdx
	testq	%rdx, %rdx
	jle	LBB0_1
## %bb.2:
	cmpq	%rdx, %rbx
	jge	LBB0_3
## %bb.4:
	testq	%rbx, %rbx
	jle	LBB0_6
## %bb.5:
	movq	16(%r13), %rdi
	movq	(%r15), %rsi
	movq	%rbx, %rdx
	callq	_HPDF_MemCpy
	leaq	(,%rbx,4), %rax
	addq	%rax, (%r15)
	subq	%rbx, (%r12)
LBB0_6:
	movl	4(%r14), %edi
	movq	(%r13), %rsi
	callq	_HPDF_GetMem
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movl	24(%r13), %edi
	movq	%rax, %rsi
	callq	_HPDF_List_Add
	movq	_HPDF_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.10:
	movq	$0, 8(%r13)
	jmp	LBB0_11
LBB0_3:
	movq	16(%r13), %rdi
	movq	(%r15), %rsi
	callq	_HPDF_MemCpy
	movq	(%r12), %rax
	leaq	(,%rax,4), %rcx
	addq	%rcx, 16(%r13)
	addq	%rax, 8(%r13)
	movq	$0, (%r12)
LBB0_1:
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	4(%r14), %edi
	movq	16(%r13), %rsi
	callq	_HPDF_FreeMem
	movq	$0, 16(%r13)
LBB0_9:
	movl	(%r14), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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_MemStream_InWrite\n"

	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_MemStream_InWrite         ; -- Begin function HPDF_MemStream_InWrite
	.p2align	2
_HPDF_MemStream_InWrite:                ; @HPDF_MemStream_InWrite
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldrsw	x23, [x0, #8]
	ldp	x22, x24, [x23]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	ldr	x2, [x20]
	cmp	x2, #0
	b.le	LBB0_8
; %bb.1:
	sub	x22, x22, x24
	cmp	x22, x2
	b.ge	LBB0_7
; %bb.2:
	cmp	x22, #1
	b.lt	LBB0_4
; %bb.3:
	ldr	x0, [x23, #16]
	ldr	x1, [x21]
	mov	x2, x22
	bl	_HPDF_MemCpy
	ldr	x8, [x21]
	add	x8, x8, x22, lsl #2
	str	x8, [x21]
	ldr	x8, [x20]
	sub	x8, x8, x22
	str	x8, [x20]
LBB0_4:
	ldr	w0, [x19, #4]
	ldr	x1, [x23]
	bl	_HPDF_GetMem
	str	x0, [x23, #16]
	cbz	x0, LBB0_11
; %bb.5:
	mov	x1, x0
	ldr	w0, [x23, #24]
	bl	_HPDF_List_Add
Lloh2:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.6:
	str	xzr, [x23, #8]
	b	LBB0_9
LBB0_7:
	ldr	x0, [x23, #16]
	ldr	x1, [x21]
	bl	_HPDF_MemCpy
	ldr	x8, [x20]
	ldp	x10, x9, [x23, #8]
	add	x9, x9, x8, lsl #2
	add	x8, x10, x8
	stp	x8, x9, [x23, #8]
	str	xzr, [x20]
LBB0_8:
Lloh5:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
Lloh7:
	ldr	x0, [x8]
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	w0, [x19, #4]
	ldr	x1, [x23, #16]
	bl	_HPDF_FreeMem
	str	xzr, [x23, #16]
LBB0_11:
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_HPDF_Error_GetCode
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_MemStream_InWrite\n"

	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
.subsections_via_symbols
