	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageCreateFromBmpCtx        ## -- Begin function gdImageCreateFromBmpCtx
	.p2align	4, 0x90
_gdImageCreateFromBmpCtx:               ## @gdImageCreateFromBmpCtx
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movl	$1, %edi
	movl	$28, %esi
	callq	_gdCalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movl	%r15d, %edi
	movq	%rax, %rsi
	callq	_bmp_read_header
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	cmpl	$19778, (%rbx)                  ## imm = 0x4D42
	jne	LBB0_6
## %bb.3:
	movl	$1, %edi
	movl	$28, %esi
	callq	_gdCalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, %r14
	movl	%r15d, %edi
	movq	%rax, %rsi
	callq	_bmp_read_info
	testq	%rax, %rax
	je	LBB0_10
LBB0_5:
	movq	%rbx, %rdi
	callq	_gdFree
	movq	%r14, %rdi
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
LBB0_7:
	callq	_gdFree
LBB0_8:
	xorl	%r12d, %r12d
LBB0_9:
	movq	%r12, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	4(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	8(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	12(%r14), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	16(%r14), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	20(%r14), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	24(%rbx), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	cmpl	$16, 20(%r14)
	movl	8(%r14), %edi
	movl	12(%r14), %esi
	jl	LBB0_12
## %bb.11:
	callq	_gdImageCreateTrueColor
	jmp	LBB0_13
LBB0_12:
	callq	_gdImageCreate
LBB0_13:
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_5
## %bb.14:
	movl	20(%r14), %eax
	decl	%eax
	cmpl	$31, %eax
	ja	LBB0_18
## %bb.15:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_16:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_bmp_read_direct
	jmp	LBB0_21
LBB0_17:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_bmp_read_1bit
	jmp	LBB0_21
LBB0_18:
	leaq	L_.str.10(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movl	$1, %r15d
	jmp	LBB0_22
LBB0_19:
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_bmp_read_8bit
	jmp	LBB0_21
LBB0_20:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	_bmp_read_4bit
LBB0_21:
	movl	%eax, %r15d
LBB0_22:
	movq	%rbx, %rdi
	callq	_gdFree
	movq	%r14, %rdi
	callq	_gdFree
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.23:
	movq	%r12, %rdi
	callq	_gdImageDestroy
	jmp	LBB0_8
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_17, LBB0_17-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
LJTI0_0:
	.long	L0_0_set_17
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_20
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_19
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_16
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_16
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_18
	.long	L0_0_set_16
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Numcolours: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Width: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Height: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Planes: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Depth: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Offset: %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"1-bit image\n"

L_.str.7:                               ## @.str.7
	.asciz	"4-bit image\n"

L_.str.8:                               ## @.str.8
	.asciz	"8-bit image\n"

L_.str.9:                               ## @.str.9
	.asciz	"Direct BMP image\n"

L_.str.10:                              ## @.str.10
	.asciz	"Unknown bit count\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageCreateFromBmpCtx        ; -- Begin function gdImageCreateFromBmpCtx
	.p2align	2
_gdImageCreateFromBmpCtx:               ; @gdImageCreateFromBmpCtx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x0
	mov	w0, #1
	mov	w1, #28
	bl	_gdCalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	mov	x0, x21
	mov	x1, x19
	bl	_bmp_read_header
	cbnz	x0, LBB0_6
; %bb.2:
	ldr	w8, [x19]
	mov	w9, #19778
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
	mov	w0, #1
	mov	w1, #28
	bl	_gdCalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x20, x0
	mov	x0, x21
	mov	x1, x20
	bl	_bmp_read_info
	cbz	x0, LBB0_10
; %bb.5:
	mov	x0, x19
	bl	_gdFree
	mov	x0, x20
	b	LBB0_7
LBB0_6:
	mov	x0, x19
LBB0_7:
	bl	_gdFree
LBB0_8:
	mov	x22, #0
LBB0_9:
	mov	x0, x22
	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
	add	sp, sp, #64
	ret
LBB0_10:
	ldr	w8, [x20, #4]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x20, #8]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x20, #12]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x20, #16]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x20, #20]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x19, #24]
	str	x8, [sp]
Lloh10:
	adrp	x0, l_.str.5@PAGE
Lloh11:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	ldr	w8, [x20, #20]
	ldp	w0, w1, [x20, #8]
	cmp	w8, #16
	b.lt	LBB0_12
; %bb.11:
	bl	_gdImageCreateTrueColor
	b	LBB0_13
LBB0_12:
	bl	_gdImageCreate
LBB0_13:
	mov	x22, x0
	cbz	x0, LBB0_17
; %bb.14:
	ldr	w8, [x20, #20]
	sub	w8, w8, #1
	cmp	w8, #31
	b.hi	LBB0_19
; %bb.15:
Lloh12:
	adrp	x9, lJTI0_0@PAGE
Lloh13:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_16
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_16:
Lloh14:
	adrp	x0, l_.str.9@PAGE
Lloh15:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_bmp_read_direct
	b	LBB0_22
LBB0_17:
	mov	x0, x19
	bl	_gdFree
	mov	x0, x20
	bl	_gdFree
	b	LBB0_9
LBB0_18:
Lloh16:
	adrp	x0, l_.str.6@PAGE
Lloh17:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_bmp_read_1bit
	b	LBB0_22
LBB0_19:
Lloh18:
	adrp	x0, l_.str.10@PAGE
Lloh19:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	mov	w21, #1
	b	LBB0_23
LBB0_20:
Lloh20:
	adrp	x0, l_.str.8@PAGE
Lloh21:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_bmp_read_8bit
	b	LBB0_22
LBB0_21:
Lloh22:
	adrp	x0, l_.str.7@PAGE
Lloh23:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_printf
	bl	_BMP_DEBUG
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_bmp_read_4bit
LBB0_22:
	mov	x21, x0
LBB0_23:
	mov	x0, x19
	bl	_gdFree
	mov	x0, x20
	bl	_gdFree
	cbz	w21, LBB0_9
; %bb.24:
	mov	x0, x22
	bl	_gdImageDestroy
	b	LBB0_8
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_18-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_21-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_20-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_19-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Numcolours: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Width: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Height: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Planes: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Depth: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Offset: %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"1-bit image\n"

l_.str.7:                               ; @.str.7
	.asciz	"4-bit image\n"

l_.str.8:                               ; @.str.8
	.asciz	"8-bit image\n"

l_.str.9:                               ; @.str.9
	.asciz	"Direct BMP image\n"

l_.str.10:                              ; @.str.10
	.asciz	"Unknown bit count\n"

.subsections_via_symbols
