	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bmp_read_direct
_bmp_read_direct:                       ## @bmp_read_direct
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, -68(%rbp)                 ## 4-byte Spill
	movl	$0, -72(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movw	$0, -42(%rbp)
	movl	(%rdx), %eax
	leaq	L_.str.4(%rip), %rdi
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_32
## %bb.1:
	movq	%rcx, %r15
	movq	%rdx, %r14
	movl	%esi, %r12d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	cmpl	$8, 4(%r14)
	je	LBB0_5
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_32
LBB0_4:
	cmpl	$4, 4(%r14)
	jne	LBB0_31
LBB0_5:
	movl	%r12d, %edi
	callq	_gdTell
	movq	(%r15), %rsi
	cmpq	%rsi, %rax
	je	LBB0_7
## %bb.6:
	movl	%r12d, %edi
	callq	_gdSeek
	testl	%eax, %eax
	je	LBB0_33
LBB0_7:
	movl	4(%r14), %ecx
	movl	8(%r14), %eax
	leal	7(%rcx), %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	sarl	$3, %esi
	imull	%eax, %esi
	leal	3(%rsi), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	movl	12(%r14), %ecx
	testl	%ecx, %ecx
	jle	LBB0_30
## %bb.8:
	andl	$-4, %edx
	subl	%edx, %esi
	movl	$5, %edx
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	subl	%esi, %edx
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
                                        ##     Child Loop BB0_25 Depth 2
	movl	%r13d, %ebx
	notl	%ebx
	addl	%ecx, %ebx
	cmpq	$0, 16(%r14)
	movl	%r13d, -64(%rbp)                ## 4-byte Spill
	cmovnel	%r13d, %ebx
	testl	%eax, %eax
	jle	LBB0_24
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_14 Depth=2
	leaq	-48(%rbp), %rdi
LBB0_12:                                ##   in Loop: Header=BB0_14 Depth=2
	movl	%r12d, %esi
	callq	_gdGetByte
	testl	%eax, %eax
	je	LBB0_34
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=2
	movl	-48(%rbp), %edi
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %edx
	callq	_gdTrueColor
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_gdImageSetPixel
	incl	%r13d
	cmpl	8(%r14), %r13d
	jge	LBB0_24
LBB0_14:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	4(%r14), %eax
	cmpl	$24, %eax
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	cmpl	$16, %eax
	jne	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=2
	leaq	-42(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetWordLSB
	testl	%eax, %eax
	je	LBB0_33
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=2
	movswl	-42(%rbp), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	movzwl	-42(%rbp), %eax
	movl	%eax, %esi
	shrl	$7, %esi
	andl	$248, %esi
	movl	%esi, -48(%rbp)
	movl	%eax, %edx
	shrl	$2, %edx
	andl	$248, %edx
	movl	%edx, -56(%rbp)
	shll	$3, %eax
	movzbl	%al, %ecx
	movl	%ecx, -52(%rbp)
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=2
	leaq	-52(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	movl	$1, %r15d
	testl	%eax, %eax
	je	LBB0_34
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=2
	leaq	-56(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	testl	%eax, %eax
	jne	LBB0_11
	jmp	LBB0_34
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_14 Depth=2
	leaq	-52(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	movl	$1, %r15d
	testl	%eax, %eax
	je	LBB0_34
## %bb.21:                              ##   in Loop: Header=BB0_14 Depth=2
	leaq	-56(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	testl	%eax, %eax
	je	LBB0_34
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=2
	leaq	-48(%rbp), %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	testl	%eax, %eax
	je	LBB0_34
## %bb.23:                              ##   in Loop: Header=BB0_14 Depth=2
	leaq	-72(%rbp), %rdi
	jmp	LBB0_12
LBB0_24:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	cmpl	$0, -80(%rbp)                   ## 4-byte Folded Reload
	leaq	-48(%rbp), %r15
	movl	-64(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_27
	.p2align	4, 0x90
LBB0_25:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_gdGetByte
	testl	%eax, %eax
	je	LBB0_33
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=2
	decl	%ebx
	cmpl	$2, %ebx
	jge	LBB0_25
LBB0_27:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%r13d
	movl	12(%r14), %ecx
	cmpl	%r13d, %ecx
	jle	LBB0_30
## %bb.28:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%r14), %eax
	jmp	LBB0_9
LBB0_29:
	cmpl	$24, 4(%r14)
	leaq	L_.str(%rip), %rax
	leaq	L_.str.1(%rip), %rdi
	cmoveq	%rax, %rdi
	jmp	LBB0_32
LBB0_30:
	xorl	%r15d, %r15d
	jmp	LBB0_34
LBB0_31:
	leaq	L_.str.3(%rip), %rdi
LBB0_32:
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_BMP_DEBUG
LBB0_33:
	movl	$1, %r15d
LBB0_34:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_32, LBB0_32-LJTI0_0
.set L0_0_set_29, LBB0_29-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_32
	.long	L0_0_set_32
	.long	L0_0_set_29
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bitfield compression isn't supported for 24-bit\n"

L_.str.1:                               ## @.str.1
	.asciz	"Currently no bitfield support\n"

L_.str.2:                               ## @.str.2
	.asciz	"RLE is only valid for 8-bit images\n"

L_.str.3:                               ## @.str.3
	.asciz	"RLE is only valid for 4-bit images\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unsupported BMP compression format\n"

L_.str.5:                               ## @.str.5
	.asciz	"Data: %X\n"

L_.str.6:                               ## @.str.6
	.asciz	"R: %d, G: %d, B: %d\n"

	.no_dead_strip	_bmp_read_direct
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bmp_read_direct
_bmp_read_direct:                       ; @bmp_read_direct
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x0
	stp	xzr, xzr, [sp, #32]
	strh	wzr, [sp, #30]
	ldr	w8, [x2]
Lloh0:
	adrp	x0, l_.str.4@PAGE
Lloh1:
	add	x0, x0, l_.str.4@PAGEOFF
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_43
; %bb.1:
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
Lloh2:
	adrp	x9, lJTI0_0@PAGE
Lloh3:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w8, [x19, #4]
	cmp	w8, #8
	b.eq	LBB0_5
; %bb.3:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_43
LBB0_4:
	ldr	w8, [x19, #4]
	cmp	w8, #4
	b.ne	LBB0_42
LBB0_5:
	mov	x0, x20
	bl	_gdTell
	ldr	x1, [x22]
	cmp	x0, x1
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_gdSeek
	cbz	w0, LBB0_44
LBB0_7:
	ldp	w9, w8, [x19, #4]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #3
	mul	w9, w9, w8
	and	w10, w9, #0x3
	negs	w9, w9
	and	w9, w9, #0x3
	csneg	w26, w10, w9, mi
	ldr	w9, [x19, #12]
	cmp	w9, #1
	b.lt	LBB0_41
; %bb.8:
	mov	w27, #0
Lloh6:
	adrp	x22, l_.str.5@PAGE
Lloh7:
	add	x22, x22, l_.str.5@PAGEOFF
Lloh8:
	adrp	x23, l_.str.6@PAGE
Lloh9:
	add	x23, x23, l_.str.6@PAGEOFF
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x10, [x19, #16]
	mvn	w11, w27
	add	w9, w9, w11
	cmp	x10, #0
	csel	w24, w9, w27, eq
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w25, #0
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #40
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=2
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=2
	ldp	w1, w0, [sp, #36]
	ldr	w2, [sp, #32]
	bl	_gdTrueColor
	mov	x3, x0
	mov	x0, x21
	mov	x1, x25
	mov	x2, x24
	bl	_gdImageSetPixel
	add	w25, w25, #1
	ldr	w8, [x19, #8]
	cmp	w25, w8
	b.ge	LBB0_24
LBB0_14:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x19, #4]
	cmp	w8, #24
	b.eq	LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	cmp	w8, #16
	b.ne	LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #30
	mov	x1, x20
	bl	_gdGetWordLSB
	cbz	w0, LBB0_44
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=2
	ldrsh	x8, [sp, #30]
	str	x8, [sp]
	mov	x0, x22
	bl	_printf
	bl	_BMP_DEBUG
	ldrh	w8, [sp, #30]
	lsr	w9, w8, #7
	and	w9, w9, #0xf8
	lsr	w10, w8, #2
	and	w10, w10, #0xf8
	stp	w10, w9, [sp, #36]
	ubfiz	w8, w8, #3, #5
	str	w8, [sp, #32]
	stp	x10, x8, [sp, #8]
	str	x9, [sp]
	mov	x0, x23
	bl	_printf
	bl	_BMP_DEBUG
	b	LBB0_13
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #32
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #36
	mov	x1, x20
	bl	_gdGetByte
	cbnz	w0, LBB0_11
	b	LBB0_44
LBB0_20:                                ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #32
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.21:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #36
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.22:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.23:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x0, sp, #44
	b	LBB0_12
LBB0_24:                                ;   in Loop: Header=BB0_9 Depth=1
	cbz	w26, LBB0_38
; %bb.25:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.26:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w26, #2
	b.gt	LBB0_38
; %bb.27:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.28:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w26, #1
	b.gt	LBB0_38
; %bb.29:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.30:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w26, #0
	b.gt	LBB0_38
; %bb.31:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.32:                               ;   in Loop: Header=BB0_9 Depth=1
	tbz	w26, #31, LBB0_38
; %bb.33:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.34:                               ;   in Loop: Header=BB0_9 Depth=1
	cmn	w26, #2
	b.gt	LBB0_38
; %bb.35:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
; %bb.36:                               ;   in Loop: Header=BB0_9 Depth=1
	cmn	w26, #3
	b.gt	LBB0_38
; %bb.37:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x0, sp, #40
	mov	x1, x20
	bl	_gdGetByte
	cbz	w0, LBB0_44
LBB0_38:                                ;   in Loop: Header=BB0_9 Depth=1
	add	w27, w27, #1
	ldr	w9, [x19, #12]
	cmp	w9, w27
	b.le	LBB0_41
; %bb.39:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x19, #8]
	b	LBB0_9
LBB0_40:
	ldr	w8, [x19, #4]
Lloh10:
	adrp	x9, l_.str.1@PAGE
Lloh11:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh12:
	adrp	x10, l_.str@PAGE
Lloh13:
	add	x10, x10, l_.str@PAGEOFF
	cmp	w8, #24
	csel	x0, x10, x9, eq
	b	LBB0_43
LBB0_41:
	mov	w0, #0
	b	LBB0_45
LBB0_42:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_43:
	bl	_printf
	bl	_BMP_DEBUG
LBB0_44:
	mov	w0, #1
LBB0_45:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_43-LBB0_2)>>2
	.byte	(LBB0_43-LBB0_2)>>2
	.byte	(LBB0_40-LBB0_2)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bitfield compression isn't supported for 24-bit\n"

l_.str.1:                               ; @.str.1
	.asciz	"Currently no bitfield support\n"

l_.str.2:                               ; @.str.2
	.asciz	"RLE is only valid for 8-bit images\n"

l_.str.3:                               ; @.str.3
	.asciz	"RLE is only valid for 4-bit images\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unsupported BMP compression format\n"

l_.str.5:                               ; @.str.5
	.asciz	"Data: %X\n"

l_.str.6:                               ; @.str.6
	.asciz	"R: %d, G: %d, B: %d\n"

	.no_dead_strip	_bmp_read_direct
.subsections_via_symbols
