	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_CheckAmmo                   ## -- Begin function CG_CheckAmmo
	.p2align	4, 0x90
_CG_CheckAmmo:                          ## @CG_CheckAmmo
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_cg@GOTPCREL(%rip), %r8
	movq	_WP_MACHINEGUN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	_WP_NUM_WEAPONS@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	cmpl	%r11d, %ecx
	jge	LBB0_1
## %bb.2:
	movq	8(%r8), %r9
	movq	(%r9), %rax
	movq	_STAT_WEAPONS@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rax,%rdx,4), %r10d
	leaq	(,%rcx,4), %rsi
	xorl	%edi, %edi
	jmp	LBB0_3
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r9), %rax
	addq	%rsi, %rax
	movl	$200, %edx
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	imull	(%rax), %edx
	addl	%edx, %edi
	cmpl	$5000, %edi                     ## imm = 0x1388
	jge	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%rcx
	addq	$4, %rsi
	cmpl	%ecx, %r11d
	je	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	btl	%ecx, %r10d
	jae	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	-128(%rcx), %eax
	cmpl	$4, %eax
	ja	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$3, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ecx, %eax
	shlq	$2, %rax
	addq	8(%r9), %rax
	movl	$1000, %edx                     ## imm = 0x3E8
	jmp	LBB0_8
LBB0_1:
	movl	(%r8), %eax
LBB0_12:
	movl	$2, %ecx
	jmp	LBB0_13
LBB0_11:
	movl	(%r8), %eax
	movl	$1, %ecx
	testl	%edi, %edi
	je	LBB0_12
LBB0_13:
	movl	%ecx, (%r8)
	cmpl	%eax, %ecx
	jne	LBB0_15
## %bb.14:
	popq	%rbp
	retq
LBB0_15:
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CHAN_LOCAL_SOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbp
	jmp	_trap_S_StartLocalSound         ## TAILCALL
LBB0_9:
	movl	$0, (%r8)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cg,16,3                        ## @cg
	.comm	_STAT_WEAPONS,8,3               ## @STAT_WEAPONS
	.comm	_WP_MACHINEGUN,4,2              ## @WP_MACHINEGUN
	.comm	_WP_NUM_WEAPONS,4,2             ## @WP_NUM_WEAPONS
	.comm	_cgs,4,2                        ## @cgs
	.comm	_CHAN_LOCAL_SOUND,4,2           ## @CHAN_LOCAL_SOUND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_CheckAmmo                   ; -- Begin function CG_CheckAmmo
	.p2align	2
_CG_CheckAmmo:                          ; @CG_CheckAmmo
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _cg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cg@GOTPAGEOFF]
Lloh2:
	adrp	x9, _WP_MACHINEGUN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WP_MACHINEGUN@GOTPAGEOFF]
Lloh4:
	ldrsw	x9, [x9]
Lloh5:
	adrp	x10, _WP_NUM_WEAPONS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _WP_NUM_WEAPONS@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_9
; %bb.1:
	mov	w11, #0
	ldr	x12, [x8, #8]
Lloh8:
	adrp	x13, _STAT_WEAPONS@GOTPAGE
Lloh9:
	ldr	x13, [x13, _STAT_WEAPONS@GOTPAGEOFF]
	ldr	x14, [x12]
Lloh10:
	ldr	x13, [x13]
	ldr	w13, [x14, x13, lsl #2]
	lsl	x14, x9, #2
	mov	w15, #5000
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x16, [x12, #8]
	add	x16, x16, x14
	mov	w17, #200
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w16, [x16]
	madd	w11, w16, w17, w11
	cmp	w11, w15
	b.ge	LBB0_16
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	add	x14, x14, #4
	cmp	w10, w9
	b.eq	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w16, w13, w9
	tbz	w16, #0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w16, w9, #128
	cmp	w16, #4
	b.hi	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w16, #3
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x16, [x12, #8]
	add	x16, x16, w9, uxtw #2
	mov	w17, #1000
	b	LBB0_3
LBB0_9:
	ldr	w9, [x8]
LBB0_10:
	mov	w10, #2
	b	LBB0_13
LBB0_11:
	ldr	w9, [x8]
	cbz	w11, LBB0_10
; %bb.12:
	mov	w10, #1
LBB0_13:
	str	w10, [x8]
	cmp	w10, w9
	b.ne	LBB0_15
; %bb.14:
	ret
LBB0_15:
Lloh11:
	adrp	x8, _cgs@GOTPAGE
Lloh12:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _CHAN_LOCAL_SOUND@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CHAN_LOCAL_SOUND@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	b	_trap_S_StartLocalSound
LBB0_16:
	str	wzr, [x8]
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_cg,16,3                        ; @cg
	.comm	_STAT_WEAPONS,8,3               ; @STAT_WEAPONS
	.comm	_WP_MACHINEGUN,4,2              ; @WP_MACHINEGUN
	.comm	_WP_NUM_WEAPONS,4,2             ; @WP_NUM_WEAPONS
	.comm	_cgs,4,2                        ; @cgs
	.comm	_CHAN_LOCAL_SOUND,4,2           ; @CHAN_LOCAL_SOUND
.subsections_via_symbols
