	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadBMP                        ## -- Begin function LoadBMP
	.p2align	4, 0x90
_LoadBMP:                               ## @LoadBMP
	.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
	pushq	%rax
	movl	$4168, %eax                     ## imm = 0x1048
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -4184(%rbp)                ## 8-byte Spill
	movq	%rcx, -4200(%rbp)               ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, -4176(%rbp)               ## 8-byte Spill
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
LBB0_2:
	movq	%rbx, -4168(%rbp)               ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	cmpl	$19778, %eax                    ## imm = 0x4D42
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
LBB0_4:
	movq	-4168(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_fgetLittleLong
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movq	%rbx, %rdi
	callq	_fgetLittleLong
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_fgetLittleLong
	cmpl	$12, %eax
	movl	%r12d, -4188(%rbp)              ## 4-byte Spill
	je	LBB0_9
## %bb.5:
	cmpl	$40, %eax
	jne	LBB0_13
## %bb.6:
	movq	-4168(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_fgetLittleLong
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_fgetLittleLong
	movl	%eax, -4156(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, -4148(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, -4152(%rbp)               ## 4-byte Spill
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_fseek
	testq	%r15, %r15
	je	LBB0_10
## %bb.7:
	leaq	-4144(%rbp), %rdi
	movl	$1, %esi
	movl	$1024, %edx                     ## imm = 0x400
	movq	%rbx, %rcx
	callq	_fread
	movl	$768, %edi                      ## imm = 0x300
	callq	_malloc
	movq	%rax, (%r15)
	leaq	-4136(%rbp), %rcx
	movl	$8, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %esi
	movl	%esi, -8(%rax,%rdx)
	movl	-4(%rcx), %esi
	movl	%esi, -4(%rax,%rdx)
	movl	-8(%rcx), %esi
	movl	%esi, (%rax,%rdx)
	addq	$12, %rdx
	addq	$16, %rcx
	cmpq	$3080, %rdx                     ## imm = 0xC08
	jne	LBB0_8
	jmp	LBB0_10
LBB0_9:
	movq	-4168(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, -4156(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, -4148(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_fgetLittleShort
	movl	%eax, -4152(%rbp)               ## 4-byte Spill
	testq	%r15, %r15
	je	LBB0_10
## %bb.11:
	leaq	-4144(%rbp), %rdi
	movl	$1, %esi
	movl	$768, %edx                      ## imm = 0x300
	movq	%rbx, %rcx
	callq	_fread
	movl	$768, %edi                      ## imm = 0x300
	callq	_malloc
	movq	%rax, (%r15)
	movl	$20, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	-4156(%rbp,%rcx), %edx
	movl	%edx, -20(%rax,%rcx)
	movl	-4160(%rbp,%rcx), %edx
	movl	%edx, -16(%rax,%rcx)
	movl	-4164(%rbp,%rcx), %edx
	movl	%edx, -12(%rax,%rcx)
	movl	-4144(%rbp,%rcx), %edx
	movl	%edx, -8(%rax,%rcx)
	movl	-4148(%rbp,%rcx), %edx
	movl	%edx, -4(%rax,%rcx)
	movl	-4152(%rbp,%rcx), %edx
	movl	%edx, (%rax,%rcx)
	addq	$24, %rcx
	cmpq	$3092, %rcx                     ## imm = 0xC14
	jne	LBB0_12
LBB0_10:
	movq	-4176(%rbp), %r13               ## 8-byte Reload
	movl	-4152(%rbp), %ebx               ## 4-byte Reload
	movl	-4148(%rbp), %eax               ## 4-byte Reload
	cmpl	$1, %eax
	jne	LBB0_14
## %bb.15:
	cmpl	$8, %ebx
	je	LBB0_17
LBB0_16:
	leaq	L_.str.5(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
LBB0_17:
	movl	-4156(%rbp), %eax               ## 4-byte Reload
	movl	%eax, %r15d
	negl	%r15d
	cmovsl	%eax, %r15d
	testl	%eax, %eax
	movq	-4184(%rbp), %rcx               ## 8-byte Reload
	jns	LBB0_18
## %bb.19:
	movq	_qtrue@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	movq	_qfalse@GOTPCREL(%rip), %rax
LBB0_20:
	movq	-4168(%rbp), %r14               ## 8-byte Reload
	movq	(%rax), %rdx
	movq	-4200(%rbp), %rax               ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movl	%r12d, (%rax)
LBB0_22:
	testq	%rcx, %rcx
	je	LBB0_24
## %bb.23:
	movl	%r15d, (%rcx)
LBB0_24:
	testq	%r13, %r13
	je	LBB0_30
## %bb.25:
	movq	%r13, %rbx
	movl	%r12d, %r14d
	imull	%r15d, %r14d
	movl	%r14d, %edi
	movq	%rdx, -4184(%rbp)               ## 8-byte Spill
	callq	_malloc
	movq	%rax, %r13
	movq	%rax, (%rbx)
	movq	-4168(%rbp), %rbx               ## 8-byte Reload
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	-4188(%rbp), %esi               ## 4-byte Reload
	callq	_fseek
	cmpq	$0, -4184(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_29
## %bb.26:
	cmpl	$0, -4156(%rbp)                 ## 4-byte Folded Reload
	movq	%rbx, %r14
	je	LBB0_30
## %bb.27:
	cmpl	$2, %r15d
	movl	$1, %ebx
	cmovael	%r15d, %ebx
	decl	%r15d
	imull	%r12d, %r15d
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r15d, %r15
	leaq	(,%r15,4), %rdi
	addq	%r13, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	movq	%r14, %rcx
	callq	_fread
	subl	%r12d, %r15d
	decq	%rbx
	jne	LBB0_28
	jmp	LBB0_30
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
                                        ## implicit-def: $ebx
                                        ## implicit-def: $eax
                                        ## kill: killed $eax
                                        ## implicit-def: $r12d
	movq	-4176(%rbp), %r13               ## 8-byte Reload
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	callq	_Error
	cmpl	$8, %ebx
	jne	LBB0_16
	jmp	LBB0_17
LBB0_29:
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%r14d, %edx
	movq	%rbx, %rcx
	callq	_fread
	movq	%rbx, %r14
LBB0_30:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_31
## %bb.32:
	movq	%r14, %rdi
	addq	$4168, %rsp                     ## imm = 0x1048
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fclose                         ## TAILCALL
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

L_.str.1:                               ## @.str.1
	.asciz	"Couldn't read %s"

L_.str.2:                               ## @.str.2
	.asciz	"%s is not a bmp file"

	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
L_.str.3:                               ## @.str.3
	.asciz	"%s had strange struct size"

L_.str.4:                               ## @.str.4
	.asciz	"%s was not a single plane image"

L_.str.5:                               ## @.str.5
	.asciz	"%s was not an 8 bit image"

	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadBMP                        ; -- Begin function LoadBMP
	.p2align	2
_LoadBMP:                               ; @LoadBMP
	.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	w9, #4128
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #1, lsl #12             ; =4096
	sub	sp, sp, #32
	mov	x21, x4
	mov	x22, x3
	mov	x28, x2
	mov	x25, x1
	mov	x23, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_Error
LBB0_2:
	mov	x0, x19
	bl	_fgetLittleShort
	mov	w8, #19778
	cmp	w0, w8
	b.eq	LBB0_4
; %bb.3:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x23
	bl	_Error
LBB0_4:
	mov	x0, x19
	bl	_fgetLittleLong
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x0, x19
	bl	_fgetLittleLong
	mov	x20, x0
	mov	x0, x19
	bl	_fgetLittleLong
	cmp	w0, #12
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	b.eq	LBB0_10
; %bb.5:
	cmp	w0, #40
	b.ne	LBB0_26
; %bb.6:
	mov	x0, x19
	bl	_fgetLittleLong
	mov	x24, x0
	mov	x0, x19
	bl	_fgetLittleLong
	mov	x26, x0
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x20, x0
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x27, x0
Lloh11:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #24
	bl	_fseek
	cbz	x28, LBB0_14
; %bb.7:
	str	w20, [sp, #8]                   ; 4-byte Folded Spill
	str	x25, [sp]                       ; 8-byte Folded Spill
	add	x8, sp, #16
	add	x25, x8, #4036
	add	x20, sp, #16
	add	x0, sp, #16
	mov	w1, #1
	mov	w2, #1024
	mov	x3, x19
	bl	_fread
	mov	w0, #768
	bl	_malloc
	mov	x9, #0
	add	x8, x0, #3036
	str	x0, [x28]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ld4.4s	{ v0, v1, v2, v3 }, [x20], #64
	mov.16b	v4, v2
	mov.16b	v5, v1
	mov.16b	v6, v0
	add	x10, x0, x9
	st3.4s	{ v4, v5, v6 }, [x10]
	add	x9, x9, #48
	cmp	x9, #3024
	b.ne	LBB0_8
; %bb.9:
	ldr	d0, [x25]
	rev64.2s	v0, v0
	str	d0, [x0, #3024]
	ldr	w9, [sp, #4048]
	str	w9, [x0, #3032]
	ldr	d0, [x25, #16]
	rev64.2s	v0, v0
	str	d0, [x8]
	ldr	w9, [sp, #4064]
	str	w9, [x0, #3044]
	ldr	d0, [x25, #32]
	rev64.2s	v0, v0
	str	d0, [x0, #3048]
	ldr	w9, [sp, #4080]
	str	w9, [x0, #3056]
	ldr	d0, [x25, #48]
	rev64.2s	v0, v0
	str	d0, [x8, #24]
	ldr	w8, [sp, #4096]
	str	w8, [x0, #3068]
	ldr	x25, [sp]                       ; 8-byte Folded Reload
	b	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x24, x0
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x26, x0
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x20, x0
	mov	x0, x19
	bl	_fgetLittleShort
	mov	x27, x0
	cbz	x28, LBB0_14
; %bb.11:
	str	w20, [sp, #8]                   ; 4-byte Folded Spill
	add	x20, sp, #16
	add	x0, sp, #16
	mov	w1, #1
	mov	w2, #768
	mov	x3, x19
	bl	_fread
	mov	w0, #768
	bl	_malloc
	mov	x8, #0
	str	x0, [x28]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	add	x9, x20, x8
	ld3.4s	{ v0, v1, v2 }, [x9]
	mov.16b	v3, v2
	mov.16b	v4, v1
	mov.16b	v5, v0
	add	x9, x0, x8
	st3.4s	{ v3, v4, v5 }, [x9]
	add	x8, x8, #48
	cmp	x8, #3072
	b.ne	LBB0_12
LBB0_13:
	ldr	w20, [sp, #8]                   ; 4-byte Folded Reload
LBB0_14:
	cmp	w20, #1
	b.ne	LBB0_27
; %bb.15:
	cmp	w27, #8
	b.eq	LBB0_17
LBB0_16:
Lloh14:
	adrp	x0, l_.str.5@PAGE
Lloh15:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x23
	bl	_Error
LBB0_17:
	cmp	w26, #0
	cneg	w20, w26, mi
Lloh16:
	adrp	x8, _qtrue@GOTPAGE
Lloh17:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh18:
	adrp	x9, _qfalse@GOTPAGE
Lloh19:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
	csel	x8, x8, x9, lt
	ldr	x23, [x8]
	cbz	x22, LBB0_19
; %bb.18:
	str	w24, [x22]
LBB0_19:
	cbz	x21, LBB0_21
; %bb.20:
	str	w20, [x21]
LBB0_21:
	cbz	x25, LBB0_29
; %bb.22:
	mul	w22, w24, w20
	mov	x0, x22
	bl	_malloc
	mov	x21, x0
	str	x0, [x25]
Lloh20:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	bl	_fseek
	cbz	x23, LBB0_28
; %bb.23:
	cbz	w26, LBB0_29
; %bb.24:
	subs	w8, w20, #1
	csinc	w20, w20, wzr, hi
	mul	w22, w24, w8
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	add	x0, x21, w22, sxtw #2
	mov	w1, #1
	mov	x2, x24
	mov	x3, x19
	bl	_fread
	sub	w22, w22, w24
	subs	x20, x20, #1
	b.ne	LBB0_25
	b	LBB0_29
LBB0_26:
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	bl	_Error
                                        ; implicit-def: $w27
                                        ; implicit-def: $w26
                                        ; implicit-def: $w24
LBB0_27:
Lloh25:
	adrp	x0, l_.str.4@PAGE
Lloh26:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x23
	bl	_Error
	cmp	w27, #8
	b.ne	LBB0_16
	b	LBB0_17
LBB0_28:
	mov	x0, x21
	mov	w1, #1
	mov	x2, x22
	mov	x3, x19
	bl	_fread
LBB0_29:
	ldur	x8, [x29, #-96]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.30:
	mov	x0, x19
	add	sp, sp, #1, lsl #12             ; =4096
	add	sp, sp, #32
	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
	b	_fclose
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

l_.str.1:                               ; @.str.1
	.asciz	"Couldn't read %s"

l_.str.2:                               ; @.str.2
	.asciz	"%s is not a bmp file"

	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
l_.str.3:                               ; @.str.3
	.asciz	"%s had strange struct size"

l_.str.4:                               ; @.str.4
	.asciz	"%s was not a single plane image"

l_.str.5:                               ; @.str.5
	.asciz	"%s was not an 8 bit image"

	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
.subsections_via_symbols
