	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CG_Missile
_CG_Missile:                            ## @CG_Missile
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	8(%rdi), %rax
	movq	_WP_NUM_WEAPONS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jbe	LBB0_2
## %bb.1:
	movq	$0, (%r14)
	xorl	%eax, %eax
LBB0_2:
	movq	_cg_weapons@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	leaq	(%rax,%rax,4), %r13
	leaq	(%r12,%r13,8), %r15
	movl	(%rbx), %esi
	movl	52(%rbx), %edi
	callq	_VectorCopy
	movq	32(%r12,%r13,8), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	*%rax
LBB0_4:
	movq	24(%r12,%r13,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movl	56(%rbx), %edi
	movq	16(%r12,%r13,8), %rax
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	movl	8(%rax), %r8d
	callq	_trap_R_AddLightToScene
LBB0_6:
	cmpq	$0, 8(%r12,%r13,8)
	je	LBB0_8
## %bb.7:
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	movq	%r14, %r15
	leaq	(%r12,%r13,8), %r14
	addq	$8, %r14
	leaq	32(%rbx), %rdi
	movq	_cg@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_BG_EvaluateTrajectoryDelta
	movl	48(%rbx), %edi
	movl	56(%rbx), %esi
	movq	(%r14), %rcx
	movq	%r15, %r14
	movq	-104(%rbp), %r15                ## 8-byte Reload
	callq	_trap_S_AddLoopingSound
LBB0_8:
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movl	56(%rbx), %edi
	movl	-48(%rbp), %esi
	callq	_VectorCopy
	movl	56(%rbx), %edi
	movl	-52(%rbp), %esi
	callq	_VectorCopy
	movq	8(%rbx), %rax
	movq	_WP_PLASMAGUN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_RT_SPRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	$16, -96(%rbp)
	movq	$0, -64(%rbp)
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	4(%rax), %eax
	movl	%eax, -68(%rbp)
	leaq	-96(%rbp), %rdi
	callq	_trap_R_AddRefEntityToScene
	jmp	LBB0_16
LBB0_10:
	movq	_cg@GOTPCREL(%rip), %rax
	movl	4(%rax), %eax
	andl	$1, %eax
	movl	%eax, -92(%rbp)
	movl	4(%r12,%r13,8), %eax
	movl	%eax, -72(%rbp)
	movq	_RF_NOSHADOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r15), %eax
	movl	%eax, -88(%rbp)
	movl	40(%rbx), %edi
	movq	-80(%rbp), %rax
	movq	(%rax), %rsi
	callq	_VectorNormalize2
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movl	$1, 8(%rax)
LBB0_12:
	movq	32(%rbx), %rax
	movq	_TR_STATIONARY@GOTPCREL(%rip), %rcx
	movq	-80(%rbp), %rdi
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.14:
	movl	24(%rbx), %esi
	jmp	LBB0_15
LBB0_13:
	movq	_cg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$2, %esi
LBB0_15:
	callq	_RotateAroundDirection
	movq	_TEAM_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-96(%rbp), %rdi
	movq	%r14, %rsi
	callq	_CG_AddRefEntityWithPowerups
LBB0_16:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WP_NUM_WEAPONS,8,3             ## @WP_NUM_WEAPONS
	.comm	_cg_weapons,8,3                 ## @cg_weapons
	.comm	_cg,8,2                         ## @cg
	.comm	_WP_PLASMAGUN,8,3               ## @WP_PLASMAGUN
	.comm	_RT_SPRITE,4,2                  ## @RT_SPRITE
	.comm	_cgs,8,2                        ## @cgs
	.comm	_RF_NOSHADOW,4,2                ## @RF_NOSHADOW
	.comm	_TR_STATIONARY,8,3              ## @TR_STATIONARY
	.comm	_TEAM_FREE,4,2                  ## @TEAM_FREE
	.comm	_TEAM_BLUE,8,3                  ## @TEAM_BLUE
	.comm	_WP_PROX_LAUNCHER,8,3           ## @WP_PROX_LAUNCHER
	.no_dead_strip	_CG_Missile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CG_Missile
