	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyctl_chown_key               ## -- Begin function keyctl_chown_key
	.p2align	4, 0x90
_keyctl_chown_key:                      ## @keyctl_chown_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rax
	andq	%rsi, %rax
	cmpq	$-1, %rax
	je	LBB0_3
## %bb.1:
	movq	%rdx, %r12
	movq	%rsi, %r13
	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_4
## %bb.2:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_3:
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_4:
	callq	_key_ref_to_ptr
	movq	%rax, %r14
	movq	_EACCES@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	leaq	20(%r14), %rbx
	movq	%rbx, %rdi
	callq	_down_write
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_8
LBB0_5:
	cmpq	$-1, %r13
	je	LBB0_14
## %bb.6:
	cmpq	%r13, (%r14)
	jne	LBB0_20
LBB0_14:
	xorl	%ebx, %ebx
	cmpq	$-1, %r12
	je	LBB0_16
LBB0_15:
	movq	%r12, 8(%r14)
LBB0_16:
	xorl	%r15d, %r15d
LBB0_17:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_up_write
	movq	%r14, %rdi
	callq	_key_put
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_key_user_put
LBB0_19:
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	cmpq	$-1, %r13
	je	LBB0_10
## %bb.9:
	cmpq	%r13, (%r14)
	jne	LBB0_24
LBB0_10:
	cmpq	$-1, %r12
	je	LBB0_5
## %bb.11:
	cmpq	%r12, 8(%r14)
	je	LBB0_5
## %bb.12:
	movq	%r12, %rdi
	callq	_in_group_p
	testl	%eax, %eax
	jne	LBB0_5
LBB0_24:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_20:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	xorl	%eax, %eax
	callq	_current_user_ns
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_key_user_lookup
	testq	%rax, %rax
	je	LBB0_17
## %bb.21:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	movq	_KEY_FLAG_IN_QUOTA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	addq	$32, %rsi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_30
## %bb.22:
	testq	%r13, %r13
	jne	LBB0_25
## %bb.23:
	movq	_key_quota_root_maxkeys@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_25:
	movq	_key_quota_maxkeys@GOTPCREL(%rip), %rax
LBB0_26:
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_key_quota_root_maxbytes@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_key_quota_maxbytes@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	8(%rax), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movl	(%rbx), %eax
	incl	%eax
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	jae	LBB0_33
## %bb.27:
	testq	%r13, %r13
	cmovel	-44(%rbp), %r15d                ## 4-byte Folded Reload
	movl	16(%r14), %ecx
	addl	4(%rbx), %ecx
	setb	%dl
	cmpl	%r15d, %ecx
	jae	LBB0_33
## %bb.28:
	testb	%dl, %dl
	jne	LBB0_33
