	.file	"extr_p_inter.c_P_GiveWeapon.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	P_GiveWeapon
	.type	P_GiveWeapon, @function
P_GiveWeapon:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR netgame[rip], 0
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	r12, 0[0+rsi*4]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	je	.L2
	cmp	DWORD PTR deathmatch[rip], 2
	je	.L2
	test	edx, edx
	jne	.L3
	mov	rdx, QWORD PTR [rdi]
	add	rdx, r12
	mov	r12d, DWORD PTR [rdx]
	test	r12d, r12d
	jne	.L8
	mov	rax, QWORD PTR BONUSADD[rip]
	add	DWORD PTR 16[rdi], eax
	mov	DWORD PTR [rdx], 1
	mov	rax, QWORD PTR weaponinfo[rip]
	mov	edi, DWORD PTR deathmatch[rip]
	mov	rsi, QWORD PTR [rax+rsi*8]
	test	edi, edi
	jne	.L16
	mov	edx, 2
	mov	rdi, rbp
	call	P_GiveAmmo@PLT
.L7:
	mov	rax, QWORD PTR consoleplayer[rip]
	mov	QWORD PTR 8[rbp], rbx
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR players[rip]
	lea	rax, [rax+rdx*8]
	cmp	rbp, rax
	jne	.L8
	mov	esi, DWORD PTR sfx_wpnup[rip]
	xor	edi, edi
	call	S_StartSound@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rax, QWORD PTR weaponinfo[rip]
	mov	rsi, QWORD PTR [rax+rbx*8]
	xor	eax, eax
	cmp	rsi, QWORD PTR am_noammo[rip]
	je	.L9
	test	edx, edx
	jne	.L12
	mov	edx, 2
	mov	rdi, rbp
	call	P_GiveAmmo@PLT
.L9:
	mov	rdx, QWORD PTR 0[rbp]
	add	rdx, r12
	mov	ecx, DWORD PTR [rdx]
	test	ecx, ecx
	je	.L17
.L11:
	xor	r12d, r12d
	test	eax, eax
	setne	r12b
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	DWORD PTR [rdx], 1
	or	eax, 1
	mov	QWORD PTR 8[rbp], rbx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR weaponinfo[rip]
	mov	rsi, QWORD PTR [rax+rsi*8]
	xor	eax, eax
	cmp	rsi, QWORD PTR am_noammo[rip]
	je	.L9
.L12:
	mov	edx, 1
	mov	rdi, rbp
	call	P_GiveAmmo@PLT
	mov	rdx, QWORD PTR 0[rbp]
	add	rdx, r12
	mov	ecx, DWORD PTR [rdx]
	test	ecx, ecx
	jne	.L11
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L8:
	xor	r12d, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	edx, 5
	mov	rdi, rbp
	call	P_GiveAmmo@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	P_GiveWeapon, .-P_GiveWeapon
	.comm	weaponinfo,8,8
	.comm	sfx_wpnup,4,4
	.comm	players,8,8
	.comm	netgame,8,8
	.comm	deathmatch,4,4
	.comm	consoleplayer,8,8
	.comm	am_noammo,8,8
	.comm	BONUSADD,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_p_inter.c_P_GiveWeapon.c"
	.text
	.align	2
	.global	P_GiveWeapon
	.syntax unified
	.arm
	.fpu softvfp
	.type	P_GiveWeapon, %function
P_GiveWeapon:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L23
	push	{r4, r5, r6, lr}
	ldr	r3, [r3]
	mov	r5, r1
	cmp	r3, #0
	mov	r6, r0
	beq	.L2
	ldr	r3, .L23+4
	ldr	r1, [r3]
	cmp	r1, #2
	beq	.L2
	cmp	r2, #0
	bne	.L3
	ldr	r2, [r0]
	ldr	r4, [r2, r5, lsl #2]
	cmp	r4, #0
	bne	.L8
	mov	ip, #1
	ldr	lr, .L23+8
	ldr	r1, [r0, #8]
	ldr	lr, [lr]
	add	r1, r1, lr
	str	r1, [r0, #8]
	ldr	r1, .L23+12
	str	ip, [r2, r5, lsl #2]
	ldr	r2, [r3]
	ldr	r3, [r1]
	cmp	r2, #0
	movne	r2, #5
	moveq	r2, #2
	ldr	r1, [r3, r5, lsl #2]
	bl	P_GiveAmmo
	ldr	r3, .L23+16
	ldr	r2, .L23+20
	ldr	r3, [r3]
	ldr	r2, [r2]
	add	r3, r3, r3, lsl #1
	add	r3, r2, r3, lsl #2
	cmp	r6, r3
	str	r5, [r6, #4]
	beq	.L22
.L8:
	mov	r4, #0
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r1, .L23+12
	ldr	r3, .L23+24
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r1, [r1, r5, lsl #2]
	cmp	r1, r3
	beq	.L13
	cmp	r2, #0
	bne	.L12
	mov	r2, #2
	mov	r0, r6
	bl	P_GiveAmmo
.L9:
	ldr	r3, [r6]
	ldr	r2, [r3, r5, lsl #2]
	cmp	r2, #0
	moveq	r2, #1
	orreq	r0, r0, r2
	streq	r2, [r3, r5, lsl #2]
	streq	r5, [r6, #4]
	subs	r4, r0, #0
	movne	r4, #1
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L3:
	ldr	r2, .L23+12
	ldr	r3, .L23+24
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r1, [r2, r5, lsl #2]
	cmp	r1, r3
	bne	.L12
.L13:
	mov	r0, #0
	b	.L9
.L12:
	mov	r2, #1
	mov	r0, r6
	bl	P_GiveAmmo
	b	.L9
.L22:
	ldr	r3, .L23+28
	mov	r0, #0
	ldr	r1, [r3]
	bl	S_StartSound
	b	.L1
.L24:
	.align	2
.L23:
	.word	netgame
	.word	deathmatch
	.word	BONUSADD
	.word	weaponinfo
	.word	consoleplayer
	.word	players
	.word	am_noammo
	.word	sfx_wpnup
	.size	P_GiveWeapon, .-P_GiveWeapon
	.comm	weaponinfo,4,4
	.comm	sfx_wpnup,4,4
	.comm	players,4,4
	.comm	netgame,4,4
	.comm	deathmatch,4,4
	.comm	consoleplayer,4,4
	.comm	am_noammo,4,4
	.comm	BONUSADD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
