	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hfi1_lookup_pkey_idx           ## -- Begin function hfi1_lookup_pkey_idx
	.p2align	4, 0x90
_hfi1_lookup_pkey_idx:                  ## @hfi1_lookup_pkey_idx
	.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
	movl	%esi, %r13d
	callq	_ppd_from_ibp
	movq	%rax, %r14
	movq	_FULL_MGMT_P_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_LIM_MGMT_P_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	cmpl	%r13d, %ebx
	je	LBB0_7
## %bb.1:
	cmpl	%r13d, %r15d
	je	LBB0_7
## %bb.2:
	movl	$-1, %ebx
	testl	%eax, %eax
	je	LBB0_13
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movl	%ebx, %eax
	movl	(%rdi,%rax,4), %eax
	xorl	%r13d, %eax
	testl	$32767, %eax                    ## imm = 0x7FFF
	je	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jb	LBB0_4
## %bb.6:
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_7:
	movl	$-1, %ebx
	movl	$-1, %r12d
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movl	$-1, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movl	(%rdi,%r15,4), %eax
	cmpl	%r13d, %eax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_LIM_MGMT_P_KEY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	cmovel	%r15d, %r12d
	incq	%r15
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r15
	jb	LBB0_9
LBB0_11:
	movq	_FULL_MGMT_P_KEY@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	cmovel	%r12d, %ebx
	jmp	LBB0_13
LBB0_12:
	movl	%r15d, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FULL_MGMT_P_KEY,4,2            ## @FULL_MGMT_P_KEY
	.comm	_LIM_MGMT_P_KEY,4,2             ## @LIM_MGMT_P_KEY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hfi1_lookup_pkey_idx           ; -- Begin function hfi1_lookup_pkey_idx
	.p2align	2
_hfi1_lookup_pkey_idx:                  ; @hfi1_lookup_pkey_idx
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	bl	_ppd_from_ibp
	mov	x20, x0
Lloh0:
	adrp	x22, _FULL_MGMT_P_KEY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _FULL_MGMT_P_KEY@GOTPAGEOFF]
	ldr	w21, [x22]
Lloh2:
	adrp	x23, _LIM_MGMT_P_KEY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _LIM_MGMT_P_KEY@GOTPAGEOFF]
	ldr	w24, [x23]
	ldr	x0, [x0]
	bl	_ARRAY_SIZE
	cmp	w21, w19
	ccmp	w24, w19, #4, ne
	b.ne	LBB0_5
; %bb.1:
	cbz	w0, LBB0_10
; %bb.2:
	mov	x21, #0
	mov	w24, #-1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w8, [x0, x21, lsl #2]
	cmp	w8, w19
	b.eq	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x23]
	cmp	w8, w9
	csel	w24, w21, w24, eq
	add	x21, x21, #1
	bl	_ARRAY_SIZE
	cmp	x21, w0, uxtw
	b.lo	LBB0_3
	b	LBB0_11
LBB0_5:
	cbz	w0, LBB0_9
; %bb.6:
	mov	w21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w8, [x0, w21, uxtw #2]
	eor	w8, w8, w19
	tst	w8, #0x7fff
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w21, w21, #1
	bl	_ARRAY_SIZE
	cmp	w21, w0
	b.lo	LBB0_7
LBB0_9:
	mov	w21, #-1
	b	LBB0_12
LBB0_10:
	mov	w24, #-1
LBB0_11:
	ldr	w8, [x22]
	cmp	w8, w19
	csinv	w21, w24, wzr, eq
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_FULL_MGMT_P_KEY,4,2            ; @FULL_MGMT_P_KEY
	.comm	_LIM_MGMT_P_KEY,4,2             ; @LIM_MGMT_P_KEY
.subsections_via_symbols
