	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Image_LoadJpegImage       ## -- Begin function HPDF_Image_LoadJpegImage
	.p2align	4, 0x90
_HPDF_Image_LoadJpegImage:              ## @HPDF_Image_LoadJpegImage
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HPDF_OK@GOTPCREL(%rip), %r13
	movq	(%r13), %r12
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movl	%ebx, %edi
	movl	%r15d, %esi
	callq	_HPDF_DictStream_New
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r15
	movq	_HPDF_OSUBCLASS_XOBJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r15)
	movq	_HPDF_STREAM_FILTER_DCT_DECODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	callq	_HPDF_Dict_AddName
	movq	%rax, %rbx
	addq	%r12, %rbx
	leaq	L_.str.3(%rip), %rsi
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	callq	_HPDF_Dict_AddName
	addq	%rbx, %rax
	cmpq	(%r13), %rax
	jne	LBB0_8
## %bb.2:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_LoadJpegHeader
	cmpq	(%r13), %rax
	jne	LBB0_8
## %bb.3:
	movq	_HPDF_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_HPDF_Stream_Seek
	cmpq	(%r13), %rax
	jne	LBB0_8
## %bb.4:
	movq	%rsp, %r12
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -56(%rbp)
	leaq	-56(%rbp), %rdx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	callq	_HPDF_Stream_Read
	cmpq	(%r13), %rax
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r15), %edi
	movq	-56(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_HPDF_Stream_Write
	cmpq	(%r13), %rax
	jne	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rsp
	movq	%rsp, %r12
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_HPDF_STREAM_BUF_SIZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movl	%r14d, %edi
	movq	%rbx, %rsi
	leaq	-56(%rbp), %rdx
	jmp	LBB0_5
LBB0_8:
	xorl	%r15d, %r15d
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	movq	%r15, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_HPDF_STREAM_EOF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.13:
	movq	-56(%rbp), %rdx
	testq	%rdx, %rdx
	jle	LBB0_16
## %bb.14:
	movl	(%r15), %edi
	movq	%rbx, %rsi
	callq	_HPDF_Stream_Write
	cmpq	(%r13), %rax
	je	LBB0_16
LBB0_15:
	xorl	%r15d, %r15d
LBB0_16:
	movq	%r12, %rsp
	jmp	LBB0_17
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Image_LoadJpegImage\n"

	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ## @HPDF_OSUBCLASS_XOBJECT
	.comm	_HPDF_STREAM_FILTER_DCT_DECODE,4,2 ## @HPDF_STREAM_FILTER_DCT_DECODE
L_.str.1:                               ## @.str.1
	.asciz	"Type"

L_.str.2:                               ## @.str.2
	.asciz	"XObject"

L_.str.3:                               ## @.str.3
	.asciz	"Subtype"

L_.str.4:                               ## @.str.4
	.asciz	"Image"

	.comm	_HPDF_SEEK_SET,4,2              ## @HPDF_SEEK_SET
	.comm	_HPDF_STREAM_BUF_SIZ,4,2        ## @HPDF_STREAM_BUF_SIZ
	.comm	_HPDF_STREAM_EOF,8,3            ## @HPDF_STREAM_EOF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Image_LoadJpegImage       ; -- Begin function HPDF_Image_LoadJpegImage
	.p2align	2
_HPDF_Image_LoadJpegImage:              ; @HPDF_Image_LoadJpegImage
	.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
	sub	sp, sp, #16
	mov	x19, 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, #-56]
Lloh3:
	adrp	x22, _HPDF_OK@GOTPAGE
Lloh4:
	ldr	x22, [x22, _HPDF_OK@GOTPAGEOFF]
	ldr	x23, [x22]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	mov	x0, x21
	mov	x1, x19
	bl	_HPDF_DictStream_New
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.1:
Lloh7:
	adrp	x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
Lloh10:
	adrp	x9, _HPDF_STREAM_FILTER_DCT_DECODE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _HPDF_STREAM_FILTER_DCT_DECODE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #4]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_HPDF_Dict_AddName
	add	x21, x0, x23
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
Lloh19:
	adrp	x2, l_.str.4@PAGE
Lloh20:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_HPDF_Dict_AddName
	ldr	x8, [x22]
	add	x9, x21, x0
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_LoadJpegHeader
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
Lloh21:
	adrp	x8, _HPDF_SEEK_SET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HPDF_SEEK_SET@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_HPDF_Stream_Seek
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	mov	x23, sp
Lloh24:
	adrp	x24, _HPDF_STREAM_BUF_SIZ@GOTPAGE
Lloh25:
	ldr	x24, [x24, _HPDF_STREAM_BUF_SIZ@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh26:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh27:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldrsw	x8, [x24]
	stur	x8, [x29, #-64]
	sub	x2, x29, #64
	mov	x0, x20
	mov	x1, x21
	bl	_HPDF_Stream_Read
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x19]
	ldur	x2, [x29, #-64]
	mov	x1, x21
	bl	_HPDF_Stream_Write
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	sp, x23
	mov	x23, sp
	b	LBB0_5
LBB0_8:
	mov	x19, #0
LBB0_9:
	ldur	x8, [x29, #-56]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.10:
	mov	x0, x19
	sub	sp, x29, #48
	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_11:
Lloh31:
	adrp	x8, _HPDF_STREAM_EOF@GOTPAGE
Lloh32:
	ldr	x8, [x8, _HPDF_STREAM_EOF@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.12:
	ldur	x2, [x29, #-64]
	cmp	x2, #1
	b.lt	LBB0_15
; %bb.13:
	ldr	w0, [x19]
	mov	x1, x21
	bl	_HPDF_Stream_Write
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_15
LBB0_14:
	mov	x19, #0
LBB0_15:
	mov	sp, x23
	b	LBB0_9
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Image_LoadJpegImage\n"

	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ; @HPDF_OSUBCLASS_XOBJECT
	.comm	_HPDF_STREAM_FILTER_DCT_DECODE,4,2 ; @HPDF_STREAM_FILTER_DCT_DECODE
l_.str.1:                               ; @.str.1
	.asciz	"Type"

l_.str.2:                               ; @.str.2
	.asciz	"XObject"

l_.str.3:                               ; @.str.3
	.asciz	"Subtype"

l_.str.4:                               ; @.str.4
	.asciz	"Image"

	.comm	_HPDF_SEEK_SET,4,2              ; @HPDF_SEEK_SET
	.comm	_HPDF_STREAM_BUF_SIZ,4,2        ; @HPDF_STREAM_BUF_SIZ
	.comm	_HPDF_STREAM_EOF,8,3            ; @HPDF_STREAM_EOF
.subsections_via_symbols
