	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reg_restore
_reg_restore:                           ## @reg_restore
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	cmpl	$4, %edi
	jne	LBB0_8
## %bb.1:
	movq	16(%r14), %rdi
	leaq	-32(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	callq	_parse_registry_key
	movl	$1, %ebx
	testl	%eax, %eax
	je	LBB0_10
## %bb.2:
	movl	-32(%rbp), %edi
	movq	-40(%rbp), %rsi
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-28(%rbp), %r8
	xorl	%edx, %edx
	callq	_RegOpenKeyExW
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_STRING_INVALID_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%eax, %eax
	callq	_output_message
	jmp	LBB0_9
LBB0_8:
	movq	_STRING_INVALID_SYNTAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%eax, %eax
	callq	_output_message
	movq	_STRING_FUNC_HELP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r14), %rdi
	callq	_struprW
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_output_message
LBB0_9:
	movl	$1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_SE_BACKUP_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TRUE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_set_privilege
	testl	%eax, %eax
	je	LBB0_10
## %bb.5:
	movq	_SE_RESTORE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_set_privilege
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movl	-28(%rbp), %edi
	movq	24(%r14), %rsi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_RegRestoreKeyW
	movq	%rax, %r14
	movl	-28(%rbp), %edi
	callq	_RegCloseKey
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	callq	_output_error
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_KEY_READ,4,2                   ## @KEY_READ
	.comm	_STRING_INVALID_KEY,4,2         ## @STRING_INVALID_KEY
	.comm	_SE_BACKUP_NAME,4,2             ## @SE_BACKUP_NAME
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_SE_RESTORE_NAME,4,2            ## @SE_RESTORE_NAME
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
	.comm	_STRING_INVALID_SYNTAX,4,2      ## @STRING_INVALID_SYNTAX
	.comm	_STRING_FUNC_HELP,4,2           ## @STRING_FUNC_HELP
	.no_dead_strip	_reg_restore
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reg_restore
_reg_restore:                           ; @reg_restore
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x1
	cmp	w0, #4
	b.ne	LBB0_4
; %bb.1:
	ldr	x0, [x19, #16]
	sub	x1, x29, #20
	add	x2, sp, #16
	add	x3, sp, #8
	bl	_parse_registry_key
	cbz	w0, LBB0_6
; %bb.2:
	ldur	w0, [x29, #-20]
	ldr	x1, [sp, #16]
Lloh0:
	adrp	x8, _KEY_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_READ@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x4, sp, #24
	mov	w2, #0
	bl	_RegOpenKeyExW
	cbz	x0, LBB0_8
; %bb.3:
Lloh3:
	adrp	x8, _STRING_INVALID_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STRING_INVALID_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _STRING_INVALID_SYNTAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STRING_INVALID_SYNTAX@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_output_message
Lloh9:
	adrp	x8, _STRING_FUNC_HELP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STRING_FUNC_HELP@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	ldr	x0, [x19, #8]
	bl	_struprW
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x20
LBB0_5:
	bl	_output_message
LBB0_6:
	mov	w0, #1
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
Lloh12:
	adrp	x8, _SE_BACKUP_NAME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SE_BACKUP_NAME@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x20, _TRUE@GOTPAGE
Lloh16:
	ldr	x20, [x20, _TRUE@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_set_privilege
	cbz	w0, LBB0_6
; %bb.9:
Lloh17:
	adrp	x8, _SE_RESTORE_NAME@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SE_RESTORE_NAME@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	w1, [x20]
	bl	_set_privilege
	cbz	w0, LBB0_6
; %bb.10:
	ldr	w0, [sp, #24]
	ldr	x1, [x19, #24]
	mov	w2, #0
	bl	_RegRestoreKeyW
	mov	x19, x0
	ldr	w0, [sp, #24]
	bl	_RegCloseKey
	mov	w0, #0
Lloh20:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x19, x8
	b.eq	LBB0_7
; %bb.11:
	mov	x0, x19
	bl	_output_error
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_KEY_READ,4,2                   ; @KEY_READ
	.comm	_STRING_INVALID_KEY,4,2         ; @STRING_INVALID_KEY
	.comm	_SE_BACKUP_NAME,4,2             ; @SE_BACKUP_NAME
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_SE_RESTORE_NAME,4,2            ; @SE_RESTORE_NAME
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
	.comm	_STRING_INVALID_SYNTAX,4,2      ; @STRING_INVALID_SYNTAX
	.comm	_STRING_FUNC_HELP,4,2           ; @STRING_FUNC_HELP
	.no_dead_strip	_reg_restore
.subsections_via_symbols
