	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function modify_principal
_modify_principal:                      ## @modify_principal
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %ecx
	je	LBB0_4
## %bb.1:
	movq	_KADM5_BAD_MASK@GOTPCREL(%rip), %rax
LBB0_2:
	movq	(%rax), %rax
LBB0_3:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_KADM5_POLICY@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_7
## %bb.5:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_KADM5_UNK_POLICY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	(%r14), %rsi
	movl	8(%r14), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	*24(%rsi)
	testq	%rax, %rax
	jne	LBB0_3
## %bb.8:
	movq	(%r14), %rsi
	movl	8(%r14), %edi
	movl	(%r15), %edx
	movq	_HDB_F_GET_ANY@GOTPCREL(%rip), %rax
	movq	_HDB_F_ADMIN_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	-40(%rbp), %r9
	xorl	%r8d, %r8d
	callq	*16(%rsi)
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_15
## %bb.9:
	movl	$0, (%rsp)
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movq	%r15, %rcx
	movl	%ebx, %r8d
	xorl	%r9d, %r9d
	callq	__kadm5_setup_entry
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_14
## %bb.10:
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	__kadm5_set_modifier
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_14
## %bb.11:
	movl	8(%r14), %edi
	movq	(%r14), %rsi
	leaq	-40(%rbp), %rdx
	callq	_hdb_seal_keys
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_14
## %bb.12:
	movq	(%r14), %rsi
	movl	8(%r14), %edi
	movq	_HDB_F_REPLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	callq	*8(%rsi)
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_14
## %bb.13:
	movq	_KADM5_MOD_NAME@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_KADM5_MOD_TIME@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_kadm5_log_modify
	xorl	%r12d, %r12d
LBB0_14:
	movl	8(%r14), %edi
	leaq	-40(%rbp), %rsi
	callq	_hdb_free_entry
LBB0_15:
	movq	(%r14), %rsi
	movl	8(%r14), %edi
	callq	*(%rsi)
	movq	%r12, %rdi
	callq	__kadm5_error_code
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_KADM5_BAD_MASK,8,3             ## @KADM5_BAD_MASK
	.comm	_KADM5_POLICY,4,2               ## @KADM5_POLICY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"default"

	.comm	_KADM5_UNK_POLICY,8,3           ## @KADM5_UNK_POLICY
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_HDB_F_GET_ANY,4,2              ## @HDB_F_GET_ANY
	.comm	_HDB_F_ADMIN_DATA,4,2           ## @HDB_F_ADMIN_DATA
	.comm	_HDB_F_REPLACE,4,2              ## @HDB_F_REPLACE
	.comm	_KADM5_MOD_NAME,4,2             ## @KADM5_MOD_NAME
	.comm	_KADM5_MOD_TIME,4,2             ## @KADM5_MOD_TIME
	.no_dead_strip	_modify_principal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function modify_principal
_modify_principal:                      ; @modify_principal
	.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
	tst	w3, w2
	b.eq	LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _KADM5_BAD_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KADM5_BAD_MASK@GOTPAGEOFF]
LBB0_2:
	ldr	x0, [x8]
LBB0_3:
	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_4:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh2:
	adrp	x8, _KADM5_POLICY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KADM5_POLICY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_7
; %bb.5:
	ldr	w0, [x21, #4]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_7
; %bb.6:
Lloh7:
	adrp	x8, _KADM5_UNK_POLICY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KADM5_UNK_POLICY@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x1, [x19]
	ldr	x8, [x1, #24]
	ldr	w0, [x19, #8]
Lloh9:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x9]
	mov	w3, #0
	blr	x8
	cbnz	x0, LBB0_3
; %bb.8:
	ldr	x1, [x19]
	ldr	x8, [x1, #16]
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x9, _HDB_F_GET_ANY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HDB_F_GET_ANY@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _HDB_F_ADMIN_DATA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _HDB_F_ADMIN_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w3, w10, w9
	add	x5, sp, #8
	mov	w4, #0
	blr	x8
	mov	x22, x0
	cbnz	x0, LBB0_15
; %bb.9:
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x20
	mov	x3, x21
	mov	x4, x20
	mov	x5, #0
	mov	w6, #0
	bl	__kadm5_setup_entry
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.10:
	add	x1, sp, #8
	mov	x0, x19
	bl	__kadm5_set_modifier
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.11:
	ldr	w0, [x19, #8]
	ldr	x1, [x19]
	add	x2, sp, #8
	bl	_hdb_seal_keys
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.12:
	ldr	x1, [x19]
	ldr	x8, [x1, #8]
	ldr	w0, [x19, #8]
Lloh18:
	adrp	x9, _HDB_F_REPLACE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HDB_F_REPLACE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x9]
	add	x3, sp, #8
	blr	x8
	mov	x22, x0
	cbnz	x0, LBB0_14
; %bb.13:
Lloh21:
	adrp	x8, _KADM5_MOD_NAME@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KADM5_MOD_NAME@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	orr	w8, w8, w20
Lloh24:
	adrp	x9, _KADM5_MOD_TIME@GOTPAGE
Lloh25:
	ldr	x9, [x9, _KADM5_MOD_TIME@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w2, w8, w9
	add	x1, sp, #8
	mov	x0, x19
	bl	_kadm5_log_modify
LBB0_14:
	ldr	w0, [x19, #8]
	add	x1, sp, #8
	bl	_hdb_free_entry
LBB0_15:
	ldr	x1, [x19]
	ldr	x8, [x1]
	ldr	w0, [x19, #8]
	blr	x8
	mov	x0, x22
	bl	__kadm5_error_code
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_KADM5_BAD_MASK,8,3             ; @KADM5_BAD_MASK
	.comm	_KADM5_POLICY,4,2               ; @KADM5_POLICY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"default"

	.comm	_KADM5_UNK_POLICY,8,3           ; @KADM5_UNK_POLICY
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_HDB_F_GET_ANY,4,2              ; @HDB_F_GET_ANY
	.comm	_HDB_F_ADMIN_DATA,4,2           ; @HDB_F_ADMIN_DATA
	.comm	_HDB_F_REPLACE,4,2              ; @HDB_F_REPLACE
	.comm	_KADM5_MOD_NAME,4,2             ; @KADM5_MOD_NAME
	.comm	_KADM5_MOD_TIME,4,2             ; @KADM5_MOD_TIME
	.no_dead_strip	_modify_principal
.subsections_via_symbols
