	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_key
_open_key:                              ## @open_key
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_close_key
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	leaq	-32(%rbp), %rsi
	movq	%r15, %rdi
	callq	_parse_key_name
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	-32(%rbp), %rsi
	movq	_REG_OPTION_NON_VOLATILE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	_KEY_ALL_ACCESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	subq	$8, %rsp
	movl	%eax, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	pushq	$0
	pushq	%r14
	pushq	$0
	callq	_RegCreateKeyExW
	addq	$32, %rsp
	movq	%rax, %rbx
	movq	_ERROR_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	callq	_lstrlenW
                                        ## kill: def $eax killed $eax def $rax
	leal	4(,%rax,4), %edi
	callq	_heap_xalloc
	movl	%eax, 8(%r14)
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_lstrcpyW
	jmp	LBB0_6
LBB0_2:
	movq	_ERROR_INVALID_PARAMETER@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_6
LBB0_5:
	movq	$0, (%r14)
LBB0_6:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR_INVALID_PARAMETER,8,3    ## @ERROR_INVALID_PARAMETER
	.comm	_REG_OPTION_NON_VOLATILE,4,2    ## @REG_OPTION_NON_VOLATILE
	.comm	_KEY_ALL_ACCESS,4,2             ## @KEY_ALL_ACCESS
	.comm	_ERROR_SUCCESS,8,3              ## @ERROR_SUCCESS
	.no_dead_strip	_open_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_key
_open_key:                              ; @open_key
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_close_key
	cbz	x19, LBB0_4
; %bb.1:
	add	x1, sp, #8
	mov	x0, x19
	bl	_parse_key_name
	cbz	w0, LBB0_4
; %bb.2:
	ldr	x1, [sp, #8]
Lloh0:
	adrp	x8, _REG_OPTION_NON_VOLATILE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_OPTION_NON_VOLATILE@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
Lloh3:
	adrp	x8, _KEY_ALL_ACCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KEY_ALL_ACCESS@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	str	xzr, [sp]
	mov	w2, #0
	mov	x3, #0
	mov	x6, #0
	mov	x7, x20
	bl	_RegCreateKeyExW
	mov	x21, x0
Lloh6:
	adrp	x8, _ERROR_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERROR_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_lstrlenW
	lsl	w8, w0, #2
	add	w0, w8, #4
	bl	_heap_xalloc
	str	w0, [x20, #8]
	mov	x1, x19
	bl	_lstrcpyW
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _ERROR_INVALID_PARAMETER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERROR_INVALID_PARAMETER@GOTPAGEOFF]
Lloh11:
	ldr	x21, [x8]
	b	LBB0_6
LBB0_5:
	str	xzr, [x20]
LBB0_6:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR_INVALID_PARAMETER,8,3    ; @ERROR_INVALID_PARAMETER
	.comm	_REG_OPTION_NON_VOLATILE,4,2    ; @REG_OPTION_NON_VOLATILE
	.comm	_KEY_ALL_ACCESS,4,2             ; @KEY_ALL_ACCESS
	.comm	_ERROR_SUCCESS,8,3              ; @ERROR_SUCCESS
	.no_dead_strip	_open_key
.subsections_via_symbols
