	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NiWriteConfig                  ## -- Begin function NiWriteConfig
	.p2align	4, 0x90
_NiWriteConfig:                         ## @NiWriteConfig
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_Lock
	movq	_TAG_ROOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_CfgCreateFolder
	movq	%rax, %r14
	movl	40(%rbx), %edi
	xorl	%esi, %esi
	callq	_XToBuf
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_CfgAddBuf
	movq	%r15, %rdi
	callq	_FreeBuf
	movl	36(%rbx), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_KToBuf
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_CfgAddBuf
	movq	%r15, %rdi
	callq	_FreeBuf
	movl	32(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	$4, %ecx
	callq	_CfgAddByte
	movl	28(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_CfgAddInt
	movl	24(%rbx), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_CfgAddBool
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_NiWriteVhOption
	cmpq	$0, 16(%rbx)
	je	LBB0_4
## %bb.2:
	cmpq	$0, 8(%rbx)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_NiWriteClientData
LBB0_4:
	movl	4(%rbx), %edi
	movq	%r14, %rsi
	callq	_SaveCfgRw
	movq	%r14, %rdi
	callq	_CfgDeleteFolder
	movl	(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Unlock                         ## TAILCALL
LBB0_5:
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TAG_ROOT,4,2                   ## @TAG_ROOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AdminCert"

L_.str.1:                               ## @.str.1
	.asciz	"AdminKey"

L_.str.2:                               ## @.str.2
	.asciz	"HashedPassword"

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

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

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_NiWriteConfig                  ; -- Begin function NiWriteConfig
	.p2align	2
_NiWriteConfig:                         ; @NiWriteConfig
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_5
; %bb.1:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w0, [x0]
	bl	_Lock
Lloh0:
	adrp	x8, _TAG_ROOT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TAG_ROOT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, #0
	bl	_CfgCreateFolder
	mov	x20, x0
	ldr	w0, [x19, #40]
	mov	w1, #0
	bl	_XToBuf
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_CfgAddBuf
	mov	x0, x21
	bl	_FreeBuf
	ldr	w0, [x19, #36]
	mov	w1, #0
	mov	x2, #0
	bl	_KToBuf
	mov	x21, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_CfgAddBuf
	mov	x0, x21
	bl	_FreeBuf
	ldr	w2, [x19, #32]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w3, #4
	bl	_CfgAddByte
	ldr	w2, [x19, #28]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_CfgAddInt
	ldr	w2, [x19, #24]
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_CfgAddBool
	mov	x0, x19
	mov	x1, x20
	bl	_NiWriteVhOption
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_NiWriteClientData
LBB0_4:
	ldr	w0, [x19, #4]
	mov	x1, x20
	bl	_SaveCfgRw
	mov	x0, x20
	bl	_CfgDeleteFolder
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_Unlock
LBB0_5:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	ret
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_TAG_ROOT,4,2                   ; @TAG_ROOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AdminCert"

l_.str.1:                               ; @.str.1
	.asciz	"AdminKey"

l_.str.2:                               ; @.str.2
	.asciz	"HashedPassword"

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

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

.subsections_via_symbols
