	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __subn_set_opa_pkeytable
___subn_set_opa_pkeytable:              ## @__subn_set_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -96(%rbp)                  ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	16(%rbp), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdi
	callq	_dd_from_ibdev
	movq	%rax, %r12
	movl	%ebx, %edi
	callq	_OPA_AM_NBLK
	movl	%eax, %r13d
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
                                        ## kill: def $ebx killed $ebx def $rbx
	andl	$2047, %ebx                     ## imm = 0x7FF
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_hfi1_get_npkeys
	testl	%r13d, %r13d
	je	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_OPA_PARTITION_TABLE_BLK_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %ebx
	imull	%r13d, %edi
	shll	$2, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_smp_length_check
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:
	incl	%ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r13d, %eax
	movq	_OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	cmpl	%ebx, %eax
	jg	LBB0_14
## %bb.5:
	cmpl	%r8d, %r13d
	jg	LBB0_14
## %bb.6:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%r12), %eax
	imull	%r13d, %eax
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %edi
	callq	_be16_to_cpu
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	movl	(%r12), %eax
	imull	%r13d, %eax
	cmpq	%rax, %rbx
	jb	LBB0_8
LBB0_9:
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_13
## %bb.10:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	callq	_set_pkeys
	testq	%rax, %rax
	jne	LBB0_11
LBB0_13:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movl	-68(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-96(%rbp), %r9                  ## 8-byte Reload
	callq	___subn_get_opa_pkeytable
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_pr_warn
LBB0_11:
	movq	_IB_SMP_INVALID_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	movq	%r14, %rdi
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_pr_warn
LBB0_3:
	movq	_IB_SMP_INVALID_FIELD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	orl	%eax, (%rdi)
LBB0_12:
	addq	$72, %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 Set PKey AM Invalid : s 0x%x; req 0x%x; avail 0x%x; blk/smp 0x%lx\n"

	.no_dead_strip	___subn_set_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_set_opa_pkeytable
___subn_set_opa_pkeytable:              ; @__subn_set_opa_pkeytable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x6
	mov	x23, x5
	mov	x20, x4
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	str	x3, [sp, #40]                   ; 8-byte Folded Spill
	mov	x0, x3
	bl	_dd_from_ibdev
	mov	x27, x0
	mov	x0, x25
	bl	_OPA_AM_NBLK
	mov	x28, x0
	and	w26, w25, #0x7ff
	mov	x0, x27
	bl	_hfi1_get_npkeys
	cbz	w28, LBB0_4
; %bb.1:
	mov	x22, x0
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	str	w20, [sp, #36]                  ; 4-byte Folded Spill
Lloh0:
	adrp	x20, _OPA_PARTITION_TABLE_BLK_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _OPA_PARTITION_TABLE_BLK_SIZE@GOTPAGEOFF]
	ldr	w23, [x20]
	mul	w8, w28, w23
	lsl	w0, w8, #2
	mov	x1, x21
	bl	_smp_length_check
	cbnz	x0, LBB0_6
; %bb.2:
	str	w21, [sp, #20]                  ; 4-byte Folded Spill
	udiv	w8, w22, w23
	add	w3, w8, #1
Lloh2:
	adrp	x8, _OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPA_NUM_PKEY_BLOCKS_PER_SMP@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w9, w28, w26
	cmp	w9, w3
	ccmp	w28, w8, #0, le
	b.le	LBB0_7
; %bb.3:
	str	x8, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x26
	mov	x2, x28
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x26
	mov	w3, #0
LBB0_5:
	bl	_pr_warn
LBB0_6:
Lloh9:
	adrp	x8, _IB_SMP_INVALID_FIELD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IB_SMP_INVALID_FIELD@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_reply
LBB0_7:
	ldr	w8, [x20]
	mul	w8, w8, w28
	cbz	w8, LBB0_10
; %bb.8:
	mov	x22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x21, x22, #2
	ldr	w0, [x24, x21]
	bl	_be16_to_cpu
	str	w0, [x24, x21]
	add	x22, x22, #1
	ldr	w8, [x20]
	mul	w8, w8, w28
	cmp	x22, x8
	b.lo	LBB0_9
LBB0_10:
	ldr	w20, [sp, #36]                  ; 4-byte Folded Reload
	ldr	x21, [sp, #24]                  ; 8-byte Folded Reload
	cbz	w26, LBB0_12
LBB0_11:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	ldr	x3, [sp, #40]                   ; 8-byte Folded Reload
	mov	x4, x20
	mov	x5, x21
	ldr	w6, [sp, #20]                   ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	___subn_get_opa_pkeytable
LBB0_12:
	mov	x0, x27
	mov	x1, x20
	mov	x2, x24
	bl	_set_pkeys
	cbnz	x0, LBB0_6
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.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 Set PKey AM Invalid : s 0x%x; req 0x%x; avail 0x%x; blk/smp 0x%lx\n"

	.no_dead_strip	___subn_set_opa_pkeytable
.subsections_via_symbols
