	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function HPDF_Image_LoadRawImageFromMem
LCPI0_0:
	.quad	0x3fec083126e978d5              ## double 0.876
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_HPDF_Image_LoadRawImageFromMem
	.p2align	4, 0x90
_HPDF_Image_LoadRawImageFromMem:        ## @HPDF_Image_LoadRawImageFromMem
	.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	%r9d, %r12d
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_HPDF_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	leal	-128(%r12), %eax
	cmpl	$3, %eax
	jae	LBB0_9
## %bb.1:
	movl	%r13d, %esi
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	16(%rbp), %ecx
	cmpl	$8, %ecx
	ja	LBB0_12
## %bb.2:
	movl	$278, %eax                      ## imm = 0x116
	btl	%ecx, %eax
	jae	LBB0_12
## %bb.3:
	movq	%r14, %rdx
	movq	%r12, %r14
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_HPDF_DictStream_New
	testq	%rax, %rax
	je	LBB0_24
## %bb.4:
	movq	%rax, %r15
	movq	_HPDF_OSUBCLASS_XOBJECT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%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	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	leaq	L_.str.3(%rip), %rsi
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	callq	_HPDF_Dict_AddName
	addq	%rbx, %rax
	xorl	%r12d, %r12d
	movq	_HPDF_OK@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_25
## %bb.5:
	cmpl	$128, %r14d
	je	LBB0_14
## %bb.6:
	cmpl	$130, %r14d
	je	LBB0_13
## %bb.7:
	cmpl	$129, %r14d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jne	LBB0_16
## %bb.8:
	movl	%r13d, %ecx
	imull	%r14d, %ecx
	movb	$8, %al
	movzbl	%al, %eax
	movl	16(%rbp), %edx
	divb	%dl
	movzbl	%al, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cvtsi2sd	%eax, %xmm0
	addsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %r12d
	movq	_COL_GRAY@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_9:
	movl	(%rbx), %edi
	movq	_HPDF_INVALID_COLOR_SPACE@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	callq	_HPDF_SetError
	jmp	LBB0_25
LBB0_12:
	movl	(%rbx), %edi
	movq	_HPDF_INVALID_IMAGE@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_13:
	movl	%r13d, %ecx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	imull	%r14d, %ecx
	movb	$8, %al
	movzbl	%al, %eax
	movl	16(%rbp), %edx
	divb	%dl
	movzbl	%al, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cvtsi2sd	%eax, %xmm0
	addsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %r12d
	shll	$2, %r12d
	movq	_COL_CMYK@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movl	%r13d, %ecx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	imull	%r14d, %ecx
	movb	$8, %al
	movzbl	%al, %eax
	movl	16(%rbp), %edx
	divb	%dl
	movzbl	%al, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cvtsi2sd	%eax, %xmm0
	addsd	LCPI0_0(%rip), %xmm0
	cvttsd2si	%xmm0, %eax
	leal	(%rax,%rax,2), %r12d
	movq	_COL_RGB@GOTPCREL(%rip), %rax
LBB0_15:
	movq	(%rax), %rdx
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_HPDF_Dict_AddName
LBB0_16:
	cmpq	(%rbx), %rax
	jne	LBB0_24
## %bb.17:
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_HPDF_Dict_AddNumber
	cmpq	(%rbx), %rax
	jne	LBB0_24
## %bb.18:
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_HPDF_Dict_AddNumber
	cmpq	(%rbx), %rax
	jne	LBB0_24
## %bb.19:
	leaq	L_.str.8(%rip), %rsi
	movq	%r15, %rdi
	movl	16(%rbp), %edx
	callq	_HPDF_Dict_AddNumber
	cmpq	(%rbx), %rax
	jne	LBB0_24
## %bb.20:
	movl	(%r15), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_HPDF_Stream_Write
	xorl	%r12d, %r12d
	cmpq	(%rbx), %rax
	cmoveq	%r15, %r12
	jmp	LBB0_25
LBB0_24:
	xorl	%r12d, %r12d
LBB0_25:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HPDF_OK,8,3                    ## @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Image_LoadRawImageFromMem\n"

	.comm	_HPDF_INVALID_COLOR_SPACE,4,2   ## @HPDF_INVALID_COLOR_SPACE
	.comm	_HPDF_INVALID_IMAGE,4,2         ## @HPDF_INVALID_IMAGE
	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ## @HPDF_OSUBCLASS_XOBJECT
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"

L_.str.5:                               ## @.str.5
	.asciz	"ColorSpace"

	.comm	_COL_GRAY,8,3                   ## @COL_GRAY
	.comm	_COL_RGB,8,3                    ## @COL_RGB
	.comm	_COL_CMYK,8,3                   ## @COL_CMYK
L_.str.6:                               ## @.str.6
	.asciz	"Width"

L_.str.7:                               ## @.str.7
	.asciz	"Height"

L_.str.8:                               ## @.str.8
	.asciz	"BitsPerComponent"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Image_LoadRawImageFromMem ; -- Begin function HPDF_Image_LoadRawImageFromMem
	.p2align	2
_HPDF_Image_LoadRawImageFromMem:        ; @HPDF_Image_LoadRawImageFromMem
	.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
	mov	x20, x6
	mov	x24, x5
	mov	x21, x4
	mov	x23, x3
	mov	x22, x2
	mov	x19, x1
	mov	x25, x0
Lloh0:
	adrp	x26, _HPDF_OK@GOTPAGE
Lloh1:
	ldr	x26, [x26, _HPDF_OK@GOTPAGEOFF]
	ldr	x27, [x26]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	sub	w8, w24, #128
	cmp	w8, #3
	b.hs	LBB0_9
