	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CG_DrawWeaponSelect            ## -- Begin function CG_DrawWeaponSelect
	.p2align	4, 0x90
_CG_DrawWeaponSelect:                   ## @CG_DrawWeaponSelect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_cg@GOTPCREL(%rip), %r12
	movq	32(%r12), %rax
	movq	_STAT_HEALTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	jle	LBB0_14
## %bb.1:
	movl	24(%r12), %edi
	movq	_WEAPON_SELECT_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_CG_FadeColor
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_trap_R_SetColor
	movq	$0, 16(%r12)
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	_STAT_WEAPONS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %r13d
	movl	%r13d, %eax
	shrl	%eax
	andl	$1, %eax
	movl	%r13d, %ecx
	shrl	$2, %ecx
	andl	$1, %ecx
	btl	$3, %r13d
	adcl	%eax, %ecx
	movl	%r13d, %eax
	shrl	$4, %eax
	andl	$1, %eax
	btl	$5, %r13d
	adcl	%ecx, %eax
	movl	%r13d, %ecx
	shrl	$6, %ecx
	andl	$1, %ecx
	btl	$7, %r13d
	adcl	%eax, %ecx
	movl	%r13d, %eax
	shrl	$8, %eax
	andl	$1, %eax
	btl	$9, %r13d
	adcl	%ecx, %eax
	movl	%r13d, %ecx
	shrl	$10, %ecx
	andl	$1, %ecx
	btl	$11, %r13d
	adcl	%eax, %ecx
	movl	%r13d, %eax
	shrl	$12, %eax
	andl	$1, %eax
	btl	$13, %r13d
	adcl	%ecx, %eax
	movl	%r13d, %ecx
	shrl	$14, %ecx
	andl	$1, %ecx
	btl	$15, %r13d
	adcl	%eax, %ecx
	shll	$2, %ecx
	leal	(%rcx,%rcx,4), %eax
	movl	$320, %r15d                     ## imm = 0x140
	subl	%eax, %r15d
	movl	$1, %ebx
	movl	$24, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r12), %rax
	movq	8(%rax), %rax
	cmpl	$0, (%rax,%rbx,4)
	je	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	addl	$40, %r15d
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	addq	$16, %r14
	cmpq	$16, %rbx
	je	LBB0_10
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	btl	%ebx, %r13d
	jae	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	callq	_CG_RegisterWeapon
	movq	_cg_weapons@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14), %r8d
	movl	%r15d, %edi
	movl	$380, %esi                      ## imm = 0x17C
	movl	$32, %edx
	movl	$32, %ecx
	callq	_CG_DrawPic
	movl	(%r12), %eax
	cmpq	%rax, %rbx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	-4(%r15), %edi
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	4(%rax), %r8d
	movl	$376, %esi                      ## imm = 0x178
	movl	$40, %edx
	movl	$40, %ecx
	callq	_CG_DrawPic
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_cgs@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r15d, %edi
	movl	$380, %esi                      ## imm = 0x17C
	movl	$32, %edx
	movl	$32, %ecx
	callq	_CG_DrawPic
	jmp	LBB0_8
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_cg_weapons@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r12), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_CG_DrawStrlen
	movq	_BIGCHAR_WIDTH@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movq	_SCREEN_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	subl	%eax, %ecx
	movl	%ecx, %edi
	shrl	$31, %edi
	addl	%ecx, %edi
	sarl	%edi
	movl	$358, %esi                      ## imm = 0x166
	movq	%rbx, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_CG_DrawBigStringColor
LBB0_13:
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trap_R_SetColor                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_cg,40,3                        ## @cg
	.comm	_STAT_HEALTH,8,3                ## @STAT_HEALTH
	.comm	_WEAPON_SELECT_TIME,4,2         ## @WEAPON_SELECT_TIME
	.comm	_STAT_WEAPONS,8,3               ## @STAT_WEAPONS
	.comm	_cg_weapons,8,3                 ## @cg_weapons
	.comm	_cgs,8,2                        ## @cgs
	.comm	_BIGCHAR_WIDTH,4,2              ## @BIGCHAR_WIDTH
	.comm	_SCREEN_WIDTH,4,2               ## @SCREEN_WIDTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function CG_DrawWeaponSelect
lCPI0_0:
	.long	4294967289                      ; 0xfffffff9
	.long	4294967290                      ; 0xfffffffa
	.long	4294967291                      ; 0xfffffffb
	.long	4294967292                      ; 0xfffffffc
lCPI0_1:
	.long	4294967281                      ; 0xfffffff1
	.long	4294967282                      ; 0xfffffff2
	.long	4294967283                      ; 0xfffffff3
	.long	4294967284                      ; 0xfffffff4
lCPI0_2:
	.long	4294967285                      ; 0xfffffff5
	.long	4294967286                      ; 0xfffffff6
	.long	4294967287                      ; 0xfffffff7
	.long	4294967288                      ; 0xfffffff8
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_CG_DrawWeaponSelect
	.p2align	2
