	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_GiveAmmo                     ## -- Begin function P_GiveAmmo
	.p2align	4, 0x90
_P_GiveAmmo:                            ## @P_GiveAmmo
	.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	_am_noammo@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpq	%rsi, (%rax)
	je	LBB0_23
## %bb.1:
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_NUMAMMO@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jae	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_I_Error
LBB0_3:
	movq	(%r14), %rax
	movq	8(%r14), %r8
	movl	(%rax,%rbx,4), %edx
	cmpl	(%r8,%rbx,4), %edx
	je	LBB0_23
## %bb.4:
	movq	_clipammo@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rbx,4), %edi
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	imull	%r12d, %edi
	jmp	LBB0_7
LBB0_6:
	movl	%edi, %ecx
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	movl	%ecx, %edi
LBB0_7:
	movq	_gameskill@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_sk_baby@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	sete	%r9b
	movq	_sk_nightmare@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rcx
	sete	%cl
	orb	%r9b, %cl
	shll	%cl, %edi
	addl	%edx, %edi
	movl	%edi, (%rax,%rbx,4)
	movl	(%r8,%rbx,4), %ecx
	cmpl	%ecx, %edi
	cmovgel	%ecx, %edi
	movl	%edi, (%rax,%rbx,4)
	movl	$1, %r15d
	testl	%edx, %edx
	je	LBB0_8
LBB0_23:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	addq	$-128, %rbx
	cmpq	$3, %rbx
	ja	LBB0_23
## %bb.9:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rbx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_13:
	movq	16(%r14), %rax
	movq	_wp_fist@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.14:
	movq	_wp_pistol@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
LBB0_15:
	movq	32(%r14), %rcx
	movq	_wp_shotgun@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_19:
	movq	16(%r14), %rax
	movq	_wp_fist@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.20:
	movq	32(%r14), %rcx
	movq	_wp_missile@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_10:
	movq	16(%r14), %rax
	movq	_wp_fist@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.11:
	movq	32(%r14), %rcx
	movq	_wp_chaingun@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rcx,%rax,4)
	jne	LBB0_22
## %bb.12:
	movq	_wp_pistol@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_22
LBB0_16:
	movq	16(%r14), %rax
	movq	_wp_fist@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.17:
	movq	_wp_pistol@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
LBB0_18:
	movq	32(%r14), %rcx
	movq	_wp_plasma@GOTPCREL(%rip), %rax
LBB0_21:
	movq	(%rax), %rax
	cmpl	$0, (%rcx,%rax,4)
	je	LBB0_23
LBB0_22:
	movq	%rax, 24(%r14)
	jmp	LBB0_23
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_19, LBB0_19-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
LJTI0_0:
	.long	L0_0_set_13
	.long	L0_0_set_19
	.long	L0_0_set_10
	.long	L0_0_set_16
	.end_data_region
                                        ## -- End function
	.comm	_am_noammo,8,3                  ## @am_noammo
	.comm	_NUMAMMO,8,3                    ## @NUMAMMO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"P_GiveAmmo: bad type %i"

	.comm	_clipammo,8,3                   ## @clipammo
	.comm	_gameskill,8,3                  ## @gameskill
	.comm	_sk_baby,8,3                    ## @sk_baby
	.comm	_sk_nightmare,8,3               ## @sk_nightmare
	.comm	_wp_fist,8,3                    ## @wp_fist
	.comm	_wp_chaingun,8,3                ## @wp_chaingun
	.comm	_wp_pistol,8,3                  ## @wp_pistol
	.comm	_wp_shotgun,8,3                 ## @wp_shotgun
	.comm	_wp_plasma,8,3                  ## @wp_plasma
	.comm	_wp_missile,8,3                 ## @wp_missile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_GiveAmmo                     ; -- Begin function P_GiveAmmo
	.p2align	2
_P_GiveAmmo:                            ; @P_GiveAmmo
	.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
Lloh0:
	adrp	x8, _am_noammo@GOTPAGE
