	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ReadImage
_ReadImage:                             ## @ReadImage
	.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, -56(%rbp)                 ## 4-byte Spill
	movq	%r8, %rbx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r15
	leaq	-41(%rbp), %rsi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_ReadOK
	testl	%eax, %eax
	je	LBB0_24
## %bb.1:
	movb	-41(%rbp), %al
	movq	_MAX_LWZ_BITS@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	ja	LBB0_24
## %bb.2:
	movq	_gdMaxColors@GOTPCREL(%rip), %r9
	movl	(%r9), %edi
	testl	%edi, %edi
	jle	LBB0_6
## %bb.3:
	xorl	%eax, %eax
	movq	_CM_RED@GOTPCREL(%rip), %r8
	movq	_CM_GREEN@GOTPCREL(%rip), %rdx
	movq	_CM_BLUE@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r8), %rdi
	shlq	$8, %rdi
	addq	%rbx, %rdi
	movzbl	(%rax,%rdi), %ecx
	movq	(%r15), %rdi
	movb	%cl, (%rdi,%rax)
	movq	(%rdx), %rcx
	shlq	$8, %rcx
	addq	%rbx, %rcx
	movzbl	(%rax,%rcx), %ecx
	movq	8(%r15), %rdi
	movb	%cl, (%rdi,%rax)
	movq	(%rsi), %rcx
	shlq	$8, %rcx
	addq	%rbx, %rcx
	movzbl	(%rax,%rcx), %ecx
	movq	16(%r15), %rdi
	movb	%cl, (%rdi,%rax)
	movq	24(%r15), %rcx
	movl	$1, (%rcx,%rax,4)
	incq	%rax
	movslq	(%r9), %rdi
	cmpq	%rdi, %rax
	jl	LBB0_4
## %bb.5:
	movb	-41(%rbp), %al
LBB0_6:
	movl	%edi, 32(%r15)
	movq	_TRUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movzbl	%al, %ecx
	leaq	-52(%rbp), %rsi
	movq	%r13, %rdi
	movq	16(%rbp), %r8
	callq	_LWZReadByte
	testl	%eax, %eax
	js	LBB0_24
## %bb.7:
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_25:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%r14d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_8 Depth=1
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jge	LBB0_23
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movzbl	-41(%rbp), %ecx
	movq	%r13, %rdi
	leaq	-52(%rbp), %rsi
	movq	16(%rbp), %r8
	callq	_LWZReadByte
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_23
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_gdMaxColors@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	$0, %ecx
	cmovgel	%ecx, %eax
	movq	24(%r15), %rcx
	cmpl	$0, (%rcx,%rax,4)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$0, (%rcx,%rax,4)
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_gdImageSetPixel
	incl	%r12d
	cmpl	-60(%rbp), %r12d                ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_25
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$2, %ebx
	jb	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$3, %ebx
	jne	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	addl	$2, %r14d
	jmp	LBB0_19
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	$8, %r14d
	jmp	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	$4, %r14d
LBB0_19:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%r12d, %r12d
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	jl	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$3, %ebx
	jae	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_8 Depth=1
	movslq	%ebx, %rax
	leaq	l_switch.table.ReadImage(%rip), %rcx
	movl	(%rcx,%rax,4), %r14d
	incl	%ebx
	jmp	LBB0_22
LBB0_23:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movzbl	-41(%rbp), %ecx
	leaq	-52(%rbp), %rsi
	movq	%r13, %rdi
	movq	16(%rbp), %r8
	callq	_LWZReadByte
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_LWZ_BITS,1,0               ## @MAX_LWZ_BITS
	.comm	_gdMaxColors,4,2                ## @gdMaxColors
	.comm	_CM_RED,8,3                     ## @CM_RED
	.comm	_CM_GREEN,8,3                   ## @CM_GREEN
	.comm	_CM_BLUE,8,3                    ## @CM_BLUE
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_ReadImage
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.ReadImage
l_switch.table.ReadImage:
	.long	4                               ## 0x4
	.long	2                               ## 0x2
	.long	1                               ## 0x1

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ReadImage
_ReadImage:                             ; @ReadImage
	.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, x6
	str	w5, [sp, #4]                    ; 4-byte Folded Spill
	mov	x25, x4
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x24, x0
	add	x1, sp, #15
	mov	x0, x20
	mov	w2, #1
	bl	_ReadOK
	cbz	w0, LBB0_26
; %bb.1:
	ldrb	w3, [sp, #15]
Lloh0:
	adrp	x8, _MAX_LWZ_BITS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_LWZ_BITS@GOTPAGEOFF]
	ldrb	w8, [x8]
	cmp	w3, w8
	b.hi	LBB0_26
; %bb.2:
Lloh2:
	adrp	x27, _gdMaxColors@GOTPAGE
Lloh3:
	ldr	x27, [x27, _gdMaxColors@GOTPAGEOFF]
	ldr	w13, [x27]
	cmp	w13, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x8, #0
Lloh4:
	adrp	x9, _CM_RED@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CM_RED@GOTPAGEOFF]
