	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function CG_UseItem
LCPI0_0:
	.quad	0x3fd3333333333333              ## double 0.29999999999999999
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_CG_UseItem:                            ## @CG_UseItem
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_EV_EVENT_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%rdi), %eax
	movq	_EV_USE_ITEM0@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movq	_HI_NUM_HOLDABLE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpl	(%rcx), %eax
	movl	%eax, %ebx
	cmovgl	%edx, %ebx
	testl	%eax, %eax
	cmovsl	%edx, %ebx
	movq	8(%rdi), %rax
	movq	_cg@GOTPCREL(%rip), %r15
	movq	8(%r15), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.3:
	movl	%ebx, %edi
	callq	_BG_FindItemForHoldable
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_va
	movq	_SCREEN_HEIGHT@GOTPCREL(%rip), %rcx
	movsd	(%rcx), %xmm0                   ## xmm0 = mem[0],zero
	mulsd	LCPI0_0(%rip), %xmm0
	movq	_BIGCHAR_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_CG_CenterPrint
LBB0_4:
	cmpl	$128, %ebx
	je	LBB0_12
## %bb.5:
	cmpl	$131, %ebx
	jne	LBB0_6
## %bb.8:
	movl	16(%r14), %eax
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movq	_MAX_CLIENTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_11
## %bb.10:
	movq	_cgs@GOTPCREL(%rip), %rcx
	movq	16(%rcx), %rcx
	movl	(%r15), %edx
	movl	%edx, (%rcx,%rax,4)
LBB0_11:
	movq	8(%r14), %rsi
	movq	_CHAN_BODY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	4(%rax), %ecx
	jmp	LBB0_7
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_SCREEN_HEIGHT@GOTPCREL(%rip), %rax
	movsd	(%rax), %xmm0                   ## xmm0 = mem[0],zero
	mulsd	LCPI0_0(%rip), %xmm0
	movq	_BIGCHAR_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_CG_CenterPrint
LBB0_6:
	movq	8(%r14), %rsi
	movq	_CHAN_BODY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	8(%rax), %ecx
LBB0_7:
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trap_S_StartSound              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EV_EVENT_BITS,4,2              ## @EV_EVENT_BITS
	.comm	_EV_USE_ITEM0,4,2               ## @EV_USE_ITEM0
	.comm	_HI_NUM_HOLDABLE,4,2            ## @HI_NUM_HOLDABLE
	.comm	_cg,16,3                        ## @cg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No item to use"

	.comm	_SCREEN_HEIGHT,8,3              ## @SCREEN_HEIGHT
	.comm	_BIGCHAR_WIDTH,4,2              ## @BIGCHAR_WIDTH
L_.str.1:                               ## @.str.1
	.asciz	"Use %s"

	.comm	_CHAN_BODY,4,2                  ## @CHAN_BODY
	.comm	_cgs,24,3                       ## @cgs
	.comm	_MAX_CLIENTS,4,2                ## @MAX_CLIENTS
	.no_dead_strip	_CG_UseItem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CG_UseItem
_CG_UseItem:                            ; @CG_UseItem
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _EV_EVENT_BITS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EV_EVENT_BITS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh3:
	adrp	x9, _EV_USE_ITEM0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EV_USE_ITEM0@GOTPAGEOFF]
Lloh5:
	adrp	x10, _HI_NUM_HOLDABLE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _HI_NUM_HOLDABLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	ldr	w10, [x10]
	sub	w8, w8, w9
	cmp	w8, w10
	ccmp	w8, #0, #8, le
	csel	w20, wzr, w8, lt
	ldr	x8, [x0, #8]
Lloh9:
	adrp	x21, _cg@GOTPAGE
Lloh10:
	ldr	x21, [x21, _cg@GOTPAGEOFF]
	ldr	x9, [x21, #8]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	cbz	w20, LBB0_10
; %bb.2:
	mov	x0, x20
	bl	_BG_FindItemForHoldable
	ldr	w1, [x0]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_va
Lloh13:
	adrp	x8, _SCREEN_HEIGHT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SCREEN_HEIGHT@GOTPAGEOFF]
Lloh15:
	ldr	d0, [x8]
	mov	x8, #3689348814741910323
	movk	x8, #16339, lsl #48
	fmov	d1, x8
	fmul	d0, d0, d1
Lloh16:
	adrp	x8, _BIGCHAR_WIDTH@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BIGCHAR_WIDTH@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_CG_CenterPrint
LBB0_3:
	cmp	w20, #128
	b.eq	LBB0_9
; %bb.4:
	cmp	w20, #131
	b.ne	LBB0_11
; %bb.5:
	ldr	w9, [x19, #16]
Lloh19:
	adrp	x8, _cgs@GOTPAGE
Lloh20:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
	tbnz	w9, #31, LBB0_8
; %bb.6:
Lloh21:
	adrp	x10, _MAX_CLIENTS@GOTPAGE
Lloh22:
	ldr	x10, [x10, _MAX_CLIENTS@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_8
; %bb.7:
	ldr	x10, [x8, #16]
	ldr	w11, [x21]
	str	w11, [x10, x9, lsl #2]
LBB0_8:
	ldr	x1, [x19, #8]
Lloh24:
	adrp	x9, _CHAN_BODY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CHAN_BODY@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x9]
	ldr	w3, [x8, #4]
	b	LBB0_12
LBB0_9:
	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_10:
Lloh27:
	adrp	x8, _SCREEN_HEIGHT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SCREEN_HEIGHT@GOTPAGEOFF]
Lloh29:
	ldr	d0, [x8]
	mov	x8, #3689348814741910323
	movk	x8, #16339, lsl #48
	fmov	d1, x8
	fmul	d0, d0, d1
Lloh30:
	adrp	x8, _BIGCHAR_WIDTH@GOTPAGE
Lloh31:
	ldr	x8, [x8, _BIGCHAR_WIDTH@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CG_CenterPrint
LBB0_11:
	ldr	x1, [x19, #8]
Lloh35:
	adrp	x8, _CHAN_BODY@GOTPAGE
Lloh36:
	ldr	x8, [x8, _CHAN_BODY@GOTPAGEOFF]
Lloh37:
	adrp	x9, _cgs@GOTPAGE
Lloh38:
	ldr	x9, [x9, _cgs@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
Lloh40:
	ldr	w3, [x9, #8]
LBB0_12:
	mov	x0, #0
	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
	b	_trap_S_StartSound
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_EV_EVENT_BITS,4,2              ; @EV_EVENT_BITS
	.comm	_EV_USE_ITEM0,4,2               ; @EV_USE_ITEM0
	.comm	_HI_NUM_HOLDABLE,4,2            ; @HI_NUM_HOLDABLE
	.comm	_cg,16,3                        ; @cg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No item to use"

	.comm	_SCREEN_HEIGHT,8,3              ; @SCREEN_HEIGHT
	.comm	_BIGCHAR_WIDTH,4,2              ; @BIGCHAR_WIDTH
l_.str.1:                               ; @.str.1
	.asciz	"Use %s"

	.comm	_CHAN_BODY,4,2                  ; @CHAN_BODY
	.comm	_cgs,24,3                       ; @cgs
	.comm	_MAX_CLIENTS,4,2                ; @MAX_CLIENTS
	.no_dead_strip	_CG_UseItem
.subsections_via_symbols