_CG_Missile:                            ; @CG_Missile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x20, x0
	mov	x19, x0
	ldr	x22, [x19, #8]!
Lloh0:
	adrp	x8, _WP_NUM_WEAPONS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WP_NUM_WEAPONS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ls	LBB0_2
; %bb.1:
	mov	x22, #0
	str	xzr, [x19]
LBB0_2:
Lloh3:
	adrp	x8, _cg_weapons@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cg_weapons@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	mov	w8, #40
	madd	x21, x22, x8, x23
	ldr	w0, [x20, #52]
	ldr	w1, [x20]
	bl	_VectorCopy
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	blr	x8
LBB0_4:
	mov	w8, #40
	madd	x8, x22, x8, x23
	ldr	x1, [x8, #24]
	cbz	x1, LBB0_6
; %bb.5:
	ldr	w0, [x20, #56]
	mov	w8, #40
	madd	x8, x22, x8, x23
	ldr	x8, [x8, #16]
	ldp	w2, w3, [x8]
	ldr	w4, [x8, #8]
	bl	_trap_R_AddLightToScene
LBB0_6:
	mov	w8, #40
	madd	x25, x22, x8, x23
	ldr	x8, [x25, #8]!
Lloh6:
	adrp	x24, _cg@GOTPAGE
Lloh7:
	ldr	x24, [x24, _cg@GOTPAGEOFF]
	cbz	x8, LBB0_8
; %bb.7:
	add	x0, x20, #32
	ldr	w1, [x24]
	bl	_BG_EvaluateTrajectoryDelta
	ldr	w0, [x20, #48]
	ldr	w1, [x20, #56]
	ldr	x3, [x25]
	bl	_trap_S_AddLoopingSound
LBB0_8:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	w0, [x20, #56]
	ldr	w1, [sp, #56]
	bl	_VectorCopy
	ldr	w0, [x20, #56]
	ldr	w1, [sp, #52]
	bl	_VectorCopy
	ldr	x8, [x20, #8]
Lloh8:
	adrp	x9, _WP_PLASMAGUN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _WP_PLASMAGUN@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
Lloh11:
	adrp	x8, _RT_SPRITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RT_SPRITE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	mov	w8, #16
	str	xzr, [sp, #40]
Lloh14:
	adrp	x9, _cgs@GOTPAGE
Lloh15:
	ldr	x9, [x9, _cgs@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9, #4]
	str	w8, [sp, #8]
	str	w9, [sp, #36]
	add	x0, sp, #8
	bl	_trap_R_AddRefEntityToScene
	b	LBB0_16
LBB0_10:
	ldr	w8, [x24, #4]
	and	w8, w8, #0x1
	str	w8, [sp, #12]
	mov	w8, #40
	madd	x8, x22, x8, x23
	ldr	w8, [x8, #4]
	str	w8, [sp, #32]
	ldr	w8, [x21]
Lloh17:
	adrp	x9, _RF_NOSHADOW@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RF_NOSHADOW@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #16]
	ldr	w0, [x20, #40]
	ldr	x8, [sp, #24]
	ldr	x1, [x8]
	bl	_VectorNormalize2
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	x8, [sp, #24]
	ldr	x8, [x8]
	mov	w9, #1
	str	w9, [x8, #8]
LBB0_12:
	ldr	x8, [x20, #32]
Lloh20:
	adrp	x9, _TR_STATIONARY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TR_STATIONARY@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	ldr	x0, [sp, #24]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.13:
	ldr	w1, [x20, #24]
	b	LBB0_15
LBB0_14:
	ldr	w8, [x24]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #2
LBB0_15:
	bl	_RotateAroundDirection
Lloh23:
	adrp	x8, _TEAM_FREE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TEAM_FREE@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	x1, x19
	bl	_CG_AddRefEntityWithPowerups
LBB0_16:
	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
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_WP_NUM_WEAPONS,8,3             ; @WP_NUM_WEAPONS
	.comm	_cg_weapons,8,3                 ; @cg_weapons
	.comm	_cg,8,2                         ; @cg
	.comm	_WP_PLASMAGUN,8,3               ; @WP_PLASMAGUN
	.comm	_RT_SPRITE,4,2                  ; @RT_SPRITE
	.comm	_cgs,8,2                        ; @cgs
	.comm	_RF_NOSHADOW,4,2                ; @RF_NOSHADOW
	.comm	_TR_STATIONARY,8,3              ; @TR_STATIONARY
	.comm	_TEAM_FREE,4,2                  ; @TEAM_FREE
	.comm	_TEAM_BLUE,8,3                  ; @TEAM_BLUE
	.comm	_WP_PROX_LAUNCHER,8,3           ; @WP_PROX_LAUNCHER
	.no_dead_strip	_CG_Missile
.subsections_via_symbols