Lloh6:
	adrp	x10, _CM_GREEN@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CM_GREEN@GOTPAGEOFF]
	mov	w11, #1
Lloh8:
	adrp	x12, _CM_BLUE@GOTPAGE
Lloh9:
	ldr	x12, [x12, _CM_BLUE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x9]
	add	x13, x25, x13, lsl #8
	ldrb	w13, [x13, x8]
	ldr	x14, [x24]
	strb	w13, [x14, x8]
	ldr	x13, [x10]
	add	x13, x25, x13, lsl #8
	ldrb	w13, [x13, x8]
	ldr	x14, [x24, #8]
	strb	w13, [x14, x8]
	ldr	x13, [x12]
	add	x13, x25, x13, lsl #8
	ldrb	w13, [x13, x8]
	ldr	x14, [x24, #16]
	strb	w13, [x14, x8]
	ldr	x13, [x24, #24]
	str	w11, [x13, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x13, [x27]
	cmp	x8, x13
	b.lt	LBB0_4
; %bb.5:
	ldrb	w3, [sp, #15]
LBB0_6:
	str	w13, [x24, #32]
Lloh10:
	adrp	x8, _TRUE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x20
	mov	x4, x19
	bl	_LWZReadByte
	tbnz	w0, #31, LBB0_26
; %bb.7:
	mov	w26, #0
	mov	w25, #0
	mov	w28, #0
Lloh13:
	adrp	x21, _FALSE@GOTPAGE
Lloh14:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	w26, #0
	add	w25, w25, #1
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	cmp	w25, w22
	b.ge	LBB0_25
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x21]
	ldrb	w3, [sp, #15]
	add	x1, sp, #8
	mov	x0, x20
	mov	x4, x19
	bl	_LWZReadByte
	tbnz	w0, #31, LBB0_25
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x27]
	cmp	w0, w8
	csel	w3, w0, wzr, lt
	ldr	x8, [x24, #24]
	ldr	w9, [x8, w3, uxtw #2]
	cbz	w9, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	str	wzr, [x8, x3, lsl #2]
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x24
	mov	x1, x26
	mov	x2, x25
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_gdImageSetPixel
	add	w26, w26, #1
	cmp	w26, w23
	b.ne	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_8
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w28, #2
	b.lo	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	b.eq	LBB0_22
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w28, #3
	b.ne	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w25, w25, #2
	cmp	w25, w22
	b.lt	LBB0_21
	b	LBB0_23
LBB0_19:                                ;   in Loop: Header=BB0_10 Depth=1
	add	w25, w25, #8
LBB0_20:                                ;   in Loop: Header=BB0_10 Depth=1
	cmp	w25, w22
	b.ge	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w26, #0
	b	LBB0_9
LBB0_22:                                ;   in Loop: Header=BB0_10 Depth=1
	add	w25, w25, #4
	cmp	w25, w22
	b.lt	LBB0_21
LBB0_23:                                ;   in Loop: Header=BB0_10 Depth=1
	cmp	w28, #3
	b.hs	LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w26, #0
Lloh15:
	adrp	x8, l_switch.table.ReadImage@PAGE
Lloh16:
	add	x8, x8, l_switch.table.ReadImage@PAGEOFF
	ldr	w25, [x8, w28, sxtw #2]
	add	w28, w28, #1
	b	LBB0_9
LBB0_25:
	ldr	w2, [x21]
	ldrb	w3, [sp, #15]
	add	x1, sp, #8
	mov	x0, x20
	mov	x4, x19
	bl	_LWZReadByte
LBB0_26:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_LWZ_BITS,1,0               ; @MAX_LWZ_BITS
	.comm	_gdMaxColors,4,2                ; @gdMaxColors
	.comm	_CM_RED,8,3                     ; @CM_RED
	.comm	_CM_GREEN,8,3                   ; @CM_GREEN
	.comm	_CM_BLUE,8,3                    ; @CM_BLUE
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_ReadImage
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.ReadImage
l_switch.table.ReadImage:
	.long	4                               ; 0x4
	.long	2                               ; 0x2
	.long	1                               ; 0x1

.subsections_via_symbols
