	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BG_FindItemForWeapon           ## -- Begin function BG_FindItemForWeapon
	.p2align	4, 0x90
_BG_FindItemForWeapon:                  ## @BG_FindItemForWeapon
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	%rdi, %rdx
	movq	_bg_itemlist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, 40(%rax)
	je	LBB0_5
## %bb.1:
	movq	_IT_WEAPON@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	$24, %rax
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 40(%rax)
	leaq	24(%rax), %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, (%rax)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rdx, 8(%rax)
	jne	LBB0_4
## %bb.6:
	popq	%rbp
	retq
LBB0_5:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_Com_Error
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bg_itemlist,8,3                ## @bg_itemlist
	.comm	_IT_WEAPON,8,3                  ## @IT_WEAPON
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't find item for weapon %i"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BG_FindItemForWeapon           ; -- Begin function BG_FindItemForWeapon
	.p2align	2
_BG_FindItemForWeapon:                  ; @BG_FindItemForWeapon
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	mov	x2, x0
Lloh0:
	adrp	x8, _bg_itemlist@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bg_itemlist@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x8, #40]
	cbz	x9, LBB0_6
; %bb.1:
Lloh3:
	adrp	x9, _IT_WEAPON@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IT_WEAPON@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x8, #32
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x8, #32]
	add	x8, x8, #24
	cbz	x10, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x10, [x8, #-8]
	cmp	x10, x9
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x8]
	cmp	x10, x2
	b.ne	LBB0_2
; %bb.5:
	sub	x0, x8, #8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh6:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	mov	x0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_bg_itemlist,8,3                ; @bg_itemlist
	.comm	_IT_WEAPON,8,3                  ; @IT_WEAPON
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't find item for weapon %i"

.subsections_via_symbols
