	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Load32BitImage                 ## -- Begin function Load32BitImage
	.p2align	4, 0x90
_Load32BitImage:                        ## @Load32BitImage
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-176(%rbp), %r13
	movq	%r13, %rsi
	callq	_ExtractFileExtension
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_Q_stricmp
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	-184(%rbp), %rsi
	leaq	-192(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	movq	%r15, %r8
	callq	_Load256Image
	testq	%r14, %r14
	je	LBB0_6
## %bb.3:
	movl	(%r15), %ebx
	imull	(%r12), %ebx
	leal	(,%rbx,4), %edi
	callq	_malloc
	movq	%rax, (%r14)
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.4:
	movq	-184(%rbp), %r8
	movq	-192(%rbp), %rdx
	movl	%ebx, %esi
	shlq	$2, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r8,%rdi), %rbx
	leaq	(%rbx,%rbx,2), %rbx
	movl	(%rdx,%rbx,4), %ecx
	movl	%ecx, (%rax,%rdi,4)
	movslq	%ebx, %rcx
	movl	4(%rdx,%rcx,4), %ebx
	movl	%ebx, 4(%rax,%rdi,4)
	movl	8(%rdx,%rcx,4), %ecx
	movl	%ecx, 8(%rax,%rdi,4)
	movl	$255, 12(%rax,%rdi,4)
	addq	$4, %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_5
	jmp	LBB0_6
LBB0_1:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_LoadTGA
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tga"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Load32BitImage                 ; -- Begin function Load32BitImage
	.p2align	2
_Load32BitImage:                        ; @Load32BitImage
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	add	x1, sp, #24
	bl	_ExtractFileExtension
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #24
	bl	_Q_stricmp
	cbz	w0, LBB0_5
; %bb.1:
	add	x1, sp, #8
	add	x2, sp, #16
	mov	x0, x22
	mov	x3, x21
	mov	x4, x20
	bl	_Load256Image
	cbz	x19, LBB0_6
; %bb.2:
	ldr	w8, [x21]
	ldr	w9, [x20]
	mul	w20, w9, w8
	lsl	w0, w20, #2
	bl	_malloc
	str	x0, [x19]
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.3:
	ldp	x8, x9, [sp, #8]
	add	x10, x0, #8
	mov	w11, #255
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x12, [x8], #4
	add	x12, x12, x12, lsl #1
	ldr	w13, [x9, x12, lsl #2]
	stur	w13, [x10, #-8]
	add	x12, x9, w12, sxtw #2
	ldr	w13, [x12, #4]
	stur	w13, [x10, #-4]
	ldr	w12, [x12, #8]
	stp	w12, w11, [x10], #16
	subs	x20, x20, #1
	b.ne	LBB0_4
	b	LBB0_6
LBB0_5:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	mov	x3, x20
	bl	_LoadTGA
LBB0_6:
	ldur	x8, [x29, #-40]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tga"

.subsections_via_symbols
