	.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
	pushq	%rbx
	.cfi_offset %rbx, -24
	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_8
## %bb.1:
	movq	8(%r8), %r10
	movq	(%r10), %rax
	movq	_STAT_WEAPONS@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rax,%rdx,4), %edi
	xorl	%eax, %eax
	leaq	l_switch.table.CG_CheckAmmo(%rip), %r9
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	imull	%edx, %esi
	addl	%eax, %esi
	movl	%esi, %eax
	cmpl	$5000, %esi                     ## imm = 0x1388
	jae	LBB0_11
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rcx
	cmpl	%ecx, %r11d
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	btl	%ecx, %edi
	jae	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r10), %rdx
	movq	(%rdx,%rcx,8), %rsi
	testq	%rsi, %rsi
	js	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-128(%rcx), %ebx
	movl	$200, %edx
	cmpl	$4, %ebx
	ja	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	%ebx, %rdx
	movl	(%r9,%rdx,4), %edx
	jmp	LBB0_2
LBB0_8:
	movl	(%r8), %ecx
	jmp	LBB0_12
LBB0_9:
	movl	(%r8), %ecx
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	$1, %eax
	jg	LBB0_13
	jmp	LBB0_14
LBB0_12:
	movl	$2, %eax
LBB0_13:
	movl	%eax, (%r8)
	cmpl	%ecx, %eax
	je	LBB0_14
## %bb.15:
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CHAN_LOCAL_SOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	popq	%rbx
	popq	%rbp
	jmp	_trap_S_StartLocalSound         ## TAILCALL
LBB0_11:
	movl	$0, (%r8)
LBB0_14:
	popq	%rbx
	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
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.CG_CheckAmmo
l_switch.table.CG_CheckAmmo:
	.long	1000                            ## 0x3e8
	.long	1000                            ## 0x3e8
	.long	1000                            ## 0x3e8
	.long	200                             ## 0xc8
	.long	1000                            ## 0x3e8

.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:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _WP_NUM_WEAPONS@GOTPAGE
Lloh6:
	ldr	x10, [x10, _WP_NUM_WEAPONS@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x10]
	cmp	w9, w11
	b.ge	LBB0_9
; %bb.1:
	mov	w10, #0
	ldr	x12, [x8, #8]
	ldr	x13, [x12]
Lloh8:
	adrp	x14, _STAT_WEAPONS@GOTPAGE
Lloh9:
	ldr	x14, [x14, _STAT_WEAPONS@GOTPAGEOFF]
Lloh10:
	ldr	x14, [x14]
	ldr	w13, [x13, x14, lsl #2]
	sxtw	x14, w9
	lsl	x14, x14, #3
Lloh11:
	adrp	x15, l_switch.table.CG_CheckAmmo@PAGE
Lloh12:
	add	x15, x15, l_switch.table.CG_CheckAmmo@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w17, [x15, w17, sxtw #2]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	madd	w10, w17, w16, w10
	lsr	w16, w10, #3
	cmp	w16, #625
	b.hs	LBB0_17
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x14, x14, #8
	add	w9, w9, #1
	cmp	w11, w9
	b.eq	LBB0_10
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
	ldr	x16, [x12, #8]
	ldr	x16, [x16, x14]
	tbnz	x16, #63, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w17, w9, #128
	cmp	w17, #4
	b.ls	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w17, #200
	b	LBB0_3
LBB0_9:
	ldr	w9, [x8]
	b	LBB0_13
LBB0_10:
	ldr	w9, [x8]
	cbz	w10, LBB0_13
; %bb.11:
	cmp	w10, #1
	b.lt	LBB0_15
; %bb.12:
	mov	w10, #1
	b	LBB0_14
LBB0_13:
	mov	w10, #2
LBB0_14:
	str	w10, [x8]
	cmp	w10, w9
	b.ne	LBB0_16
LBB0_15:
	ret
LBB0_16:
Lloh13:
	adrp	x8, _cgs@GOTPAGE
Lloh14:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x8, _CHAN_LOCAL_SOUND@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CHAN_LOCAL_SOUND@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	b	_trap_S_StartLocalSound
LBB0_17:
	str	wzr, [x8]
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.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
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.CG_CheckAmmo
l_switch.table.CG_CheckAmmo:
	.long	1000                            ; 0x3e8
	.long	1000                            ; 0x3e8
	.long	1000                            ; 0x3e8
	.long	200                             ; 0xc8
	.long	1000                            ; 0x3e8

.subsections_via_symbols
