	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2                               ## -- Begin function InsertMD3Model
LCPI0_0:
	.long	0x43340000                      ## float 180
LCPI0_1:
	.long	0x7f800000                      ## float +Inf
LCPI0_2:
	.long	0xff800000                      ## float -Inf
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_InsertMD3Model
	.p2align	4, 0x90
_InsertMD3Model:                        ## @InsertMD3Model
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	divss	LCPI0_0(%rip), %xmm0
	movq	_Q_PI@GOTPCREL(%rip), %rax
	mulss	(%rax), %xmm0
	movq	%rdi, %rbx
	ucomiss	LCPI0_1(%rip), %xmm0
	jae	LBB0_2
## %bb.1:
	movss	LCPI0_2(%rip), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	jae	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	callq	_LoadModel
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%rax, %r14
	movq	_c_triangleModels@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	(%r14), %eax
	movq	_c_triangleSurfaces@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	cmpl	$0, (%r14)
	jle	LBB0_10
## %bb.5:
	movslq	4(%r14), %rax
	leaq	(%r14,%rax,4), %rbx
	movq	_c_triangleVertexes@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movl	4(%rbx), %eax
	addl	%eax, (%r12)
	movslq	24(%rbx), %rax
	leaq	(%rbx,%rax,4), %rbx
	incl	%r13d
	cmpl	(%r14), %r13d
	jge	LBB0_10
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	xorl	%eax, %eax
	callq	_AllocDrawSurf
	movq	%rax, %r15
	movq	_qtrue@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r15)
	movslq	(%rbx), %rax
	movl	(%rbx,%rax,4), %edi
	callq	_ShaderInfoForShader
	movl	%eax, 32(%r15)
	movl	4(%rbx), %eax
	movl	%eax, (%r15)
	shll	$3, %eax
	leal	(%rax,%rax,4), %edi
	callq	_malloc
	movq	%rax, 16(%r15)
	movl	8(%rbx), %eax
	leal	(%rax,%rax,2), %edi
	movl	%edi, 4(%r15)
	shll	$2, %edi
	callq	_malloc
	movq	%rax, 24(%r15)
	movq	$-1, 8(%r15)
	movl	8(%rbx), %ecx
	leal	(%rcx,%rcx,2), %edx
	movq	_c_triangleIndexes@GOTPCREL(%rip), %rsi
	addl	%edx, (%rsi)
	testl	%ecx, %ecx
	jle	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movslq	12(%rbx), %rcx
	leaq	(%rbx,%rcx,4), %rcx
	addq	$8, %rax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rcx,%rdx,8), %rsi
	movl	(%rsi), %edi
	movl	%edi, -8(%rax)
	movl	4(%rsi), %edi
	movl	%edi, -4(%rax)
	movl	8(%rsi), %esi
	movl	%esi, (%rax)
	incq	%rdx
	movslq	8(%rbx), %rsi
	addq	$12, %rax
	cmpq	%rsi, %rdx
	jl	LBB0_8
	jmp	LBB0_9
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movss	%xmm0, -44(%rbp)                ## 4-byte Spill
	callq	_cos
	movss	-44(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_sin
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_Q_PI,4,2                       ## @Q_PI
	.comm	_c_triangleModels,4,2           ## @c_triangleModels
	.comm	_c_triangleSurfaces,4,2         ## @c_triangleSurfaces
	.comm	_qtrue,4,2                      ## @qtrue
	.comm	_c_triangleIndexes,4,2          ## @c_triangleIndexes
	.comm	_c_triangleVertexes,4,2         ## @c_triangleVertexes
	.comm	_MD3_XYZ_SCALE,4,2              ## @MD3_XYZ_SCALE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_InsertMD3Model                 ; -- Begin function InsertMD3Model
	.p2align	2
_InsertMD3Model:                        ; @InsertMD3Model
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -88
	.cfi_offset b9, -96
	mov	x19, x0
	mov	w8, #1127481344
	fmov	s1, w8
	fdiv	s0, s0, s1
Lloh0:
	adrp	x8, _Q_PI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Q_PI@GOTPAGEOFF]
