	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pkeys
_set_pkeys:                             ## @set_pkeys
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	16(%rdi), %rax
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r15
	movslq	%esi, %rbx
	movq	-8(%r15,%rbx,8), %rcx
	movq	(%rax,%rcx,8), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_11
## %bb.1:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	leaq	(%r15,%rbx,8), %rax
	addq	$-8, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rdi
	movl	%ebx, (%rdi,%r12,4)
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r12
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%r12,4), %ebx
	movq	(%r14), %rdi
	movl	(%rdi,%r12,4), %esi
	cmpl	%esi, %ebx
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	$32767, %esi                    ## imm = 0x7FFF
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_rm_pkey
	orl	%eax, %r15d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	testl	$32767, %ebx                    ## imm = 0x7FFF
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_add_pkey
	testl	%eax, %eax
	movl	$0, %ecx
	cmovsl	%ecx, %ebx
	cmovlel	%ecx, %eax
	orl	%eax, %r15d
	jmp	LBB0_7
LBB0_9:
	testl	%r15d, %r15d
	movl	-52(%rbp), %r14d                ## 4-byte Reload
	je	LBB0_11
## %bb.10:
	movq	_QIB_IB_CFG_PKEYS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	callq	*8(%rbx)
	movq	_IB_EVENT_PKEY_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	%rbx, -80(%rbp)
	movl	%r14d, -88(%rbp)
	leaq	-88(%rbp), %rdi
	callq	_ib_dispatch_event
LBB0_11:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_IB_CFG_PKEYS,4,2           ## @QIB_IB_CFG_PKEYS
	.comm	_IB_EVENT_PKEY_CHANGE,4,2       ## @IB_EVENT_PKEY_CHANGE
	.no_dead_strip	_set_pkeys
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pkeys
_set_pkeys:                             ; @set_pkeys
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	sub	w8, w1, #1
	ldp	x10, x9, [x0, #16]
	add	x21, x9, w8, sxtw #3
	ldr	x8, [x21]
	ldr	x24, [x10, x8, lsl #3]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x26, #0
	mov	w25, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x24]
	str	w23, [x0, x26, lsl #2]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	bl	_ARRAY_SIZE
	cmp	x26, w0, sxtw
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x26, #2
	ldr	w23, [x22, x8]
	ldr	x0, [x24]
	ldr	w1, [x0, x8]
	cmp	w23, w1
	b.eq	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	tst	w1, #0x7fff
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_rm_pkey
	orr	w25, w0, w25
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	tst	w23, #0x7fff
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x1, x23
	bl	_add_pkey
	cmp	w0, #0
	csel	w23, wzr, w23, lt
	csel	w8, w0, wzr, gt
	orr	w25, w8, w25
	b	LBB0_2
LBB0_9:
	cbz	w25, LBB0_11
; %bb.10:
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _QIB_IB_CFG_PKEYS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QIB_IB_CFG_PKEYS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	mov	x0, x21
	mov	w2, #0
	blr	x8
Lloh3:
	adrp	x8, _IB_EVENT_PKEY_CHANGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_EVENT_PKEY_CHANGE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	x20, [sp, #16]
	str	w19, [sp, #8]
	add	x0, sp, #8
	bl	_ib_dispatch_event
LBB0_11:
	mov	w0, #0
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_IB_CFG_PKEYS,4,2           ; @QIB_IB_CFG_PKEYS
	.comm	_IB_EVENT_PKEY_CHANGE,4,2       ; @IB_EVENT_PKEY_CHANGE
	.no_dead_strip	_set_pkeys
.subsections_via_symbols
