	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %rax
	movq	(%rax), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_11
## %bb.1:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdi
	movl	%ebx, (%rdi,%r14,4)
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r14
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%r14,4), %ebx
	movq	(%r12), %rdi
	movl	(%rdi,%r14,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, %r13d
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, %r13d
	jmp	LBB0_7
LBB0_9:
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.10:
	movq	_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_ipath_cdbg
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movl	(%rax), %esi
	callq	_ipath_write_kreg
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VERBOSE,4,2                    ## @VERBOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"p0 new pkey reg %llx\n"

	.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:
	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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x22, [x8]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x24, #0
	mov	w23, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x22]
	str	w21, [x0, x24, lsl #2]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	cmp	x24, w0, sxtw
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x24, #2
	ldr	w21, [x20, x8]
	ldr	x0, [x22]
	ldr	w1, [x0, x8]
	cmp	w21, 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, x19
	bl	_rm_pkey
	orr	w23, w0, w23
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	tst	w21, #0x7fff
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_add_pkey
	cmp	w0, #0
	csel	w21, wzr, w21, lt
	csel	w8, w0, wzr, gt
	orr	w23, w8, w23
	b	LBB0_2
LBB0_9:
	cbz	w23, LBB0_11
; %bb.10:
Lloh0:
	adrp	x8, _VERBOSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VERBOSE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ipath_cdbg
	ldr	x8, [x19]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ipath_write_kreg
LBB0_11:
	mov	w0, #0
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VERBOSE,4,2                    ; @VERBOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"p0 new pkey reg %llx\n"

	.no_dead_strip	_set_pkeys
.subsections_via_symbols
