	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_AddRefEntityWithPowerups    ## -- Begin function CG_AddRefEntityWithPowerups
	.p2align	4, 0x90
_CG_AddRefEntityWithPowerups:           ## @CG_AddRefEntityWithPowerups
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rsi), %eax
	movq	_PW_INVIS@GOTPCREL(%rip), %rcx
	movq	_cgs@GOTPCREL(%rip), %r12
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_3
## %bb.1:
	addq	$16, %r12
	jmp	LBB0_2
LBB0_3:
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rbx, %rdi
	callq	_trap_R_AddRefEntityToScene
	movl	(%r14), %eax
	movq	_PW_QUAD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_5
## %bb.4:
	movq	_TEAM_RED@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	%r15d, (%rax)
	sete	%cl
	movl	8(%r12,%rcx,4), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_trap_R_AddRefEntityToScene
	movl	(%r14), %eax
LBB0_5:
	movq	_PW_REGEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_8
## %bb.6:
	movq	_cg@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	movslq	%ecx, %rcx
	imulq	$1717986919, %rcx, %rdx         ## imm = 0x66666667
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$34, %rdx
	addl	%esi, %edx
	addl	%edx, %edx
	leal	(%rdx,%rdx,4), %edx
	subl	%edx, %ecx
	cmpl	$1, %ecx
	jne	LBB0_8
## %bb.7:
	movl	4(%r12), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_trap_R_AddRefEntityToScene
	movl	(%r14), %eax
LBB0_8:
	movq	_PW_BATTLESUIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jae	LBB0_9
LBB0_2:
	movl	(%r12), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trap_R_AddRefEntityToScene     ## TAILCALL
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PW_INVIS,4,2                   ## @PW_INVIS
	.comm	_cgs,20,2                       ## @cgs
	.comm	_PW_QUAD,4,2                    ## @PW_QUAD
	.comm	_TEAM_RED,4,2                   ## @TEAM_RED
	.comm	_PW_REGEN,4,2                   ## @PW_REGEN
	.comm	_cg,4,2                         ## @cg
	.comm	_PW_BATTLESUIT,4,2              ## @PW_BATTLESUIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_AddRefEntityWithPowerups    ; -- Begin function CG_AddRefEntityWithPowerups
	.p2align	2
_CG_AddRefEntityWithPowerups:           ; @CG_AddRefEntityWithPowerups
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _PW_INVIS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PW_INVIS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x22, _cgs@GOTPAGE
Lloh4:
	ldr	x22, [x22, _cgs@GOTPAGEOFF]
	lsr	w8, w8, w9
	tbz	w8, #0, LBB0_2
; %bb.1:
	add	x8, x22, #16
	b	LBB0_9
LBB0_2:
	mov	x21, x2
	mov	x20, x1
	mov	x0, x19
	bl	_trap_R_AddRefEntityToScene
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _PW_QUAD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PW_QUAD@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbz	w9, #0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _TEAM_RED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TEAM_RED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	x9, x22, #12
	add	x10, x22, #8
	cmp	w8, w21
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	bl	_trap_R_AddRefEntityToScene
	ldr	w8, [x20]
LBB0_4:
Lloh11:
	adrp	x9, _PW_REGEN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PW_REGEN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbz	w9, #0, LBB0_7
; %bb.5:
Lloh14:
	adrp	x9, _cg@GOTPAGE
Lloh15:
	ldr	x9, [x9, _cg@GOTPAGEOFF]
Lloh16:
	ldrsw	x9, [x9]
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w10, w10, w11
	mov	w11, #10
	msub	w9, w10, w11, w9
	cmp	w9, #1
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x22, #4]
	str	w8, [x19]
	mov	x0, x19
	bl	_trap_R_AddRefEntityToScene
	ldr	w8, [x20]
LBB0_7:
Lloh17:
	adrp	x9, _PW_BATTLESUIT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _PW_BATTLESUIT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	tbz	w8, #0, LBB0_10
; %bb.8:
Lloh20:
	adrp	x8, _cgs@GOTPAGE
Lloh21:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_trap_R_AddRefEntityToScene
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_PW_INVIS,4,2                   ; @PW_INVIS
	.comm	_cgs,20,2                       ; @cgs
	.comm	_PW_QUAD,4,2                    ; @PW_QUAD
	.comm	_TEAM_RED,4,2                   ; @TEAM_RED
	.comm	_PW_REGEN,4,2                   ; @PW_REGEN
	.comm	_cg,4,2                         ; @cg
	.comm	_PW_BATTLESUIT,4,2              ; @PW_BATTLESUIT
.subsections_via_symbols
