	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _gd2CreateFromFile
__gd2CreateFromFile:                    ## @_gd2CreateFromFile
	.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
	movq	%r9, %rbx
	movq	%r8, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movl	%edi, %r14d
	movq	32(%rbp), %rax
	movaps	16(%rbp), %xmm0
	movq	%rax, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	__gd2GetHeader
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.3:
	movl	(%rbx), %edi
	callq	_gd2_truecolor
	movl	(%r13), %edi
	movl	(%r12), %esi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_gdImageCreateTrueColor
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	jmp	LBB0_2
LBB0_5:
	callq	_gdImageCreate
LBB0_6:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	xorl	%edx, %edx
	cmpl	$2, (%r15)
	sete	%dl
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	__gdGetColors
	testl	%eax, %eax
	je	LBB0_9
## %bb.12:
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
LBB0_2:
	movl	%eax, %edi
	callq	_GD2_DBG
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movq	%rbx, %rdi
	callq	_gdImageDestroy
LBB0_10:
	movq	32(%rbp), %rax
	movq	(%rax), %rdi
	callq	_gdFree
	xorl	%ebx, %ebx
LBB0_11:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad GD2 header"

L_.str.1:                               ## @.str.1
	.asciz	"Could not create gdImage"

L_.str.2:                               ## @.str.2
	.asciz	"Could not read color palette"

L_.str.3:                               ## @.str.3
	.asciz	"Image palette completed: %d colours"

	.no_dead_strip	__gd2CreateFromFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _gd2CreateFromFile
__gd2CreateFromFile:                    ; @_gd2CreateFromFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x23, x5
	mov	x20, x4
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x24, [x29, #16]
	str	x24, [sp]
	bl	__gd2GetHeader
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.1:
	ldr	w0, [x23]
	bl	_gd2_truecolor
	mov	x8, x0
	ldr	w0, [x22]
	ldr	w1, [x21]
	cbz	x8, LBB0_6
; %bb.2:
	bl	_gdImageCreateTrueColor
	mov	x21, x0
	cbz	x0, LBB0_7
LBB0_3:
	ldr	w8, [x20]
	cmp	w8, #2
	cset	w2, eq
	mov	x0, x19
	mov	x1, x21
	bl	__gdGetColors
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w8, [x21]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str.3@PAGE
Lloh1:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	b	LBB0_11
LBB0_5:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	b	LBB0_10
LBB0_6:
	bl	_gdImageCreate
	mov	x21, x0
	cbnz	x0, LBB0_3
LBB0_7:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	b	LBB0_9
LBB0_8:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	x0, x21
	bl	_gdImageDestroy
LBB0_9:
	ldr	x0, [x24]
	bl	_gdFree
LBB0_10:
	mov	x21, #0
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad GD2 header"

l_.str.1:                               ; @.str.1
	.asciz	"Could not create gdImage"

l_.str.2:                               ; @.str.2
	.asciz	"Could not read color palette"

l_.str.3:                               ; @.str.3
	.asciz	"Image palette completed: %d colours"

	.no_dead_strip	__gd2CreateFromFile
.subsections_via_symbols
