	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CG_Grapple
_CG_Grapple:                            ## @CG_Grapple
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	_WP_NUM_WEAPONS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jbe	LBB0_2
## %bb.1:
	movq	$0, 8(%rbx)
	xorl	%r15d, %r15d
LBB0_2:
	movq	_cg_weapons@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	shlq	$4, %r15
	leaq	(%r12,%r15), %r14
	movl	24(%rbx), %edi
	movl	32(%rbx), %esi
	callq	_VectorCopy
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_CG_GrappleTrail
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	(%rbx), %edi
	movl	-40(%rbp), %esi
	callq	_VectorCopy
	movl	(%rbx), %edi
	movl	-44(%rbp), %esi
	callq	_VectorCopy
	movq	_cg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	$1, %eax
	movl	%eax, -64(%rbp)
	movl	4(%r12,%r15), %eax
	movl	%eax, -48(%rbp)
	movq	_RF_NOSHADOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r12,%r15), %eax
	movl	%eax, -60(%rbp)
	movl	16(%rbx), %edi
	movq	-56(%rbp), %rax
	movq	(%rax), %rsi
	callq	_VectorNormalize2
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	movl	$1, 8(%rax)
LBB0_4:
	leaq	-64(%rbp), %rdi
	callq	_trap_R_AddRefEntityToScene
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	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,4,2                         ## @cg
	.comm	_RF_NOSHADOW,4,2                ## @RF_NOSHADOW
	.comm	_vec3_origin,4,2                ## @vec3_origin
	.no_dead_strip	_CG_Grapple
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CG_Grapple
_CG_Grapple:                            ; @CG_Grapple
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _WP_NUM_WEAPONS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WP_NUM_WEAPONS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ls	LBB0_2
; %bb.1:
	mov	x8, #0
	str	xzr, [x19, #8]
LBB0_2:
Lloh3:
	adrp	x9, _cg_weapons@GOTPAGE
Lloh4:
	ldr	x9, [x9, _cg_weapons@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x20, x9, x8, lsl #4
	ldr	w0, [x19, #24]
	ldr	w1, [x19, #32]
	bl	_VectorCopy
	mov	x0, x19
	mov	x1, x20
	bl	_CG_GrappleTrail
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	w0, [x19]
	ldr	w1, [sp, #24]
	bl	_VectorCopy
	ldr	w0, [x19]
	ldr	w1, [sp, #20]
	bl	_VectorCopy
Lloh6:
	adrp	x8, _cg@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cg@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w8, w8, #0x1
	str	w8, [sp]
	ldr	w8, [x20, #4]
	str	w8, [sp, #16]
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _RF_NOSHADOW@GOTPAGE
Lloh10:
	ldr	x9, [x9, _RF_NOSHADOW@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #4]
	ldr	w0, [x19, #16]
	ldr	x8, [sp, #8]
	ldr	x1, [x8]
	bl	_VectorNormalize2
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	mov	w9, #1
	str	w9, [x8, #8]
LBB0_4:
	mov	x0, sp
	bl	_trap_R_AddRefEntityToScene
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WP_NUM_WEAPONS,8,3             ; @WP_NUM_WEAPONS
	.comm	_cg_weapons,8,3                 ; @cg_weapons
	.comm	_cg,4,2                         ; @cg
	.comm	_RF_NOSHADOW,4,2                ; @RF_NOSHADOW
	.comm	_vec3_origin,4,2                ; @vec3_origin
	.no_dead_strip	_CG_Grapple
.subsections_via_symbols
