	.file	"extr_cg_event.c_CG_UseItem.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"No item to use"
.LC2:
	.string	"Use %s"
	.text
	.p2align 4
	.type	CG_UseItem, @function
CG_UseItem:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	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
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	ebx, DWORD PTR EV_EVENT_BITS[rip]
	mov	rax, QWORD PTR cg[rip+8]
	mov	rsi, QWORD PTR 8[rdi]
	not	ebx
	mov	rax, QWORD PTR [rax]
	and	ebx, DWORD PTR [rdi]
	sub	ebx, DWORD PTR EV_USE_ITEM0[rip]
	js	.L2
	cmp	DWORD PTR HI_NUM_HOLDABLE[rip], ebx
	jge	.L3
.L2:
	cmp	rsi, rax
	je	.L4
.L5:
	mov	ecx, DWORD PTR cgs[rip+8]
.L12:
	mov	edx, DWORD PTR CHAN_BODY[rip]
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xor	edi, edi
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	trap_S_StartSound@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	cmp	rsi, rax
	je	.L14
.L6:
	cmp	ebx, 128
	jne	.L15
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.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
.L15:
	.cfi_restore_state
	cmp	ebx, 131
	jne	.L16
	movsx	rax, DWORD PTR 16[rbp]
	test	eax, eax
	js	.L10
	cmp	DWORD PTR MAX_CLIENTS[rip], eax
	jle	.L10
	mov	rdx, QWORD PTR cgs[rip+16]
	mov	ecx, DWORD PTR cg[rip]
	mov	DWORD PTR [rdx+rax*4], ecx
.L10:
	mov	rsi, QWORD PTR 8[rbp]
	mov	ecx, DWORD PTR cgs[rip+4]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L4:
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm0, QWORD PTR SCREEN_HEIGHT[rip]
	lea	rdi, .LC1[rip]
	mov	esi, DWORD PTR BIGCHAR_WIDTH[rip]
	call	CG_CenterPrint@PLT
	mov	rsi, QWORD PTR 8[rbp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	test	ebx, ebx
	je	.L4
	mov	edi, ebx
	call	BG_FindItemForHoldable@PLT
	movsd	xmm0, QWORD PTR .LC0[rip]
	mulsd	xmm0, QWORD PTR SCREEN_HEIGHT[rip]
	lea	rdi, .LC2[rip]
	mov	esi, DWORD PTR [rax]
	mov	r12d, DWORD PTR BIGCHAR_WIDTH[rip]
	movsd	QWORD PTR 8[rsp], xmm0
	call	va@PLT
	movsd	xmm0, QWORD PTR 8[rsp]
	mov	esi, r12d
	mov	rdi, rax
	call	CG_CenterPrint@PLT
	jmp	.L6
.L16:
	mov	rsi, QWORD PTR 8[rbp]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	CG_UseItem, .-CG_UseItem
	.comm	cgs,24,16
	.comm	cg,16,16
	.comm	SCREEN_HEIGHT,8,8
	.comm	MAX_CLIENTS,4,4
	.comm	HI_NUM_HOLDABLE,4,4
	.comm	EV_USE_ITEM0,4,4
	.comm	EV_EVENT_BITS,4,4
	.comm	CHAN_BODY,4,4
	.comm	BIGCHAR_WIDTH,4,4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	858993459
	.long	1070805811
	.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_cg_event.c_CG_UseItem.c"
	.text
	.global	__aeabi_dmul
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No item to use\000"
	.align	2
.LC1:
	.ascii	"Use %s\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	CG_UseItem, %function
CG_UseItem:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, .L22
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L22+4
	ldr	r2, [r2]
	ldr	r4, [r0]
	ldr	r6, .L22+8
	ldr	r3, [r3]
	bic	r4, r4, r2
	ldr	r2, [r6, #4]
	subs	r4, r4, r3
	mov	r5, r0
	ldr	r1, [r0, #4]
	ldr	r3, [r2]
	sub	sp, sp, #12
	bmi	.L2
	ldr	r2, .L22+12
	ldr	r2, [r2]
	cmp	r2, r4
	bge	.L3
.L2:
	cmp	r1, r3
	beq	.L4
.L5:
	mov	r0, #0
	ldr	r3, .L22+16
	ldr	r2, .L22+20
	ldr	r3, [r3, #8]
	ldr	r2, [r2]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	trap_S_StartSound
.L3:
	cmp	r1, r3
	beq	.L18
.L6:
	cmp	r4, #128
	bne	.L19
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L19:
	cmp	r4, #131
	bne	.L20
	ldr	r3, [r5, #8]
	cmp	r3, #0
	blt	.L21
	ldr	r2, .L22+24
	ldr	r2, [r2]
	cmp	r2, r3
	ldr	r2, .L22+16
	ldrgt	r0, [r6]
	ldrgt	r1, [r2, #12]
	strgt	r0, [r1, r3, lsl #2]
.L10:
	ldr	r0, .L22+20
	ldr	r3, [r2, #4]
	ldr	r2, [r0]
	mov	r0, #0
	ldr	r1, [r5, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	trap_S_StartSound
.L4:
	ldr	r1, .L22+28
	ldr	r2, .L22+32
	ldmia	r1, {r0-r1}
	ldr	r3, .L22+36
	bl	__aeabi_dmul
	mov	r3, r1
	ldr	r1, .L22+40
	mov	r2, r0
	ldr	r1, [r1]
	ldr	r0, .L22+44
	str	r1, [sp]
	bl	CG_CenterPrint
	ldr	r1, [r5, #4]
	b	.L5
.L21:
	ldr	r2, .L22+16
	b	.L10
.L18:
	cmp	r4, #0
	beq	.L4
	mov	r0, r4
	bl	BG_FindItemForHoldable
	mov	r3, r0
	ldr	r0, .L22+48
	ldr	r1, [r3]
	bl	va
	ldr	r1, .L22+28
	mov	r7, r0
	ldmia	r1, {r0-r1}
	ldr	r2, .L22+32
	ldr	r3, .L22+36
	bl	__aeabi_dmul
	mov	r3, r1
	ldr	r1, .L22+40
	mov	r2, r0
	ldr	r1, [r1]
	mov	r0, r7
	str	r1, [sp]
	bl	CG_CenterPrint
	b	.L6
.L20:
	ldr	r1, [r5, #4]
	b	.L5
.L23:
	.align	2
.L22:
	.word	EV_EVENT_BITS
	.word	EV_USE_ITEM0
	.word	cg
	.word	HI_NUM_HOLDABLE
	.word	cgs
	.word	CHAN_BODY
	.word	MAX_CLIENTS
	.word	SCREEN_HEIGHT
	.word	858993459
	.word	1070805811
	.word	BIGCHAR_WIDTH
	.word	.LC0
	.word	.LC1
	.size	CG_UseItem, .-CG_UseItem
	.comm	cgs,16,4
	.comm	cg,8,4
	.comm	SCREEN_HEIGHT,8,8
	.comm	MAX_CLIENTS,4,4
	.comm	HI_NUM_HOLDABLE,4,4
	.comm	EV_USE_ITEM0,4,4
	.comm	EV_EVENT_BITS,4,4
	.comm	CHAN_BODY,4,4
	.comm	BIGCHAR_WIDTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
