	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_MemStream_ReadFunc        ## -- Begin function HPDF_MemStream_ReadFunc
	.p2align	4, 0x90
_HPDF_MemStream_ReadFunc:               ## @HPDF_MemStream_ReadFunc
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movslq	(%rdi), %r15
	movq	(%rdx), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	$0, (%r14)
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	testq	%rbx, %rbx
	jle	LBB0_15
## %bb.1:
	leaq	24(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	40(%r15), %rdi
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%eax
	movl	(%r15), %esi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpl	%esi, %eax
	jg	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_14
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rcx), %r13
	subq	16(%r15), %r13
	movq	32(%r15), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_HPDF_List_ItemAt
	movq	%rax, 32(%r15)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	movq	%rax, %rsi
	cmpq	%r13, %rbx
	jle	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdx
	callq	_HPDF_MemCpy
	movq	%rax, %r12
	addq	%r13, (%r14)
	movl	(%r15), %esi
	movq	40(%r15), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, %esi
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%esi
	movl	%esi, (%r15)
	movq	$0, 16(%r15)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-72(%rbp), %rdx
	callq	_HPDF_MemStream_GetBufPtr
	movq	%rax, 32(%r15)
	subq	%r13, %rbx
	jg	LBB0_2
	jmp	LBB0_12
LBB0_11:
	movq	%rbx, %rdx
	callq	_HPDF_MemCpy
	addq	%rbx, 16(%r15)
	addq	%rbx, (%r14)
	shlq	$2, %rbx
	addq	%rbx, 32(%r15)
LBB0_12:
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_13:
	leaq	(,%r13,4), %rax
	addq	%rax, 32(%r15)
	addq	%r13, 16(%r15)
LBB0_14:
	movq	_HPDF_STREAM_EOF@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_MemStream_ReadFunc\n"

	.comm	_HPDF_STREAM_EOF,4,2            ## @HPDF_STREAM_EOF
	.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	_HPDF_MemStream_ReadFunc        ; -- Begin function HPDF_MemStream_ReadFunc
	.p2align	2
_HPDF_MemStream_ReadFunc:               ; @HPDF_MemStream_ReadFunc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldrsw	x24, [x0]
	ldr	x28, [x2]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	str	xzr, [x19]
	cmp	x28, #1
	b.lt	LBB0_11
; %bb.1:
	add	x26, x24, #24
	add	x27, x24, #8
Lloh2:
	adrp	x25, _HPDF_STREAM_EOF@GOTPAGE
Lloh3:
	ldr	x25, [x25, _HPDF_STREAM_EOF@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x24, #40]
	ldr	w8, [x0]
	cbz	w8, LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w9, w8, #1
	ldr	w1, [x24]
	mov	x8, x27
	cmp	w9, w1
	b.gt	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x8, x26
	b.ne	LBB0_12
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x8]
	ldr	x9, [x24, #16]
	sub	x23, x8, x9
	ldr	x8, [x24, #32]
	cbnz	x8, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_HPDF_List_ItemAt
	mov	x8, x0
	str	x0, [x24, #32]
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	x1, x8
	subs	x22, x28, x23
	b.le	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x2, x23
	bl	_HPDF_MemCpy
	ldr	x8, [x19]
	add	x8, x8, x23
	str	x8, [x19]
	ldr	w8, [x24]
	ldr	x9, [x24, #40]
	ldr	w9, [x9]
	sub	w9, w9, #1
	cmp	w8, w9
	b.eq	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	add	w1, w8, #1
	str	w1, [x24]
	str	xzr, [x24, #16]
	add	x2, sp, #8
	mov	x0, x20
	bl	_HPDF_MemStream_GetBufPtr
	str	x0, [x24, #32]
	mov	x28, x22
	cmp	x22, #0
	b.gt	LBB0_2
	b	LBB0_11
LBB0_10:
	mov	x2, x28
	bl	_HPDF_MemCpy
	ldr	x8, [x24, #16]
	add	x8, x8, x28
	str	x8, [x24, #16]
	ldr	x8, [x19]
	add	x8, x8, x28
	str	x8, [x19]
	ldr	x8, [x24, #32]
	add	x8, x8, x28, lsl #2
	str	x8, [x24, #32]
LBB0_11:
Lloh4:
	adrp	x25, _HPDF_OK@GOTPAGE
Lloh5:
	ldr	x25, [x25, _HPDF_OK@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x25]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	ldr	x8, [x24, #32]
	add	x8, x8, x23, lsl #2
	str	x8, [x24, #32]
	ldr	x8, [x24, #16]
	add	x8, x8, x23
	str	x8, [x24, #16]
Lloh6:
	adrp	x25, _HPDF_STREAM_EOF@GOTPAGE
Lloh7:
	ldr	x25, [x25, _HPDF_STREAM_EOF@GOTPAGEOFF]
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_MemStream_ReadFunc\n"

	.comm	_HPDF_STREAM_EOF,4,2            ; @HPDF_STREAM_EOF
	.comm	_HPDF_OK,4,2                    ; @HPDF_OK
.subsections_via_symbols
