	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function CG_AddViewWeapon
LCPI0_0:
	.quad	0xbfc999999999999a              ## double -0.20000000000000001
	.section	__TEXT,__literal4,4byte_literals
	.p2align	2
LCPI0_1:
	.long	0xc1000000                      ## float -8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_CG_AddViewWeapon
	.p2align	4, 0x90
_CG_AddViewWeapon:                      ## @CG_AddViewWeapon
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_PERS_TEAM@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rax
	movq	_TEAM_SPECTATOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
LBB0_14:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	_PM_INTERMISSION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_14
## %bb.2:
	movq	_cg@GOTPCREL(%rip), %r12
	cmpq	$0, 56(%r12)
	jne	LBB0_14
## %bb.3:
	movq	_cg_drawGun@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
## %bb.6:
	cmpq	$0, 40(%r12)
	jne	LBB0_14
## %bb.7:
	movq	_cg_fov@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$91, %eax
	jge	LBB0_8
## %bb.9:
	xorps	%xmm0, %xmm0
	jmp	LBB0_10
LBB0_4:
	movq	_EF_FIRING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 48(%r12)
	je	LBB0_14
## %bb.5:
	movl	32(%r12), %edi
	callq	_VectorCopy
	movq	24(%r12), %rax
	movl	8(%rax), %esi
	movss	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	callq	_VectorMA
	movq	_cg_entities@GOTPCREL(%rip), %rax
	movq	16(%rbx), %rdi
	shlq	$2, %rdi
	addq	(%rax), %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_CG_LightningBolt               ## TAILCALL
LBB0_8:
	addl	$-90, %eax
	cvtsi2sd	%eax, %xmm0
	mulsd	LCPI0_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
