	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyctl_setperm_key             ## -- Begin function keyctl_setperm_key
	.p2align	4, 0x90
_keyctl_setperm_key:                    ## @keyctl_setperm_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_KEY_POS_ALL@GOTPCREL(%rip), %rax
	movq	_KEY_USR_ALL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_KEY_GRP_ALL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_KEY_OTH_ALL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	testl	%esi, %ecx
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%esi, %r14d
	movq	_KEY_LOOKUP_CREATE@GOTPCREL(%rip), %rax
	movq	_KEY_LOOKUP_PARTIAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_KEY_SETATTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lookup_user_key
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_IS_ERR
	movl	%ebx, %edi
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	callq	_key_ref_to_ptr
	movq	%rax, %r15
	movq	_EACCES@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r15, %r12
	addq	$12, %r12
	movq	%r12, %rdi
	callq	_down_write
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movq	(%r15), %r13
	xorl	%eax, %eax
	callq	_current_fsuid
	cmpq	%rax, %r13
	jne	LBB0_5
LBB0_6:
	movl	%r14d, 8(%r15)
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_up_write
	movq	%r15, %rdi
	callq	_key_put
	jmp	LBB0_8
LBB0_5:
	negq	%rbx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_KEY_POS_ALL,4,2                ## @KEY_POS_ALL
	.comm	_KEY_USR_ALL,4,2                ## @KEY_USR_ALL
	.comm	_KEY_GRP_ALL,4,2                ## @KEY_GRP_ALL
	.comm	_KEY_OTH_ALL,4,2                ## @KEY_OTH_ALL
	.comm	_KEY_LOOKUP_CREATE,4,2          ## @KEY_LOOKUP_CREATE
	.comm	_KEY_LOOKUP_PARTIAL,4,2         ## @KEY_LOOKUP_PARTIAL
	.comm	_KEY_SETATTR,4,2                ## @KEY_SETATTR
	.comm	_EACCES,8,3                     ## @EACCES
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyctl_setperm_key             ; -- Begin function keyctl_setperm_key
	.p2align	2
_keyctl_setperm_key:                    ; @keyctl_setperm_key
	.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
Lloh0:
	adrp	x8, _KEY_POS_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_POS_ALL@GOTPAGEOFF]
Lloh2:
	adrp	x9, _KEY_USR_ALL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KEY_USR_ALL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _KEY_GRP_ALL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _KEY_GRP_ALL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _KEY_OTH_ALL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _KEY_OTH_ALL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bics	wzr, w1, w8
	b.eq	LBB0_3
; %bb.1:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	neg	x22, x8
LBB0_2:
	mov	x0, x22
	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
LBB0_3:
	mov	x19, x1
Lloh15:
	adrp	x8, _KEY_LOOKUP_CREATE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _KEY_LOOKUP_CREATE@GOTPAGEOFF]
Lloh17:
	adrp	x9, _KEY_LOOKUP_PARTIAL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _KEY_LOOKUP_PARTIAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh21:
	adrp	x8, _KEY_SETATTR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KEY_SETATTR@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	bl	_lookup_user_key
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x20
	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
	b	_PTR_ERR
LBB0_5:
	mov	x0, x20
	bl	_key_ref_to_ptr
	mov	x20, x0
Lloh24:
	adrp	x8, _EACCES@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh26:
	ldr	x22, [x8]
	add	x21, x0, #12
	mov	x0, x21
	bl	_down_write
Lloh27:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_capable
	cbnz	x0, LBB0_7
; %bb.6:
	ldr	x23, [x20]
	bl	_current_fsuid
	cmp	x23, x0
	b.ne	LBB0_9
LBB0_7:
	mov	x22, #0
	str	w19, [x20, #8]
LBB0_8:
	mov	x0, x21
	bl	_up_write
	mov	x0, x20
	bl	_key_put
	b	LBB0_2
LBB0_9:
	neg	x22, x22
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_KEY_POS_ALL,4,2                ; @KEY_POS_ALL
	.comm	_KEY_USR_ALL,4,2                ; @KEY_USR_ALL
	.comm	_KEY_GRP_ALL,4,2                ; @KEY_GRP_ALL
	.comm	_KEY_OTH_ALL,4,2                ; @KEY_OTH_ALL
	.comm	_KEY_LOOKUP_CREATE,4,2          ; @KEY_LOOKUP_CREATE
	.comm	_KEY_LOOKUP_PARTIAL,4,2         ; @KEY_LOOKUP_PARTIAL
	.comm	_KEY_SETATTR,4,2                ; @KEY_SETATTR
	.comm	_EACCES,8,3                     ; @EACCES
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
.subsections_via_symbols
