	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function security_update
_security_update:                       ## @security_update
	.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	%ecx, %ebx
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r12
	leaq	24(%rdi), %r15
	movq	%r15, %rdi
	callq	_walk_to_nvdimm_bus
	movq	%rax, %rdi
	callq	_lockdep_assert_held
	movq	16(%r12), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	cmpq	$0, (%r12)
	je	LBB0_3
## %bb.5:
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_check_security_state
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:
	movq	_NVDIMM_BASE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_nvdimm_get_user_key_payload
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rbx
	movq	_NVDIMM_NEW_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rcx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_nvdimm_get_user_key_payload
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	16(%r12), %r8
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %ecx
	callq	*(%r8)
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_key_serial
	movl	%eax, %r14d
	movq	-64(%rbp), %rdi
	callq	_key_serial
	movq	_NVDIMM_MASTER@GOTPCREL(%rip), %rcx
	cmpl	%r13d, (%rcx)
	leaq	L_.str.1(%rip), %rcx
	leaq	L_.str.2(%rip), %r8
	cmoveq	%rcx, %r8
	testl	%ebx, %ebx
	leaq	L_.str.3(%rip), %rcx
	leaq	L_.str.4(%rip), %r9
	cmoveq	%rcx, %r9
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	movq	-64(%rbp), %rdi
	callq	_nvdimm_put_key
	movq	-48(%rbp), %rdi
	callq	_nvdimm_put_key
	movq	_NVDIMM_MASTER@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_12
## %bb.11:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_nvdimm_security_flags
	movq	%rax, 8(%r12)
	jmp	LBB0_13
LBB0_3:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOKEY@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_9:
	movq	-48(%rbp), %rdi
	callq	_nvdimm_put_key
	movq	_ENOKEY@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	movq	_NVDIMM_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_nvdimm_security_flags
	movq	%rax, (%r12)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_NVDIMM_BASE_KEY,4,2            ## @NVDIMM_BASE_KEY
	.comm	_ENOKEY,4,2                     ## @ENOKEY
	.comm	_NVDIMM_NEW_KEY,4,2             ## @NVDIMM_NEW_KEY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"key: %d %d update%s: %s\n"

	.comm	_NVDIMM_MASTER,4,2              ## @NVDIMM_MASTER
L_.str.1:                               ## @.str.1
	.asciz	"(master)"

L_.str.2:                               ## @.str.2
	.asciz	"(user)"

L_.str.3:                               ## @.str.3
	.asciz	"success"

L_.str.4:                               ## @.str.4
	.asciz	"fail"

	.comm	_NVDIMM_USER,4,2                ## @NVDIMM_USER
	.no_dead_strip	_security_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function security_update
_security_update:                       ; @security_update
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
	add	x21, x0, #24
	mov	x0, x21
	bl	_walk_to_nvdimm_bus
	bl	_lockdep_assert_held
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.1:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.2:
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.3:
	mov	x0, x19
	bl	_check_security_state
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.4:
Lloh0:
	adrp	x8, _NVDIMM_BASE_KEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVDIMM_BASE_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x24
	bl	_nvdimm_get_user_key_payload
	cbz	x0, LBB0_12
; %bb.5:
	mov	x22, x0
Lloh3:
	adrp	x8, _NVDIMM_NEW_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NVDIMM_NEW_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x19
	mov	x1, x23
	bl	_nvdimm_get_user_key_payload
	cbz	x0, LBB0_11
; %bb.6:
	mov	x2, x0
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x20
	blr	x8
	mov	x22, x0
	ldr	x0, [sp, #8]
	bl	_key_serial
	mov	x23, x0
	ldr	x0, [sp]
	bl	_key_serial
	mov	x3, x0
Lloh6:
	adrp	x24, _NVDIMM_MASTER@GOTPAGE
Lloh7:
	ldr	x24, [x24, _NVDIMM_MASTER@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh8:
	adrp	x9, l_.str.2@PAGE
Lloh9:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh10:
	adrp	x10, l_.str.1@PAGE
Lloh11:
	add	x10, x10, l_.str.1@PAGEOFF
	cmp	w8, w20
	csel	x4, x10, x9, eq
Lloh12:
	adrp	x8, l_.str.4@PAGE
Lloh13:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh14:
	adrp	x9, l_.str.3@PAGE
Lloh15:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w22, #0
	csel	x5, x9, x8, eq
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x23
	bl	_dev_dbg
	ldr	x0, [sp]
	bl	_nvdimm_put_key
	ldr	x0, [sp, #8]
	bl	_nvdimm_put_key
	ldr	w8, [x24]
	cmp	w8, w20
	b.ne	LBB0_13
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_nvdimm_security_flags
	str	x0, [x19, #8]
	b	LBB0_10
LBB0_8:
Lloh18:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_10:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	x0, [sp, #8]
	bl	_nvdimm_put_key
LBB0_12:
Lloh20:
	adrp	x8, _ENOKEY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOKEY@GOTPAGEOFF]
	b	LBB0_9
LBB0_13:
Lloh22:
	adrp	x8, _NVDIMM_USER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NVDIMM_USER@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_nvdimm_security_flags
	str	x0, [x19]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_NVDIMM_BASE_KEY,4,2            ; @NVDIMM_BASE_KEY
	.comm	_ENOKEY,4,2                     ; @ENOKEY
	.comm	_NVDIMM_NEW_KEY,4,2             ; @NVDIMM_NEW_KEY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"key: %d %d update%s: %s\n"

	.comm	_NVDIMM_MASTER,4,2              ; @NVDIMM_MASTER
l_.str.1:                               ; @.str.1
	.asciz	"(master)"

l_.str.2:                               ; @.str.2
	.asciz	"(user)"

l_.str.3:                               ; @.str.3
	.asciz	"success"

l_.str.4:                               ; @.str.4
	.asciz	"fail"

	.comm	_NVDIMM_USER,4,2                ; @NVDIMM_USER
	.no_dead_strip	_security_update
.subsections_via_symbols