LBB0_10:
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	movq	24(%rbx), %rdi
	callq	_CG_RegisterWeapon
	movq	_cg_weapons@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	24(%rbx), %r13
	leaq	-88(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movl	-52(%rbp), %edi
	callq	_CG_CalculateWeaponPosition
	movl	-52(%rbp), %edi
	movq	_cg_gun_x@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movq	24(%r12), %rax
	movl	(%rax), %esi
	movl	%edi, %edx
	callq	_VectorMA
	movl	-52(%rbp), %edi
	movq	_cg_gun_y@GOTPCREL(%rip), %rax
	movss	(%rax), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	movq	24(%r12), %rax
	movl	4(%rax), %esi
	movl	%edi, %edx
	callq	_VectorMA
	movl	-52(%rbp), %edi
	movq	_cg_gun_z@GOTPCREL(%rip), %rax
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	addss	(%rax), %xmm0
	movq	24(%r12), %rax
	movl	8(%rax), %esi
	movl	%edi, %edx
	callq	_VectorMA
	movl	-56(%rbp), %esi
	callq	_AnglesToAxis
	movq	_cg_gun_frame@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rax, -64(%rbp)
	xorl	%ecx, %ecx
	jmp	LBB0_13
LBB0_12:
	movq	_cgs@GOTPCREL(%rip), %rax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, %r13
	movq	16(%r12), %r14
	shlq	$2, %r14
	addq	(%rax), %r14
	movl	12(%r12), %esi
	movq	%r14, %rdi
	callq	_CG_MapTorsoToWeaponFrame
	movq	%rax, -64(%rbp)
	movl	8(%r12), %esi
	movq	%r14, %rdi
	movq	%r13, %r14
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	callq	_CG_MapTorsoToWeaponFrame
	movq	(%r12), %rcx
LBB0_13:
	movq	%rax, -72(%rbp)
	movq	%rcx, -80(%rbp)
	movl	(%r14,%r13,4), %eax
	movq	_RF_DEPTHHACK@GOTPCREL(%rip), %rcx
	movq	_RF_FIRST_PERSON@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%eax, -84(%rbp)
	movq	_RF_MINLIGHT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -88(%rbp)
	movq	(%rbx), %rax
	movq	(%r15), %rcx
	movq	(%rax,%rcx,8), %rcx
	movq	_cg@GOTPCREL(%rip), %rdx
	leaq	-88(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_CG_AddPlayerWeapon
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_PERS_TEAM,8,3                  ## @PERS_TEAM
	.comm	_TEAM_SPECTATOR,8,3             ## @TEAM_SPECTATOR
	.comm	_PM_INTERMISSION,8,3            ## @PM_INTERMISSION
	.comm	_cg,64,3                        ## @cg
	.comm	_cg_drawGun,4,2                 ## @cg_drawGun
	.comm	_EF_FIRING,4,2                  ## @EF_FIRING
	.comm	_cg_entities,8,3                ## @cg_entities
	.comm	_cg_fov,4,2                     ## @cg_fov
	.comm	_cg_weapons,8,3                 ## @cg_weapons
	.comm	_cg_gun_x,4,2                   ## @cg_gun_x
	.comm	_cg_gun_y,4,2                   ## @cg_gun_y
	.comm	_cg_gun_z,4,2                   ## @cg_gun_z
	.comm	_cg_gun_frame,8,3               ## @cg_gun_frame
	.comm	_cgs,8,3                        ## @cgs
	.comm	_RF_DEPTHHACK,4,2               ## @RF_DEPTHHACK
	.comm	_RF_FIRST_PERSON,4,2            ## @RF_FIRST_PERSON
	.comm	_RF_MINLIGHT,4,2                ## @RF_MINLIGHT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_AddViewWeapon               ; -- Begin function CG_AddViewWeapon
	.p2align	2
_CG_AddViewWeapon:                      ; @CG_AddViewWeapon
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #48]               ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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 b8, -72
	.cfi_offset b9, -80
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _PERS_TEAM@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PERS_TEAM@GOTPAGEOFF]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
Lloh2:
	adrp	x9, _TEAM_SPECTATOR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TEAM_SPECTATOR@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh5:
	adrp	x9, _PM_INTERMISSION@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PM_INTERMISSION@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x22, _cg@GOTPAGE
Lloh9:
	ldr	x22, [x22, _cg@GOTPAGEOFF]
	ldr	x10, [x22, #56]
	cmp	x8, x9
	ccmp	x10, #0, #0, ne
	b.ne	LBB0_10
; %bb.2:
Lloh10:
	adrp	x8, _cg_drawGun@GOTPAGE
Lloh11:
	ldr	x8, [x8, _cg_drawGun@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cbz	w8, LBB0_6
; %bb.3:
	ldr	x8, [x22, #40]
	cbnz	x8, LBB0_10
; %bb.4:
Lloh13:
	adrp	x8, _cg_fov@GOTPAGE
Lloh14:
	ldr	x8, [x8, _cg_fov@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	subs	w8, w8, #90
	scvtf	d0, w8
	mov	x8, #-7378697629483820647
	movk	x8, #39322
	movk	x8, #49097, lsl #48
	fmov	d1, x8
	fmul	d0, d0, d1
	fcvt	s0, d0
	movi	d1, #0000000000000000
	fcsel	s8, s0, s1, gt
	ldr	x0, [x19, #24]
	bl	_CG_RegisterWeapon
Lloh16:
	adrp	x8, _cg_weapons@GOTPAGE
Lloh17:
	ldr	x8, [x8, _cg_weapons@GOTPAGEOFF]
Lloh18:
	ldr	x23, [x8]
	ldr	x24, [x19, #24]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldr	w0, [sp, #44]
	bl	_CG_CalculateWeaponPosition
	ldr	w0, [sp, #44]
Lloh19:
	adrp	x8, _cg_gun_x@GOTPAGE
Lloh20:
	ldr	x8, [x8, _cg_gun_x@GOTPAGEOFF]
Lloh21:
	ldr	s0, [x8]
	ldr	x8, [x22, #24]
	ldr	w1, [x8]
	mov	x2, x0
	bl	_VectorMA
	ldr	w0, [sp, #44]
Lloh22:
	adrp	x8, _cg_gun_y@GOTPAGE
Lloh23:
	ldr	x8, [x8, _cg_gun_y@GOTPAGEOFF]
Lloh24:
	ldr	s0, [x8]
	ldr	x8, [x22, #24]
	ldr	w1, [x8, #4]
	mov	x2, x0
	bl	_VectorMA
	ldr	w0, [sp, #44]
Lloh25:
	adrp	x8, _cg_gun_z@GOTPAGE
Lloh26:
	ldr	x8, [x8, _cg_gun_z@GOTPAGEOFF]
Lloh27:
	ldr	s0, [x8]
	fadd	s0, s8, s0
	ldr	x8, [x22, #24]
	ldr	w1, [x8, #8]
	mov	x2, x0
	bl	_VectorMA
	ldr	w1, [sp, #40]
	bl	_AnglesToAxis
Lloh28:
	adrp	x8, _cg_gun_frame@GOTPAGE
Lloh29:
	ldr	x8, [x8, _cg_gun_frame@GOTPAGEOFF]
Lloh30:
	ldr	x0, [x8]
	cbz	x0, LBB0_8
; %bb.5:
	mov	x8, #0
	str	x0, [sp, #32]
	b	LBB0_9
LBB0_6:
	ldr	w8, [x22, #48]
Lloh31:
	adrp	x9, _EF_FIRING@GOTPAGE
Lloh32:
	ldr	x9, [x9, _EF_FIRING@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.7:
	ldr	w0, [x22, #32]
	bl	_VectorCopy
	ldr	x8, [x22, #24]
	ldr	w1, [x8, #8]
	fmov	s0, #-8.00000000
	bl	_VectorMA
Lloh34:
	adrp	x8, _cg_entities@GOTPAGE
Lloh35:
	ldr	x8, [x8, _cg_entities@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
	add	x0, x8, x9, lsl #2
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_CG_LightningBolt
LBB0_8:
Lloh37:
	adrp	x8, _cgs@GOTPAGE
Lloh38:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	ldr	x9, [x22, #16]
	add	x20, x8, x9, lsl #2
	ldr	w1, [x22, #12]
	mov	x0, x20
	bl	_CG_MapTorsoToWeaponFrame
	str	x0, [sp, #32]
	ldr	w1, [x22, #8]
	mov	x0, x20
	bl	_CG_MapTorsoToWeaponFrame
	ldr	x8, [x22]
LBB0_9:
	stp	x8, x0, [sp, #16]
	ldr	w8, [x23, x24, lsl #2]
Lloh40:
	adrp	x9, _RF_DEPTHHACK@GOTPAGE
Lloh41:
	ldr	x9, [x9, _RF_DEPTHHACK@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
Lloh43:
	adrp	x10, _RF_FIRST_PERSON@GOTPAGE
Lloh44:
	ldr	x10, [x10, _RF_FIRST_PERSON@GOTPAGEOFF]
Lloh45:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh46:
	adrp	x10, _RF_MINLIGHT@GOTPAGE
Lloh47:
	ldr	x10, [x10, _RF_MINLIGHT@GOTPAGEOFF]
Lloh48:
	ldr	w10, [x10]
	orr	w9, w9, w10
	stp	w9, w8, [sp, #8]
	ldr	x8, [x19]
	ldr	x9, [x21]
	ldr	x3, [x8, x9, lsl #3]
Lloh49:
	adrp	x2, _cg@GOTPAGE
Lloh50:
	ldr	x2, [x2, _cg@GOTPAGEOFF]
	add	x0, sp, #8
	mov	x1, x19
	bl	_CG_AddPlayerWeapon
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PERS_TEAM,8,3                  ; @PERS_TEAM
	.comm	_TEAM_SPECTATOR,8,3             ; @TEAM_SPECTATOR
	.comm	_PM_INTERMISSION,8,3            ; @PM_INTERMISSION
	.comm	_cg,64,3                        ; @cg
	.comm	_cg_drawGun,4,2                 ; @cg_drawGun
	.comm	_EF_FIRING,4,2                  ; @EF_FIRING
	.comm	_cg_entities,8,3                ; @cg_entities
	.comm	_cg_fov,4,2                     ; @cg_fov
	.comm	_cg_weapons,8,3                 ; @cg_weapons
	.comm	_cg_gun_x,4,2                   ; @cg_gun_x
	.comm	_cg_gun_y,4,2                   ; @cg_gun_y
	.comm	_cg_gun_z,4,2                   ; @cg_gun_z
	.comm	_cg_gun_frame,8,3               ; @cg_gun_frame
	.comm	_cgs,8,3                        ; @cgs
	.comm	_RF_DEPTHHACK,4,2               ; @RF_DEPTHHACK
	.comm	_RF_FIRST_PERSON,4,2            ; @RF_FIRST_PERSON
	.comm	_RF_MINLIGHT,4,2                ; @RF_MINLIGHT
.subsections_via_symbols
