	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_MemStream_New             ## -- Begin function HPDF_MemStream_New
	.p2align	4, 0x90
_HPDF_MemStream_New:                    ## @HPDF_MemStream_New
	.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, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_HPDF_GetMem
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_HPDF_GetMem
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r12
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_HPDF_MemSet
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_HPDF_MemSet
	movq	_HPDF_DEF_ITEMS_PER_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_HPDF_List_New
	movl	%eax, 68(%r12)
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	_HPDF_STREAM_SIG_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movq	_HPDF_STREAM_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movl	(%r15), %eax
	movl	%eax, 56(%rbx)
	movq	%r15, 48(%rbx)
	movq	%r12, 40(%rbx)
	testq	%r14, %r14
	jg	LBB0_8
## %bb.7:
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_8:
	movq	%r14, 24(%r12)
	movq	%r14, 32(%r12)
	movq	_HPDF_MemStream_WriteFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_HPDF_MemStream_ReadFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_HPDF_MemStream_SeekFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_HPDF_MemStream_TellFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_HPDF_MemStream_SizeFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_HPDF_MemStream_FreeFunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_9
LBB0_2:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	jmp	LBB0_3
LBB0_5:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_HPDF_FreeMem
	movq	%r15, %rdi
	movq	%r12, %rsi
LBB0_3:
	callq	_HPDF_FreeMem
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_MemStream_New\n"

	.comm	_HPDF_DEF_ITEMS_PER_BLOCK,4,2   ## @HPDF_DEF_ITEMS_PER_BLOCK
	.comm	_HPDF_STREAM_SIG_BYTES,4,2      ## @HPDF_STREAM_SIG_BYTES
	.comm	_HPDF_STREAM_MEMORY,4,2         ## @HPDF_STREAM_MEMORY
	.comm	_HPDF_STREAM_BUF_SIZ,8,3        ## @HPDF_STREAM_BUF_SIZ
	.comm	_HPDF_MemStream_WriteFunc,4,2   ## @HPDF_MemStream_WriteFunc
	.comm	_HPDF_MemStream_ReadFunc,4,2    ## @HPDF_MemStream_ReadFunc
	.comm	_HPDF_MemStream_SeekFunc,4,2    ## @HPDF_MemStream_SeekFunc
	.comm	_HPDF_MemStream_TellFunc,4,2    ## @HPDF_MemStream_TellFunc
	.comm	_HPDF_MemStream_SizeFunc,4,2    ## @HPDF_MemStream_SizeFunc
	.comm	_HPDF_MemStream_FreeFunc,4,2    ## @HPDF_MemStream_FreeFunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_MemStream_New             ; -- Begin function HPDF_MemStream_New
	.p2align	2
_HPDF_MemStream_New:                    ; @HPDF_MemStream_New
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	mov	x0, x20
	mov	w1, #4
	bl	_HPDF_GetMem
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	mov	x0, x20
	mov	w1, #4
	bl	_HPDF_GetMem
	cbz	x0, LBB0_4
; %bb.2:
	mov	x22, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #4
	bl	_HPDF_MemSet
	mov	x0, x22
	mov	w1, #0
	mov	w2, #4
	bl	_HPDF_MemSet
Lloh2:
	adrp	x8, _HPDF_DEF_ITEMS_PER_BLOCK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HPDF_DEF_ITEMS_PER_BLOCK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_HPDF_List_New
	str	w0, [x22, #68]
	cbz	w0, LBB0_5
; %bb.3:
Lloh5:
	adrp	x8, _HPDF_STREAM_SIG_BYTES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HPDF_STREAM_SIG_BYTES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #64]
Lloh8:
	adrp	x8, _HPDF_STREAM_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HPDF_STREAM_MEMORY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x20]
	stp	w9, w8, [x19, #56]
Lloh11:
	adrp	x8, _HPDF_STREAM_BUF_SIZ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HPDF_STREAM_BUF_SIZ@GOTPAGEOFF]
	stp	x22, x20, [x19, #40]
Lloh13:
	ldr	x8, [x8]
	cmp	x21, #0
	csel	x8, x21, x8, gt
	stp	x8, x8, [x22, #24]
Lloh14:
	adrp	x8, _HPDF_MemStream_WriteFunc@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HPDF_MemStream_WriteFunc@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _HPDF_MemStream_ReadFunc@GOTPAGE
Lloh18:
	ldr	x9, [x9, _HPDF_MemStream_ReadFunc@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
Lloh20:
	adrp	x8, _HPDF_MemStream_SeekFunc@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HPDF_MemStream_SeekFunc@GOTPAGEOFF]
Lloh22:
	adrp	x9, _HPDF_MemStream_TellFunc@GOTPAGE
Lloh23:
	ldr	x9, [x9, _HPDF_MemStream_TellFunc@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #8]
Lloh26:
	adrp	x8, _HPDF_MemStream_SizeFunc@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HPDF_MemStream_SizeFunc@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _HPDF_MemStream_FreeFunc@GOTPAGE
Lloh30:
	ldr	x9, [x9, _HPDF_MemStream_FreeFunc@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	b	LBB0_7
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	b	LBB0_6
LBB0_5:
	mov	x0, x20
	mov	x1, x19
	bl	_HPDF_FreeMem
	mov	x0, x20
	mov	x1, x22
LBB0_6:
	bl	_HPDF_FreeMem
	mov	x19, #0
LBB0_7:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_MemStream_New\n"

	.comm	_HPDF_DEF_ITEMS_PER_BLOCK,4,2   ; @HPDF_DEF_ITEMS_PER_BLOCK
	.comm	_HPDF_STREAM_SIG_BYTES,4,2      ; @HPDF_STREAM_SIG_BYTES
	.comm	_HPDF_STREAM_MEMORY,4,2         ; @HPDF_STREAM_MEMORY
	.comm	_HPDF_STREAM_BUF_SIZ,8,3        ; @HPDF_STREAM_BUF_SIZ
	.comm	_HPDF_MemStream_WriteFunc,4,2   ; @HPDF_MemStream_WriteFunc
	.comm	_HPDF_MemStream_ReadFunc,4,2    ; @HPDF_MemStream_ReadFunc
	.comm	_HPDF_MemStream_SeekFunc,4,2    ; @HPDF_MemStream_SeekFunc
	.comm	_HPDF_MemStream_TellFunc,4,2    ; @HPDF_MemStream_TellFunc
	.comm	_HPDF_MemStream_SizeFunc,4,2    ; @HPDF_MemStream_SizeFunc
	.comm	_HPDF_MemStream_FreeFunc,4,2    ; @HPDF_MemStream_FreeFunc
.subsections_via_symbols
