	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Stream_WriteToStream      ## -- Begin function HPDF_Stream_WriteToStream
	.p2align	4, 0x90
_HPDF_Stream_WriteToStream:             ## @HPDF_Stream_WriteToStream
	.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	%rcx, %r12
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movl	%r14d, %edi
	callq	_HPDF_UNUSED
	testq	%r13, %r13
	je	LBB0_8
## %bb.1:
	cmpl	$0, 4(%r13)
	je	LBB0_8
## %bb.2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	callq	_HPDF_Error_GetCode
	movq	_HPDF_NOERROR@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_9
## %bb.3:
	movl	(%r13), %edi
	callq	_HPDF_Error_GetCode
	cmpq	(%rbx), %rax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	callq	_HPDF_Stream_Size
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	_HPDF_STREAM_FILTER_FLATE_DECODE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_14
## %bb.6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.7:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HPDF_Stream_WriteToStreamWithDeflate ## TAILCALL
LBB0_8:
	movl	(%r15), %edi
	movq	_HPDF_INVALID_OBJECT@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	xorl	%edx, %edx
	callq	_HPDF_SetError
	movq	(%rbx), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_HPDF_THIS_FUNC_WAS_SKIPPED@GOTPCREL(%rip), %rax
LBB0_10:
	movq	(%rax), %rax
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_27
## %bb.12:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_14:
	movq	_HPDF_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_HPDF_Stream_Seek
	movq	_HPDF_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.15:
	movq	_HPDF_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	_HPDF_OK@GOTPCREL(%rip), %rbx
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	leaq	-52(%rbp), %rdx
	callq	_HPDF_Stream_Read
	movq	(%rbx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_20
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_HPDF_STREAM_EOF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_11
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	$0, -52(%rbp)
	je	LBB0_26
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	_HPDF_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	-52(%rbp), %ecx
	testq	%r12, %r12
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_HPDF_Encrypt_CryptBuf
	movl	-52(%rbp), %edx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	_HPDF_OK@GOTPCREL(%rip), %rbx
	jmp	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%ecx, %edx
LBB0_23:                                ##   in Loop: Header=BB0_16 Depth=1
	callq	_HPDF_Stream_Write
	movq	%rax, %rcx
	cmpq	(%rbx), %rax
	jne	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_16 Depth=1
	testq	%r14, %r14
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_16 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_16
LBB0_26:
	movq	%rcx, %rax
	jmp	LBB0_11
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HPDF_STREAM_BUF_SIZ,4,2        ## @HPDF_STREAM_BUF_SIZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Stream_WriteToStream\n"

	.comm	_HPDF_INVALID_OBJECT,8,3        ## @HPDF_INVALID_OBJECT
	.comm	_HPDF_NOERROR,8,3               ## @HPDF_NOERROR
	.comm	_HPDF_THIS_FUNC_WAS_SKIPPED,8,3 ## @HPDF_THIS_FUNC_WAS_SKIPPED
	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.comm	_HPDF_STREAM_FILTER_FLATE_DECODE,4,2 ## @HPDF_STREAM_FILTER_FLATE_DECODE
	.comm	_HPDF_SEEK_SET,4,2              ## @HPDF_SEEK_SET
	.comm	_HPDF_FALSE,8,3                 ## @HPDF_FALSE
	.comm	_HPDF_STREAM_EOF,8,3            ## @HPDF_STREAM_EOF
	.comm	_HPDF_TRUE,8,3                  ## @HPDF_TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Stream_WriteToStream      ; -- Begin function HPDF_Stream_WriteToStream
	.p2align	2
_HPDF_Stream_WriteToStream:             ; @HPDF_Stream_WriteToStream
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #16
	mov	x19, x3
	mov	x24, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x25, _HPDF_STREAM_BUF_SIZ@GOTPAGE
Lloh4:
	ldr	x25, [x25, _HPDF_STREAM_BUF_SIZ@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x22, x9, x12
	mov	sp, x22
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x23, x8, x12
	mov	sp, x23
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	mov	x0, x24
	bl	_HPDF_UNUSED
	cbz	x20, LBB0_8
; %bb.1:
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_8
; %bb.2:
	ldr	w0, [x21]
	bl	_HPDF_Error_GetCode
Lloh11:
	adrp	x26, _HPDF_NOERROR@GOTPAGE
Lloh12:
	ldr	x26, [x26, _HPDF_NOERROR@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.3:
	ldr	w0, [x20]
	bl	_HPDF_Error_GetCode
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.4:
	mov	x0, x21
	bl	_HPDF_Stream_Size
	cbz	x0, LBB0_13
; %bb.5:
Lloh13:
	adrp	x8, _HPDF_STREAM_FILTER_FLATE_DECODE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HPDF_STREAM_FILTER_FLATE_DECODE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_14
; %bb.6:
	ldur	x8, [x29, #-88]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.7:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_HPDF_Stream_WriteToStreamWithDeflate
LBB0_8:
	ldr	w0, [x21]
Lloh19:
	adrp	x19, _HPDF_INVALID_OBJECT@GOTPAGE
Lloh20:
	ldr	x19, [x19, _HPDF_INVALID_OBJECT@GOTPAGEOFF]
	ldr	x1, [x19]
	mov	w2, #0
	bl	_HPDF_SetError
	ldr	x0, [x19]
	b	LBB0_11
LBB0_9:
Lloh21:
	adrp	x8, _HPDF_THIS_FUNC_WAS_SKIPPED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HPDF_THIS_FUNC_WAS_SKIPPED@GOTPAGEOFF]
LBB0_10:
	ldr	x0, [x8]
LBB0_11:
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.12:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh26:
	adrp	x8, _HPDF_OK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HPDF_OK@GOTPAGEOFF]
	b	LBB0_10
LBB0_14:
Lloh28:
	adrp	x8, _HPDF_SEEK_SET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HPDF_SEEK_SET@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_HPDF_Stream_Seek
Lloh31:
	adrp	x24, _HPDF_OK@GOTPAGE
Lloh32:
	ldr	x24, [x24, _HPDF_OK@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.15:
Lloh33:
	adrp	x8, _HPDF_FALSE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _HPDF_FALSE@GOTPAGEOFF]
Lloh35:
	ldr	x28, [x8]
Lloh36:
	adrp	x26, _HPDF_STREAM_EOF@GOTPAGE
Lloh37:
	ldr	x26, [x26, _HPDF_STREAM_EOF@GOTPAGEOFF]
Lloh38:
	adrp	x27, _HPDF_TRUE@GOTPAGE
Lloh39:
	ldr	x27, [x27, _HPDF_TRUE@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	stur	w8, [x29, #-92]
	sub	x2, x29, #92
	mov	x0, x21
	mov	x1, x22
	bl	_HPDF_Stream_Read
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x9, [x26]
	cmp	x0, x9
	b.ne	LBB0_11
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldur	w9, [x29, #-92]
	cbz	w9, LBB0_25
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x28, [x27]
LBB0_20:                                ;   in Loop: Header=BB0_16 Depth=1
	ldur	w3, [x29, #-92]
	cbz	x19, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_HPDF_Encrypt_CryptBuf
	ldur	w2, [x29, #-92]
	mov	x0, x20
	mov	x1, x23
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x20
	mov	x1, x22
	mov	x2, x3
LBB0_23:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_HPDF_Stream_Write
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.24:                               ;   in Loop: Header=BB0_16 Depth=1
	cbz	x28, LBB0_16
	b	LBB0_11
LBB0_25:
	mov	x0, x8
	b	LBB0_11
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_HPDF_STREAM_BUF_SIZ,4,2        ; @HPDF_STREAM_BUF_SIZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Stream_WriteToStream\n"

	.comm	_HPDF_INVALID_OBJECT,8,3        ; @HPDF_INVALID_OBJECT
	.comm	_HPDF_NOERROR,8,3               ; @HPDF_NOERROR
	.comm	_HPDF_THIS_FUNC_WAS_SKIPPED,8,3 ; @HPDF_THIS_FUNC_WAS_SKIPPED
	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.comm	_HPDF_STREAM_FILTER_FLATE_DECODE,4,2 ; @HPDF_STREAM_FILTER_FLATE_DECODE
	.comm	_HPDF_SEEK_SET,4,2              ; @HPDF_SEEK_SET
	.comm	_HPDF_FALSE,8,3                 ; @HPDF_FALSE
	.comm	_HPDF_STREAM_EOF,8,3            ; @HPDF_STREAM_EOF
	.comm	_HPDF_TRUE,8,3                  ; @HPDF_TRUE
.subsections_via_symbols