_CG_DrawWeaponSelect:                   ; @CG_DrawWeaponSelect
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x22, _cg@GOTPAGE
Lloh1:
	ldr	x22, [x22, _cg@GOTPAGEOFF]
	ldr	x8, [x22, #32]
Lloh2:
	adrp	x9, _STAT_HEALTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STAT_HEALTH@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cmp	x8, #1
	b.lt	LBB0_10
; %bb.1:
	ldr	w0, [x22, #24]
Lloh5:
	adrp	x8, _WEAPON_SELECT_TIME@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WEAPON_SELECT_TIME@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_CG_FadeColor
	cbz	x0, LBB0_10
; %bb.2:
	mov	x19, x0
	bl	_trap_R_SetColor
	str	xzr, [x22, #16]
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _STAT_WEAPONS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _STAT_WEAPONS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	w23, [x8, x9, lsl #2]
	ubfx	w8, w23, #1, #1
	ubfx	w9, w23, #2, #1
	dup.4s	v0, w23
	ubfx	w10, w23, #3, #1
Lloh11:
	adrp	x11, lCPI0_0@PAGE
Lloh12:
	ldr	q1, [x11, lCPI0_0@PAGEOFF]
	ushl.4s	v1, v0, v1
	movi.4s	v2, #1
	and.16b	v1, v1, v2
Lloh13:
	adrp	x11, lCPI0_1@PAGE
Lloh14:
	ldr	q3, [x11, lCPI0_1@PAGEOFF]
	ushl.4s	v3, v0, v3
Lloh15:
	adrp	x11, lCPI0_2@PAGE
Lloh16:
	ldr	q4, [x11, lCPI0_2@PAGEOFF]
	ushl.4s	v0, v0, v4
	and.16b	v0, v0, v2
	and.16b	v2, v3, v2
	add.4s	v0, v2, v0
	add.4s	v0, v0, v1
	addv.4s	s0, v0
	fmov	w11, s0
	add	w10, w11, w10
	add	w9, w10, w9
	add	w8, w9, w8
	mov	w9, #-20
	mul	w8, w8, w9
	add	w20, w8, #320
	mov	w21, #1
	mov	w24, #24
Lloh17:
	adrp	x25, _cg_weapons@GOTPAGE
Lloh18:
	ldr	x25, [x25, _cg_weapons@GOTPAGEOFF]
Lloh19:
	adrp	x26, _cgs@GOTPAGE
Lloh20:
	ldr	x26, [x26, _cgs@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, x21, lsl #2]
	cbz	w8, LBB0_9
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w20, w20, #40
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #1
	add	x24, x24, #16
	cmp	x21, #16
	b.eq	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w8, w23, w21
	tbz	w8, #0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_CG_RegisterWeapon
	ldr	x8, [x25]
	ldr	w4, [x8, x24]
	mov	x0, x20
	mov	w1, #380
	mov	w2, #32
	mov	w3, #32
	bl	_CG_DrawPic
	ldr	w8, [x22]
	cmp	x21, x8
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	sub	w0, w20, #4
	ldr	w4, [x26, #4]
	mov	w1, #376
	mov	w2, #40
	mov	w3, #40
	bl	_CG_DrawPic
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w4, [x26]
	mov	x0, x20
	mov	w1, #380
	mov	w2, #32
	mov	w3, #32
	bl	_CG_DrawPic
	b	LBB0_4
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x8, [x25]
	ldrsw	x9, [x22]
	lsl	x9, x9, #4
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_14
; %bb.12:
	ldr	x20, [x8]
	cbz	x20, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_CG_DrawStrlen
Lloh21:
	adrp	x8, _BIGCHAR_WIDTH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BIGCHAR_WIDTH@GOTPAGEOFF]
Lloh23:
	adrp	x9, _SCREEN_WIDTH@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SCREEN_WIDTH@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	ldr	w9, [x9]
	msub	w8, w8, w0, w9
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w0, w8, #1
	mov	w1, #358
	mov	x2, x20
	mov	x3, x19
	bl	_CG_DrawBigStringColor
LBB0_14:
	mov	x0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_trap_R_SetColor
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdr	Lloh15, Lloh16
	.loh AdrpAdrp	Lloh13, Lloh15
	.loh AdrpLdr	Lloh13, Lloh14
	.loh AdrpAdrp	Lloh11, Lloh13
	.loh AdrpLdr	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_cg,40,3                        ; @cg
	.comm	_STAT_HEALTH,8,3                ; @STAT_HEALTH
	.comm	_WEAPON_SELECT_TIME,4,2         ; @WEAPON_SELECT_TIME
	.comm	_STAT_WEAPONS,8,3               ; @STAT_WEAPONS
	.comm	_cg_weapons,8,3                 ; @cg_weapons
	.comm	_cgs,8,2                        ; @cgs
	.comm	_BIGCHAR_WIDTH,4,2              ; @BIGCHAR_WIDTH
	.comm	_SCREEN_WIDTH,4,2               ; @SCREEN_WIDTH
.subsections_via_symbols
