	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdb_seal_key_mkey              ## -- Begin function hdb_seal_key_mkey
	.p2align	4, 0x90
_hdb_seal_key_mkey:                     ## @hdb_seal_key_mkey
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rsi)
	je	LBB0_1
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %rbx
	movl	%edi, %r15d
	xorl	%edi, %edi
	movq	%rdx, %rsi
	callq	__hdb_find_master_key
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	movq	_HDB_KU_MKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	8(%rbx), %ecx
	movl	12(%rbx), %r8d
	leaq	-32(%rbp), %r9
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	__hdb_mkey_encrypt
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	movl	8(%rbx), %edi
	movl	12(%rbx), %edx
	xorl	%esi, %esi
	callq	_memset
	movl	8(%rbx), %edi
	callq	_free
	movq	-32(%rbp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movl	$4, %edi
	callq	_malloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_6
LBB0_7:
	movl	(%r14), %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_8
LBB0_2:
	movq	_HDB_ERR_NO_MKEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_9
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_HDB_ERR_NO_MKEY,8,3            ## @HDB_ERR_NO_MKEY
	.comm	_HDB_KU_MKEY,4,2                ## @HDB_KU_MKEY
	.comm	_ENOMEM,8,3                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdb_seal_key_mkey              ; -- Begin function hdb_seal_key_mkey
	.p2align	2
_hdb_seal_key_mkey:                     ; @hdb_seal_key_mkey
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x8, [x1]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x0, #0
LBB0_2:
	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
	add	sp, sp, #64
	ret
LBB0_3:
	mov	x19, x1
	mov	x21, x0
	mov	x0, #0
	mov	x1, x2
	bl	__hdb_find_master_key
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
Lloh0:
	adrp	x8, _HDB_KU_MKEY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HDB_KU_MKEY@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldp	w3, w4, [x19, #8]
	add	x5, sp, #8
	mov	x0, x21
	mov	x1, x20
	bl	__hdb_mkey_encrypt
	cbnz	x0, LBB0_2
; %bb.5:
	ldp	w0, w2, [x19, #8]
	mov	w1, #0
	bl	_memset
	ldr	w0, [x19, #8]
	bl	_free
	ldr	x8, [sp, #8]
	str	x8, [x19, #8]
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
; %bb.6:
	mov	w0, #4
	bl	_malloc
	mov	x8, x0
	str	x0, [x19]
	cbz	x0, LBB0_9
LBB0_7:
	mov	x0, #0
	ldr	w9, [x20]
	str	w9, [x8]
	b	LBB0_2
LBB0_8:
Lloh3:
	adrp	x8, _HDB_ERR_NO_MKEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDB_ERR_NO_MKEY@GOTPAGEOFF]
Lloh5:
	ldr	x0, [x8]
	b	LBB0_2
LBB0_9:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HDB_ERR_NO_MKEY,8,3            ; @HDB_ERR_NO_MKEY
	.comm	_HDB_KU_MKEY,4,2                ; @HDB_KU_MKEY
	.comm	_ENOMEM,8,3                     ; @ENOMEM
.subsections_via_symbols
