	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_LoadImage                    ## -- Begin function R_LoadImage
	.p2align	4, 0x90
_R_LoadImage:                           ## @R_LoadImage
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, (%rsi)
	movl	$0, (%rdx)
	movl	$0, (%rcx)
	callq	_strlen
	cmpl	$5, %eax
	jge	LBB0_1
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.5:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%eax, %eax
	leaq	(%rax,%r13), %rbx
	addq	$-4, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_Q_stricmp
	testl	%eax, %eax
	je	LBB0_2
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_Q_stricmp
	testl	%eax, %eax
	je	LBB0_7
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_Q_stricmp
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_Q_stricmp
	testl	%eax, %eax
	jne	LBB0_4
## %bb.13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LoadJPG                        ## TAILCALL
LBB0_2:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_LoadTGA
	cmpq	$0, (%r12)
	jne	LBB0_4
## %bb.3:
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	movq	_MAX_QPATH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_strcpy
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	movw	$28778, -3(%rax,%rbx)           ## imm = 0x706A
	movb	$103, -1(%rax,%rbx)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_LoadJPG
	movq	-56(%rbp), %rsp                 ## 8-byte Reload
	jmp	LBB0_4
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.8:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LoadPCX32                      ## TAILCALL
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.11:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LoadBMP                        ## TAILCALL
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".tga"

	.comm	_MAX_QPATH,4,2                  ## @MAX_QPATH
L_.str.1:                               ## @.str.1
	.asciz	".pcx"

L_.str.2:                               ## @.str.2
	.asciz	".bmp"

L_.str.3:                               ## @.str.3
	.asciz	".jpg"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_LoadImage                    ; -- Begin function R_LoadImage
	.p2align	2
_R_LoadImage:                           ; @R_LoadImage
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x19, x3
	mov	x20, x2
	mov	x21, 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, #-56]
	str	xzr, [x1]
	str	wzr, [x2]
	str	wzr, [x3]
	bl	_strlen
	cmp	w0, #5
	b.ge	LBB0_3
LBB0_1:
	ldur	x8, [x29, #-56]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.2:
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	add	x8, x22, w0, uxtw
	sub	x23, x8, #4
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_Q_stricmp
	cbz	w0, LBB0_9
; %bb.4:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_Q_stricmp
	cbz	w0, LBB0_11
; %bb.5:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_Q_stricmp
	cbz	w0, LBB0_13
; %bb.6:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
	bl	_Q_stricmp
	cbnz	w0, LBB0_1
; %bb.7:
	ldur	x8, [x29, #-56]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.8:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_LoadJPG
LBB0_9:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_LoadTGA
	ldr	x8, [x21]
	cbnz	x8, LBB0_1
; %bb.10:
	mov	x24, sp
Lloh17:
	adrp	x8, _MAX_QPATH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAX_QPATH@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	mov	x9, x8
Lloh20:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh21:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	mov	x0, x23
	mov	x1, x22
	bl	_strcpy
	mov	x0, x23
	bl	_strlen
	add	x8, x23, w0, sxtw
	mov	w9, #28778
	sturh	w9, [x8, #-3]
	mov	w9, #103
	sturb	w9, [x8, #-1]
	mov	x0, x23
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	bl	_LoadJPG
	mov	sp, x24
	b	LBB0_1
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.12:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_LoadPCX32
LBB0_13:
	ldur	x8, [x29, #-56]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_LoadBMP
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".tga"

	.comm	_MAX_QPATH,4,2                  ; @MAX_QPATH
l_.str.1:                               ; @.str.1
	.asciz	".pcx"

l_.str.2:                               ; @.str.2
	.asciz	".bmp"

l_.str.3:                               ; @.str.3
	.asciz	".jpg"

.subsections_via_symbols