Lloh2:
	ldr	s1, [x8]
	fmul	s8, s0, s1
	mov	w8, #2139095040
	fmov	s0, w8
	fcmp	s8, s0
	mov	w8, #-8388608
	fmov	s0, w8
	fccmp	s8, s0, #4, ne
	b.eq	LBB0_9
LBB0_1:
	mov	x0, x19
	bl	_LoadModel
	cbz	x0, LBB0_8
; %bb.2:
	mov	x19, x0
Lloh3:
	adrp	x8, _c_triangleModels@GOTPAGE
Lloh4:
	ldr	x8, [x8, _c_triangleModels@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh5:
	adrp	x8, _c_triangleSurfaces@GOTPAGE
Lloh6:
	ldr	x8, [x8, _c_triangleSurfaces@GOTPAGEOFF]
	ldr	w9, [x0]
	ldr	w10, [x8]
	add	w9, w10, w9
	str	w9, [x8]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
	mov	w21, #0
	ldrsw	x8, [x19, #4]
Lloh7:
	adrp	x22, _qtrue@GOTPAGE
Lloh8:
	ldr	x22, [x22, _qtrue@GOTPAGEOFF]
	add	x23, x19, x8, lsl #2
Lloh9:
	adrp	x24, _c_triangleIndexes@GOTPAGE
Lloh10:
	ldr	x24, [x24, _c_triangleIndexes@GOTPAGEOFF]
Lloh11:
	adrp	x25, _c_triangleVertexes@GOTPAGE
Lloh12:
	ldr	x25, [x25, _c_triangleVertexes@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x23, #4]
	ldr	w9, [x25]
	add	w8, w9, w8
	str	w8, [x25]
	ldrsw	x8, [x23, #24]
	add	x23, x23, x8, lsl #2
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.ge	LBB0_8
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	bl	_AllocDrawSurf
	mov	x20, x0
	ldr	w8, [x22]
	str	w8, [x0, #36]
	ldrsw	x8, [x23]
	ldr	w0, [x23, x8, lsl #2]
	bl	_ShaderInfoForShader
	str	w0, [x20, #32]
	ldr	w8, [x23, #4]
	str	w8, [x20]
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #3
	bl	_malloc
	str	x0, [x20, #16]
	ldr	w8, [x23, #8]
	add	w8, w8, w8, lsl #1
	str	w8, [x20, #4]
	lsl	w0, w8, #2
	bl	_malloc
	str	x0, [x20, #24]
	movi.2d	v0, #0xffffffffffffffff
	str	d0, [x20, #8]
	ldr	w8, [x23, #8]
	add	w9, w8, w8, lsl #1
	ldr	w10, [x24]
	add	w9, w10, w9
	str	w9, [x24]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, #0
	ldrsw	x9, [x23, #12]
	add	x9, x23, x9, lsl #2
	add	x10, x0, #8
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x11, [x9, x8, lsl #3]
	ldr	w12, [x11]
	stur	w12, [x10, #-8]
	ldr	w12, [x11, #4]
	stur	w12, [x10, #-4]
	ldr	w11, [x11, #8]
	str	w11, [x10], #12
	add	x8, x8, #1
	ldrsw	x11, [x23, #8]
	cmp	x8, x11
	b.lt	LBB0_7
	b	LBB0_4
LBB0_8:
	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	d9, d8, [sp], #96               ; 16-byte Folded Reload
	ret
LBB0_9:
	fmov	s0, s8
	bl	_cos
	fmov	s0, s8
	bl	_sin
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_Q_PI,4,2                       ; @Q_PI
	.comm	_c_triangleModels,4,2           ; @c_triangleModels
	.comm	_c_triangleSurfaces,4,2         ; @c_triangleSurfaces
	.comm	_qtrue,4,2                      ; @qtrue
	.comm	_c_triangleIndexes,4,2          ; @c_triangleIndexes
	.comm	_c_triangleVertexes,4,2         ; @c_triangleVertexes
	.comm	_MD3_XYZ_SCALE,4,2              ; @MD3_XYZ_SCALE
.subsections_via_symbols
