	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_set_part_key
_qib_set_part_key:                      ## @qib_set_part_key
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	andl	$32767, %r12d                   ## imm = 0x7FFF
	movq	_QIB_DEFAULT_P_KEY@GOTPCREL(%rip), %rax
	movl	$32767, %ecx                    ## imm = 0x7FFF
	andl	(%rax), %ecx
	xorl	%ebx, %ebx
	cmpl	%ecx, %r12d
	je	LBB0_30
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.3:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_28
## %bb.4:
	orl	$32768, %r14d                   ## imm = 0x8000
	movl	$-1, %eax
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	movslq	%eax, %rcx
	movl	%r13d, %eax
	cmpq	%rcx, %rbx
	jge	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movl	(%rdi,%rbx,4), %ecx
	cmpl	%r14d, %ecx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %edx
	notl	%edx
	orl	%edx, %ecx
	movl	%ebx, %r13d
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %r13d
	jmp	LBB0_9
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_10:
	cmpl	$-1, %r13d
	je	LBB0_28
## %bb.11:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_28
## %bb.12:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	andl	$32767, %eax                    ## imm = 0x7FFF
	cmpl	%r12d, %eax
	je	LBB0_6
LBB0_20:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r15
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r14
	cmpq	%rax, %r15
	jge	LBB0_21
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movl	(%rdi,%r14), %eax
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rbx
	addq	%r14, %rbx
	movq	%rbx, %rdi
	callq	_atomic_inc_return
	cmpl	$2, %eax
	jge	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	callq	_atomic_dec
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movl	(%rdi,%r14), %eax
	movl	$1, %ebx
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, %ebx
	jmp	LBB0_20
LBB0_6:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_21:
	testl	%ebx, %ebx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_28
## %bb.22:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_28
## %bb.23:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_27:                                ##   in Loop: Header=BB0_24 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r14
	cmpq	%rax, %rbx
	jge	LBB0_28
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	cmpl	$0, (%rdi,%r14)
	jne	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movq	16(%r12), %rdi
	addq	%r14, %rdi
	callq	_atomic_inc_return
	cmpl	$1, %eax
	je	LBB0_31
## %bb.26:                              ##   in Loop: Header=BB0_24 Depth=1
	movq	(%r12), %rdi
	jmp	LBB0_27
LBB0_28:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_29:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	%r13d, %rcx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax,%rcx,4)
	xorl	%ebx, %ebx
	jmp	LBB0_30
LBB0_31:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	%r13d, %rcx
	movl	%r15d, (%rax,%rcx,4)
	movq	(%r12), %rax
	movl	%r15d, (%rax,%r14)
	movq	8(%r12), %rax
	movq	_QIB_IB_CFG_PKEYS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	*(%rax)
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_DEFAULT_P_KEY,4,2          ## @QIB_DEFAULT_P_KEY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_QIB_IB_CFG_PKEYS,4,2           ## @QIB_IB_CFG_PKEYS
	.no_dead_strip	_qib_set_part_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_set_part_key
_qib_set_part_key:                      ; @qib_set_part_key
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	and	w24, w1, #0x7fff
Lloh0:
	adrp	x8, _QIB_DEFAULT_P_KEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QIB_DEFAULT_P_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, #0x7fff
	cmp	w24, w8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_28
LBB0_2:
	cbz	w24, LBB0_17
; %bb.3:
	mov	x21, x1
	mov	x19, x0
	ldp	x0, x20, [x0]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_26
; %bb.4:
	mov	x25, #0
	orr	w22, w21, #0x8000
	mov	w23, #-1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	ldr	w8, [x0, x25, lsl #2]
	cmp	w8, w22
	b.eq	LBB0_18
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmn	w23, #1
	ccmp	w8, #0, #0, eq
	csel	w23, w25, w23, eq
	add	x25, x25, #1
	bl	_ARRAY_SIZE
	cmp	x25, w0, sxtw
	b.lt	LBB0_5
; %bb.7:
	cmn	w23, #1
	b.eq	LBB0_26
; %bb.8:
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_26
; %bb.9:
	mov	x25, #0
	mov	x26, #0
	mov	w21, #0
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	and	w8, w8, #0x7fff
	cmp	w8, w24
	b.eq	LBB0_18
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x26, x26, #1
	bl	_ARRAY_SIZE
	add	x25, x25, #4
	cmp	x26, w0, sxtw
	b.ge	LBB0_19
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w8, [x0, x25]
	cbz	w8, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w8, w22
	b.ne	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x20, #16]
	add	x21, x8, x25
	mov	x0, x21
	bl	_atomic_inc_return
	cmp	w0, #2
	b.ge	LBB0_29
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x21
	bl	_atomic_dec
	ldr	x0, [x20]
	ldr	w8, [x0, x25]
	mov	w21, #1
	b	LBB0_10
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w21, #1
	b	LBB0_11
LBB0_17:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_27
LBB0_18:
Lloh5:
	adrp	x8, _EEXIST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_27
LBB0_19:
	cbz	w21, LBB0_26
; %bb.20:
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_26
; %bb.21:
	mov	x21, #0
	mov	x24, #0
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x21, x21, #4
	cmp	x24, w0, sxtw
	b.ge	LBB0_26
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w8, [x0, x21]
	cbnz	w8, LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x20, #16]
	add	x0, x8, x21
	bl	_atomic_inc_return
	cmp	w0, #1
	b.eq	LBB0_30
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x0, [x20]
	b	LBB0_22
LBB0_26:
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_28:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_29:
	mov	w0, #0
	ldr	x8, [x19]
	str	w22, [x8, w23, sxtw #2]
	b	LBB0_28
LBB0_30:
	ldr	x8, [x19]
	str	w22, [x8, w23, sxtw #2]
	ldp	x8, x9, [x20]
	str	w22, [x8, x21]
	ldr	x8, [x9]
Lloh9:
	adrp	x9, _QIB_IB_CFG_PKEYS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _QIB_IB_CFG_PKEYS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x9]
	mov	x0, x20
	mov	w2, #0
	blr	x8
	mov	w0, #0
	b	LBB0_28
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_DEFAULT_P_KEY,4,2          ; @QIB_DEFAULT_P_KEY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_QIB_IB_CFG_PKEYS,4,2           ; @QIB_IB_CFG_PKEYS
	.no_dead_strip	_qib_set_part_key
.subsections_via_symbols
