	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __subn_get_opa_pkeytable
___subn_get_opa_pkeytable:              ## @__subn_get_opa_pkeytable
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r13d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	16(%rbp), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rdi
	callq	_dd_from_ibdev
	movq	%rax, %r12
	movl	%r14d, %edi
	callq	_OPA_AM_NBLK
	movl	%eax, %r15d
	andl	$2047, %r14d                    ## imm = 0x7FF
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_hfi1_get_npkeys
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	movl	%eax, %ecx
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_OPA_PARTITION_TABLE_BLK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %r13d
	imull	%r15d, %r12d
	shlq	$2, %r12
	movq	%r12, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	%ecx, %ebx
	callq	_smp_length_check
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	incl	%r13d
	leal	(%r15,%r14), %eax
	movq	_OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	cmpl	%r13d, %eax
	jg	LBB0_5
## %bb.4:
	cmpl	%r8d, %r15d
	jg	LBB0_5
## %bb.7:
	testl	%r14d, %r14d
	jne	LBB0_6
## %bb.8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_get_pkeys
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.9:
	movl	%ebx, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %edi
	callq	_cpu_to_be16
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_10
LBB0_11:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_13
## %bb.12:
	addl	%r12d, (%rax)
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_pr_warn
	movq	_IB_SMP_INVALID_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	movq	%rbx, %rdi
	jmp	LBB0_13
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_pr_warn
LBB0_6:
	movq	_IB_SMP_INVALID_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	orl	%eax, (%rdi)
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reply                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"OPA Get PKey AM Invalid : P = %d; B = 0x%x; N = 0x%x\n"

	.comm	_IB_SMP_INVALID_FIELD,4,2       ## @IB_SMP_INVALID_FIELD
	.comm	_OPA_PARTITION_TABLE_BLK_SIZE,4,2 ## @OPA_PARTITION_TABLE_BLK_SIZE
	.comm	_OPA_NUM_PKEY_BLOCKS_PER_SMP,4,2 ## @OPA_NUM_PKEY_BLOCKS_PER_SMP
L_.str.1:                               ## @.str.1
	.asciz	"OPA Get PKey AM Invalid : s 0x%x; req 0x%x; avail 0x%x; blk/smp 0x%lx\n"

	.no_dead_strip	___subn_get_opa_pkeytable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __subn_get_opa_pkeytable
___subn_get_opa_pkeytable:              ; @__subn_get_opa_pkeytable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x28, x6
	mov	x20, x5
	mov	x23, x4
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x0, x3
	bl	_dd_from_ibdev
	mov	x25, x0
	mov	x0, x22
	bl	_OPA_AM_NBLK
	mov	x26, x0
	and	w24, w22, #0x7ff
	mov	x0, x25
	bl	_hfi1_get_npkeys
	cbz	w26, LBB0_4
; %bb.1:
	mov	x27, x0
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _OPA_PARTITION_TABLE_BLK_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OPA_PARTITION_TABLE_BLK_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mul	w8, w20, w26
	lsl	x22, x8, #2
	mov	x0, x22
	mov	x1, x28
	bl	_smp_length_check
	cbnz	x0, LBB0_6
; %bb.2:
	udiv	w8, w27, w20
	add	w3, w8, #1
Lloh3:
	adrp	x8, _OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w9, w26, w24
	cmp	w9, w3
	ccmp	w26, w8, #0, le
	b.le	LBB0_8
; %bb.3:
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x24
	mov	x2, x26
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x24
	mov	w3, #0
LBB0_5:
	bl	_pr_warn
LBB0_6:
Lloh10:
	adrp	x8, _IB_SMP_INVALID_FIELD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IB_SMP_INVALID_FIELD@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_reply
LBB0_8:
	cbnz	w24, LBB0_6
; %bb.9:
	mov	x0, x25
	mov	x1, x23
	mov	x2, x21
	bl	_get_pkeys
	cbz	w27, LBB0_12
; %bb.10:
	mov	w23, w27
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_cpu_to_be16
	str	w0, [x21], #4
	subs	x23, x23, #1
	b.ne	LBB0_11
LBB0_12:
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x9, LBB0_7
; %bb.13:
	ldr	w8, [x9]
	add	w8, w8, w22
	str	w8, [x9]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"OPA Get PKey AM Invalid : P = %d; B = 0x%x; N = 0x%x\n"

	.comm	_IB_SMP_INVALID_FIELD,4,2       ; @IB_SMP_INVALID_FIELD
	.comm	_OPA_PARTITION_TABLE_BLK_SIZE,4,2 ; @OPA_PARTITION_TABLE_BLK_SIZE
	.comm	_OPA_NUM_PKEY_BLOCKS_PER_SMP,4,2 ; @OPA_NUM_PKEY_BLOCKS_PER_SMP
l_.str.1:                               ; @.str.1
	.asciz	"OPA Get PKey AM Invalid : s 0x%x; req 0x%x; avail 0x%x; blk/smp 0x%lx\n"

	.no_dead_strip	___subn_get_opa_pkeytable
.subsections_via_symbols
