	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Stream_WriteBinary        ## -- Begin function HPDF_Stream_WriteBinary
	.p2align	4, 0x90
_HPDF_Stream_WriteBinary:               ## @HPDF_Stream_WriteBinary
	.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, %rbx
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HPDF_TEXT_DEFAULT_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	shlq	$2, %r12
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_HPDF_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movq	_HPDF_TEXT_DEFAULT_LEN@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_4
## %bb.3:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_HPDF_GetMem
	movq	%rax, %r14
	movq	_HPDF_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_4:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_HPDF_Encrypt_CryptBuf
	movq	%r14, %r13
	testl	%ebx, %ebx
	jg	LBB0_6
	jmp	LBB0_13
LBB0_1:
	xorl	%r14d, %r14d
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	jle	LBB0_13
LBB0_6:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %ebx
	xorl	%r14d, %r14d
	movl	$48, %r8d
	xorl	%edx, %edx
	movq	_HPDF_TEXT_DEFAULT_LEN@GOTPCREL(%rip), %rdi
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	cmpl	%r14d, %ebx
	je	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%r14,4), %eax
	movl	%eax, %ecx
	shll	$20, %ecx
	shrl	$4, %eax
	cmpl	$167772160, %ecx                ## imm = 0xA000000
	movl	$55, %ecx
	cmovll	%r8d, %ecx
	addb	%al, %cl
	movslq	%edx, %rax
	movb	%cl, (%r15,%rax)
	movl	(%r13,%r14,4), %ecx
	andl	$15, %ecx
	leal	48(%rcx), %edx
	leal	55(%rcx), %esi
	cmpl	$10, %ecx
	movzbl	%dl, %ecx
	movzbl	%sil, %esi
	cmovbl	%ecx, %esi
	leal	2(%rax), %edx
	movb	%sil, 1(%r15,%rax)
	movl	(%rdi), %eax
	addl	$-2, %eax
	cmpl	%eax, %edx
	jle	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_HPDF_Stream_Write
	movq	%rax, %r12
	xorl	%edx, %edx
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_HPDF_TEXT_DEFAULT_LEN@GOTPCREL(%rip), %rdi
	movl	$48, %r8d
	jmp	LBB0_10
LBB0_11:
	testl	%edx, %edx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_13
## %bb.12:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_HPDF_Stream_Write
	movq	%rax, %r12
LBB0_13:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_15
LBB0_14:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_HPDF_FreeMem
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.16:
	movq	%r12, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_14
	jmp	LBB0_15
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HPDF_TEXT_DEFAULT_LEN,4,2      ## @HPDF_TEXT_DEFAULT_LEN
	.comm	_HPDF_FALSE,8,3                 ## @HPDF_FALSE
	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Stream_WriteBinary\n"

	.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_WriteBinary        ; -- Begin function HPDF_Stream_WriteBinary
	.p2align	2
_HPDF_Stream_WriteBinary:               ; @HPDF_Stream_WriteBinary
	.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, #32
	mov	x25, x3
	mov	x21, x2
	mov	x24, x1
	mov	x19, 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	x26, _HPDF_TEXT_DEFAULT_LEN@GOTPAGE
Lloh4:
	ldr	x26, [x26, _HPDF_TEXT_DEFAULT_LEN@GOTPAGEOFF]
	ldr	w8, [x26]
	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	x10, x10, #0x1fffffff0
	sub	x23, x9, x10
	mov	sp, x23
	lsl	x8, x8, #2
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh9:
	adrp	x8, _HPDF_FALSE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HPDF_FALSE@GOTPAGEOFF]
Lloh11:
	ldr	x27, [x8]
Lloh12:
	adrp	x28, _HPDF_OK@GOTPAGE
Lloh13:
	ldr	x28, [x28, _HPDF_OK@GOTPAGEOFF]
	ldr	x20, [x28]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	cbz	x25, LBB0_4
; %bb.1:
	ldr	w8, [x26]
	cmp	w8, w21
	b.ge	LBB0_3
; %bb.2:
	ldr	w0, [x19]
	mov	x1, x21
	bl	_HPDF_GetMem
	mov	x22, x0
Lloh16:
	adrp	x8, _HPDF_TRUE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HPDF_TRUE@GOTPAGEOFF]
Lloh18:
	ldr	x27, [x8]
LBB0_3:
	mov	x0, x25
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	bl	_HPDF_Encrypt_CryptBuf
	mov	x24, x22
	cmp	w21, #1
	b.ge	LBB0_5
	b	LBB0_12
LBB0_4:
	mov	x22, #0
	cmp	w21, #1
	b.lt	LBB0_12
LBB0_5:
	stp	x27, x22, [x29, #-104]          ; 16-byte Folded Spill
	mov	w2, #0
	mov	w25, #167772160
	mov	w27, #55
	mov	w22, #48
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x24, x24, #4
	subs	w21, w21, #1
	b.eq	LBB0_10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w25, w8, lsl #20
	csel	w9, w22, w27, gt
	add	w8, w9, w8, lsr #4
	add	x9, x23, w2, sxtw
	strb	w8, [x9]
	ldr	w8, [x24]
	and	w10, w8, #0xf
	mov	w11, #48
	bfxil	w11, w8, #0, #4
	add	w8, w10, #55
	cmp	w10, #10
	csel	w8, w11, w8, lo
	add	w2, w2, #2
	strb	w8, [x9, #1]
	ldr	w8, [x26]
	sub	w8, w8, #2
	cmp	w2, w8
	b.le	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, x23
	bl	_HPDF_Stream_Write
	mov	x20, x0
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w2, #0
	b	LBB0_6
LBB0_10:
	cmp	w2, #1
	ldp	x27, x22, [x29, #-104]          ; 16-byte Folded Reload
	b.lt	LBB0_12
; %bb.11:
	mov	x0, x19
	mov	x1, x23
	bl	_HPDF_Stream_Write
	mov	x20, x0
LBB0_12:
	cbz	x27, LBB0_14
LBB0_13:
	ldr	w0, [x19]
	mov	x1, x22
	bl	_HPDF_FreeMem
LBB0_14:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.15:
	mov	x0, x20
	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_16:
	ldp	x8, x22, [x29, #-104]           ; 16-byte Folded Reload
	cbnz	x8, LBB0_13
	b	LBB0_14
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_HPDF_TEXT_DEFAULT_LEN,4,2      ; @HPDF_TEXT_DEFAULT_LEN
	.comm	_HPDF_FALSE,8,3                 ; @HPDF_FALSE
	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Stream_WriteBinary\n"

	.comm	_HPDF_TRUE,8,3                  ; @HPDF_TRUE
.subsections_via_symbols