Lloh1:
	ldr	x8, [x8, _am_noammo@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.eq	LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh3:
	adrp	x8, _NUMAMMO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NUMAMMO@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x1
	b.hs	LBB0_3
; %bb.2:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_I_Error
LBB0_3:
	lsl	x8, x20, #2
	ldp	x9, x11, [x19]
	ldr	w10, [x9, x8]
	ldr	w12, [x11, x8]
	cmp	w10, w12
	b.ne	LBB0_5
LBB0_4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x12, _clipammo@GOTPAGE
Lloh9:
	ldr	x12, [x12, _clipammo@GOTPAGEOFF]
Lloh10:
	ldr	x12, [x12]
	ldr	w12, [x12, x20, lsl #2]
	cmp	w12, #0
	cinc	w13, w12, lt
	asr	w13, w13, #1
	mul	w12, w12, w21
	cmp	w21, #0
	csel	w12, w13, w12, eq
Lloh11:
	adrp	x13, _gameskill@GOTPAGE
Lloh12:
	ldr	x13, [x13, _gameskill@GOTPAGEOFF]
Lloh13:
	adrp	x14, _sk_baby@GOTPAGE
Lloh14:
	ldr	x14, [x14, _sk_baby@GOTPAGEOFF]
Lloh15:
	ldr	x13, [x13]
Lloh16:
	ldr	x14, [x14]
	cmp	x13, x14
Lloh17:
	adrp	x14, _sk_nightmare@GOTPAGE
Lloh18:
	ldr	x14, [x14, _sk_nightmare@GOTPAGEOFF]
Lloh19:
	ldr	x14, [x14]
	ccmp	x13, x14, #4, ne
	cset	w13, eq
	lsl	w12, w12, w13
	add	w12, w12, w10
	str	w12, [x9, x8]
	ldr	w11, [x11, x8]
	cmp	w12, w11
	csel	w11, w12, w11, lt
	str	w11, [x9, x8]
	cbz	w10, LBB0_8
LBB0_6:
	mov	w0, #1
LBB0_7:
	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
LBB0_8:
	sub	x8, x20, #128
	cmp	x8, #3
	b.hi	LBB0_6
; %bb.9:
Lloh20:
	adrp	x9, lJTI0_0@PAGE
Lloh21:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_10
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_10:
	ldr	x8, [x19, #16]
Lloh22:
	adrp	x9, _wp_fist@GOTPAGE
Lloh23:
	ldr	x9, [x9, _wp_fist@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
Lloh25:
	adrp	x9, _wp_pistol@GOTPAGE
Lloh26:
	ldr	x9, [x9, _wp_pistol@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
LBB0_12:
	ldr	x9, [x19, #32]
Lloh28:
	adrp	x8, _wp_shotgun@GOTPAGE
Lloh29:
	ldr	x8, [x8, _wp_shotgun@GOTPAGEOFF]
	b	LBB0_20
LBB0_13:
	ldr	x8, [x19, #16]
Lloh30:
	adrp	x9, _wp_fist@GOTPAGE
Lloh31:
	ldr	x9, [x9, _wp_fist@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.14:
	ldr	x9, [x19, #32]
Lloh33:
	adrp	x8, _wp_missile@GOTPAGE
Lloh34:
	ldr	x8, [x8, _wp_missile@GOTPAGEOFF]
	b	LBB0_20
LBB0_15:
	ldr	x8, [x19, #16]
Lloh35:
	adrp	x9, _wp_fist@GOTPAGE
Lloh36:
	ldr	x9, [x9, _wp_fist@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.16:
	ldr	x8, [x19, #32]
Lloh38:
	adrp	x9, _wp_chaingun@GOTPAGE
Lloh39:
	ldr	x9, [x9, _wp_chaingun@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh41:
	adrp	x10, _wp_pistol@GOTPAGE
Lloh42:
	ldr	x10, [x10, _wp_pistol@GOTPAGEOFF]
Lloh43:
	ldr	x10, [x10]
	cmp	w8, #0
	csel	x8, x10, x9, eq
	b	LBB0_21
LBB0_17:
	ldr	x8, [x19, #16]
Lloh44:
	adrp	x9, _wp_fist@GOTPAGE
Lloh45:
	ldr	x9, [x9, _wp_fist@GOTPAGEOFF]
Lloh46:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.18:
Lloh47:
	adrp	x9, _wp_pistol@GOTPAGE
Lloh48:
	ldr	x9, [x9, _wp_pistol@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
LBB0_19:
	ldr	x9, [x19, #32]
Lloh50:
	adrp	x8, _wp_plasma@GOTPAGE
Lloh51:
	ldr	x8, [x8, _wp_plasma@GOTPAGEOFF]
LBB0_20:
	ldr	x8, [x8]
	ldr	w9, [x9, x8, lsl #2]
	cbz	w9, LBB0_6
LBB0_21:
	str	x8, [x19, #24]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh50, Lloh51
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_10)>>2
	.byte	(LBB0_13-LBB0_10)>>2
	.byte	(LBB0_15-LBB0_10)>>2
	.byte	(LBB0_17-LBB0_10)>>2
                                        ; -- End function
	.comm	_am_noammo,8,3                  ; @am_noammo
	.comm	_NUMAMMO,8,3                    ; @NUMAMMO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"P_GiveAmmo: bad type %i"

	.comm	_clipammo,8,3                   ; @clipammo
	.comm	_gameskill,8,3                  ; @gameskill
	.comm	_sk_baby,8,3                    ; @sk_baby
	.comm	_sk_nightmare,8,3               ; @sk_nightmare
	.comm	_wp_fist,8,3                    ; @wp_fist
	.comm	_wp_chaingun,8,3                ; @wp_chaingun
	.comm	_wp_pistol,8,3                  ; @wp_pistol
	.comm	_wp_shotgun,8,3                 ; @wp_shotgun
	.comm	_wp_plasma,8,3                  ; @wp_plasma
	.comm	_wp_missile,8,3                 ; @wp_missile
.subsections_via_symbols