; %bb.1:
	cmp	w20, #8
	b.hi	LBB0_13
; %bb.2:
	mov	w8, #1
	lsl	w8, w8, w20
	mov	w9, #278
	tst	w8, w9
	b.eq	LBB0_13
; %bb.3:
	mov	x0, x25
	mov	x1, x22
	bl	_HPDF_DictStream_New
	cbz	x0, LBB0_12
; %bb.4:
	mov	x22, x0
Lloh4:
	adrp	x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HPDF_OSUBCLASS_XOBJECT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [x0, #4]
	orr	w8, w9, w8
	str	w8, [x0, #4]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_HPDF_Dict_AddName
	add	x25, x0, x27
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
Lloh13:
	adrp	x2, l_.str.4@PAGE
Lloh14:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_HPDF_Dict_AddName
	ldr	x8, [x26]
	add	x0, x25, x0
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.5:
	cmp	w24, #128
	b.eq	LBB0_15
; %bb.6:
	cmp	w24, #130
	b.eq	LBB0_14
; %bb.7:
	cmp	w24, #129
	b.ne	LBB0_17
; %bb.8:
	mul	w8, w21, w23
	and	w9, w20, #0xff
	mov	w10, #8
	udiv	w9, w10, w9
	sdiv	w8, w8, w9
	scvtf	d0, w8
	mov	x8, #30933
	movk	x8, #9961, lsl #16
	movk	x8, #2097, lsl #32
	movk	x8, #16364, lsl #48
	fmov	d1, x8
	fadd	d0, d0, d1
	fcvtzs	w24, d0
Lloh15:
	adrp	x8, _COL_GRAY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _COL_GRAY@GOTPAGEOFF]
	b	LBB0_16
LBB0_9:
	ldr	w0, [x25]
Lloh17:
	adrp	x8, _HPDF_INVALID_COLOR_SPACE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HPDF_INVALID_COLOR_SPACE@GOTPAGEOFF]
LBB0_10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_HPDF_SetError
LBB0_11:
	mov	x0, #0
LBB0_12:
	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:
	ldr	w0, [x25]
Lloh19:
	adrp	x8, _HPDF_INVALID_IMAGE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HPDF_INVALID_IMAGE@GOTPAGEOFF]
	b	LBB0_10
LBB0_14:
	mul	w8, w21, w23
	and	w9, w20, #0xff
	mov	w10, #8
	udiv	w9, w10, w9
	sdiv	w8, w8, w9
	scvtf	d0, w8
	mov	x8, #30933
	movk	x8, #9961, lsl #16
	movk	x8, #2097, lsl #32
	movk	x8, #16364, lsl #48
	fmov	d1, x8
	fadd	d0, d0, d1
	fcvtzs	w8, d0
	lsl	w24, w8, #2
Lloh21:
	adrp	x8, _COL_CMYK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _COL_CMYK@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
	mul	w8, w21, w23
	and	w9, w20, #0xff
	mov	w10, #8
	udiv	w9, w10, w9
	sdiv	w8, w8, w9
	scvtf	d0, w8
	mov	x8, #30933
	movk	x8, #9961, lsl #16
	movk	x8, #2097, lsl #32
	movk	x8, #16364, lsl #48
	fmov	d1, x8
	fadd	d0, d0, d1
	fcvtzs	w8, d0
	add	w24, w8, w8, lsl #1
Lloh23:
	adrp	x8, _COL_RGB@GOTPAGE
Lloh24:
	ldr	x8, [x8, _COL_RGB@GOTPAGEOFF]
LBB0_16:
	ldr	x2, [x8]
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x22
	bl	_HPDF_Dict_AddName
	b	LBB0_18
LBB0_17:
	mov	w24, #0
LBB0_18:
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.19:
Lloh27:
	adrp	x1, l_.str.6@PAGE
Lloh28:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	bl	_HPDF_Dict_AddNumber
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.20:
Lloh29:
	adrp	x1, l_.str.7@PAGE
Lloh30:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_HPDF_Dict_AddNumber
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.21:
Lloh31:
	adrp	x1, l_.str.8@PAGE
Lloh32:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	bl	_HPDF_Dict_AddNumber
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.22:
	ldr	w0, [x22]
	mov	x1, x19
	mov	x2, x24
	bl	_HPDF_Stream_Write
	ldr	x8, [x26]
	cmp	x0, x8
	csel	x0, x22, xzr, eq
	b	LBB0_12
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_HPDF_OK,8,3                    ; @HPDF_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Image_LoadRawImageFromMem\n"

	.comm	_HPDF_INVALID_COLOR_SPACE,4,2   ; @HPDF_INVALID_COLOR_SPACE
	.comm	_HPDF_INVALID_IMAGE,4,2         ; @HPDF_INVALID_IMAGE
	.comm	_HPDF_OSUBCLASS_XOBJECT,4,2     ; @HPDF_OSUBCLASS_XOBJECT
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"

l_.str.5:                               ; @.str.5
	.asciz	"ColorSpace"

	.comm	_COL_GRAY,8,3                   ; @COL_GRAY
	.comm	_COL_RGB,8,3                    ; @COL_RGB
	.comm	_COL_CMYK,8,3                   ; @COL_CMYK
l_.str.6:                               ; @.str.6
	.asciz	"Width"

l_.str.7:                               ; @.str.7
	.asciz	"Height"

l_.str.8:                               ; @.str.8
	.asciz	"BitsPerComponent"

.subsections_via_symbols