## %bb.29:
	movl	%eax, (%rbx)
	movl	%ecx, 4(%rbx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	24(%r14), %rdi
	addq	$8, %rdi
	callq	_spin_lock
	movq	24(%r14), %rdi
	decl	(%rdi)
	movl	16(%r14), %eax
	subl	%eax, 4(%rdi)
	addq	$8, %rdi
	callq	_spin_unlock
LBB0_30:
	movq	24(%r14), %rdi
	addq	$16, %rdi
	callq	_atomic_dec
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	leaq	16(%r15), %rdi
	callq	_atomic_inc
	movq	_KEY_FLAG_INSTANTIATED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_32
## %bb.31:
	movq	24(%r14), %rdi
	addq	$12, %rdi
	callq	_atomic_dec
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_atomic_inc
LBB0_32:
	movq	24(%r14), %rax
	movq	%rbx, 24(%r14)
	movq	%r13, (%r14)
	movq	%rax, %rbx
	cmpq	$-1, %r12
	jne	LBB0_15
	jmp	LBB0_16
LBB0_33:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	movq	_EDQUOT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.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
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.comm	_KEY_FLAG_IN_QUOTA,4,2          ## @KEY_FLAG_IN_QUOTA
	.comm	_key_quota_root_maxkeys,4,2     ## @key_quota_root_maxkeys
	.comm	_key_quota_maxkeys,4,2          ## @key_quota_maxkeys
	.comm	_key_quota_root_maxbytes,4,2    ## @key_quota_root_maxbytes
	.comm	_key_quota_maxbytes,4,2         ## @key_quota_maxbytes
	.comm	_KEY_FLAG_INSTANTIATED,4,2      ## @KEY_FLAG_INSTANTIATED
	.comm	_EDQUOT,8,3                     ## @EDQUOT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_keyctl_chown_key               ; -- Begin function keyctl_chown_key
	.p2align	2
_keyctl_chown_key:                      ; @keyctl_chown_key
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	and	x8, x2, x1
	cmn	x8, #1
	b.eq	LBB0_3
; %bb.1:
	mov	x21, x2
	mov	x22, x1
Lloh0:
	adrp	x8, _KEY_LOOKUP_CREATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_LOOKUP_CREATE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _KEY_LOOKUP_PARTIAL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KEY_LOOKUP_PARTIAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh6:
	adrp	x8, _KEY_SETATTR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KEY_SETATTR@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_lookup_user_key
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_3:
	mov	x24, #0
	b	LBB0_29
LBB0_4:
	mov	x0, x19
	bl	_key_ref_to_ptr
	mov	x19, x0
Lloh9:
	adrp	x8, _EACCES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh11:
	ldr	x23, [x8]
	add	x20, x0, #20
	mov	x0, x20
	bl	_down_write
Lloh12:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_9
LBB0_5:
	cmn	x22, #1
	b.eq	LBB0_7
; %bb.6:
	ldr	x8, [x19]
	cmp	x8, x22
	b.ne	LBB0_15
LBB0_7:
	mov	x23, #0
	cmn	x21, #1
	b.eq	LBB0_24
LBB0_8:
	mov	x24, #0
	str	x21, [x19, #8]
	b	LBB0_27
LBB0_9:
	neg	x24, x23
	cmn	x22, #1
	b.eq	LBB0_11
; %bb.10:
	ldr	x8, [x19]
	cmp	x8, x22
	b.ne	LBB0_14
LBB0_11:
	cmn	x21, #1
	b.eq	LBB0_5
; %bb.12:
	ldr	x8, [x19, #8]
	cmp	x8, x21
	b.eq	LBB0_5
; %bb.13:
	mov	x0, x21
	bl	_in_group_p
	cbnz	w0, LBB0_5
LBB0_14:
	mov	x23, #0
	b	LBB0_27
LBB0_15:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	x24, [x8]
	bl	_current_user_ns
	mov	x1, x0
	mov	x0, x22
	bl	_key_user_lookup
	mov	x23, x0
	cbz	x0, LBB0_25
; %bb.16:
Lloh18:
	adrp	x8, _KEY_FLAG_IN_QUOTA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _KEY_FLAG_IN_QUOTA@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	add	x24, x19, #32
	mov	x1, x24
	bl	_test_bit
	cbz	x0, LBB0_21
; %bb.17:
Lloh21:
	adrp	x8, _key_quota_root_maxkeys@GOTPAGE
Lloh22:
	ldr	x8, [x8, _key_quota_root_maxkeys@GOTPAGEOFF]
Lloh23:
	adrp	x9, _key_quota_maxkeys@GOTPAGE
Lloh24:
	ldr	x9, [x9, _key_quota_maxkeys@GOTPAGEOFF]
	cmp	x22, #0
	csel	x8, x8, x9, eq
Lloh25:
	adrp	x9, _key_quota_root_maxbytes@GOTPAGE
Lloh26:
	ldr	x9, [x9, _key_quota_root_maxbytes@GOTPAGEOFF]
	ldr	w28, [x8]
Lloh27:
	ldr	w26, [x9]
Lloh28:
	adrp	x8, _key_quota_maxbytes@GOTPAGE
Lloh29:
	ldr	x8, [x8, _key_quota_maxbytes@GOTPAGEOFF]
Lloh30:
	ldr	w27, [x8]
	add	x25, x23, #8
	mov	x0, x25
	bl	_spin_lock
	ldr	w8, [x23]
	add	w8, w8, #1
	cmp	w8, w28
	b.hs	LBB0_26
; %bb.18:
	cmp	x22, #0
	csel	w11, w26, w27, eq
	ldr	w9, [x23, #4]
	ldr	w10, [x19, #16]
	adds	w9, w10, w9
	cset	w10, hs
	cmp	w9, w11
	b.hs	LBB0_26
; %bb.19:
	tbnz	w10, #0, LBB0_26
; %bb.20:
	stp	w8, w9, [x23]
	mov	x0, x25
	bl	_spin_unlock
	ldr	x8, [x19, #24]
	add	x0, x8, #8
	bl	_spin_lock
	ldr	x8, [x19, #24]
	ldp	w9, w10, [x8]
	sub	w9, w9, #1
	ldr	w11, [x19, #16]
	sub	w10, w10, w11
	stp	w9, w10, [x8]
	add	x0, x8, #8
	bl	_spin_unlock
LBB0_21:
	ldr	x8, [x19, #24]
	add	x0, x8, #16
	bl	_atomic_dec
	add	x0, x23, #16
	bl	_atomic_inc
Lloh31:
	adrp	x8, _KEY_FLAG_INSTANTIATED@GOTPAGE
Lloh32:
	ldr	x8, [x8, _KEY_FLAG_INSTANTIATED@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	mov	x1, x24
	bl	_test_bit
	cbz	x0, LBB0_23
; %bb.22:
	ldr	x8, [x19, #24]
	add	x0, x8, #12
	bl	_atomic_dec
	add	x0, x23, #12
	bl	_atomic_inc
LBB0_23:
	ldr	x8, [x19, #24]
	str	x23, [x19, #24]
	str	x22, [x19]
	mov	x23, x8
	cmn	x21, #1
	b.ne	LBB0_8
LBB0_24:
	mov	x24, #0
	b	LBB0_27
LBB0_25:
	neg	x24, x24
	b	LBB0_27
LBB0_26:
	mov	x0, x25
	bl	_spin_unlock
Lloh34:
	adrp	x8, _EDQUOT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EDQUOT@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	neg	x24, x8
LBB0_27:
	mov	x0, x20
	bl	_up_write
	mov	x0, x19
	bl	_key_put
	cbz	x23, LBB0_29
; %bb.28:
	mov	x0, x23
	bl	_key_user_put
LBB0_29:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.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
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.comm	_KEY_FLAG_IN_QUOTA,4,2          ; @KEY_FLAG_IN_QUOTA
	.comm	_key_quota_root_maxkeys,4,2     ; @key_quota_root_maxkeys
	.comm	_key_quota_maxkeys,4,2          ; @key_quota_maxkeys
	.comm	_key_quota_root_maxbytes,4,2    ; @key_quota_root_maxbytes
	.comm	_key_quota_maxbytes,4,2         ; @key_quota_maxbytes
	.comm	_KEY_FLAG_INSTANTIATED,4,2      ; @KEY_FLAG_INSTANTIATED
	.comm	_EDQUOT,8,3                     ; @EDQUOT
.subsections_via_symbols
