	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function registry_get_handle
_registry_get_handle:                   ## @registry_get_handle
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r10
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r10, -64(%rbp)                 ## 8-byte Spill
	movw	$92, -42(%rbp)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %r13d
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	_registry_get_handle.wszProgramKey(%rip), %rdi
	callq	_lstrlenW
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_lstrlenW
	movl	%eax, %r15d
	leaq	-42(%rbp), %rdi
	callq	_lstrlenW
                                        ## kill: def $eax killed $eax def $rax
	addl	%r14d, %r15d
	leal	(%rax,%r15), %edx
	incl	%edx
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_HeapAlloc
	testl	%eax, %eax
	je	LBB0_9
## %bb.3:
	movl	%eax, %r13d
	leaq	_registry_get_handle.wszProgramKey(%rip), %rsi
	movl	%eax, %edi
	callq	_lstrcpyW
	leaq	-42(%rbp), %rsi
	movl	%r13d, %edi
	callq	_lstrcatW
	movl	%r13d, %edi
	movq	%r12, %rsi
	callq	_lstrcatW
	movq	-64(%rbp), %r10                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_4
LBB0_1:
	leaq	_registry_get_handle.wszProgramKey(%rip), %r13
LBB0_4:
	movq	_HKEY_CURRENT_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.5:
	movq	_REG_OPTION_NON_VOLATILE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movq	_KEY_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	orl	(%rax), %r9d
	subq	$8, %rsp
	movl	%r13d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	pushq	%rbx
	pushq	%r10
	pushq	$0
	callq	_RegCreateKeyExW
	addq	$32, %rsp
	jmp	LBB0_7
LBB0_6:
	movq	_KEY_READ@GOTPCREL(%rip), %rax
	movq	_KEY_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%r13d, %esi
	xorl	%edx, %edx
	movq	%r10, %r8
	callq	_RegOpenKeyExW
LBB0_7:
	movl	%eax, %ebx
	testq	%r12, %r12
	je	LBB0_10
## %bb.8:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_HeapFree
	jmp	LBB0_10
LBB0_9:
	movl	$1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @registry_get_handle.wszProgramKey
_registry_get_handle.wszProgramKey:
	.asciz	"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Wordpad"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_HKEY_CURRENT_USER,4,2          ## @HKEY_CURRENT_USER
	.comm	_REG_OPTION_NON_VOLATILE,4,2    ## @REG_OPTION_NON_VOLATILE
	.comm	_KEY_READ,4,2                   ## @KEY_READ
	.comm	_KEY_WRITE,4,2                  ## @KEY_WRITE
	.no_dead_strip	_registry_get_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function registry_get_handle
_registry_get_handle:                   ; @registry_get_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	cbz	x2, LBB0_3
; %bb.1:
	mov	w8, #92
	strh	w8, [sp, #14]
	bl	_GetProcessHeap
	mov	x21, x0
Lloh0:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x0, _registry_get_handle.wszProgramKey@PAGE
Lloh4:
	add	x0, x0, _registry_get_handle.wszProgramKey@PAGEOFF
	bl	_lstrlenW
	mov	x24, x0
	mov	x0, x19
	bl	_lstrlenW
	mov	x25, x0
	add	x0, sp, #14
	bl	_lstrlenW
	add	w8, w24, w25
	add	w8, w8, w0
	add	w2, w8, #1
	mov	x0, x21
	mov	x1, x23
	bl	_HeapAlloc
	cbz	w0, LBB0_8
; %bb.2:
	mov	x21, x0
Lloh5:
	adrp	x1, _registry_get_handle.wszProgramKey@PAGE
Lloh6:
	add	x1, x1, _registry_get_handle.wszProgramKey@PAGEOFF
	bl	_lstrcpyW
	add	x1, sp, #14
	mov	x0, x21
	bl	_lstrcatW
	mov	x0, x21
	mov	x1, x19
	bl	_lstrcatW
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x21, _registry_get_handle.wszProgramKey@PAGE
Lloh8:
	add	x21, x21, _registry_get_handle.wszProgramKey@PAGEOFF
LBB0_4:
Lloh9:
	adrp	x8, _HKEY_CURRENT_USER@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HKEY_CURRENT_USER@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	cbz	x22, LBB0_6
; %bb.5:
Lloh12:
	adrp	x8, _REG_OPTION_NON_VOLATILE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_OPTION_NON_VOLATILE@GOTPAGEOFF]
Lloh14:
	adrp	x9, _KEY_READ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _KEY_READ@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
Lloh17:
	ldr	w8, [x9]
Lloh18:
	adrp	x9, _KEY_WRITE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _KEY_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w5, w9, w8
	str	x22, [sp]
	mov	x1, x21
	mov	w2, #0
	mov	x3, #0
	mov	x6, #0
	mov	x7, x20
	bl	_RegCreateKeyExW
	mov	x20, x0
	cbnz	x19, LBB0_7
	b	LBB0_9
LBB0_6:
Lloh21:
	adrp	x8, _KEY_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KEY_READ@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _KEY_WRITE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _KEY_WRITE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x1, x21
	mov	w2, #0
	mov	x4, x20
	bl	_RegOpenKeyExW
	mov	x20, x0
	cbz	x19, LBB0_9
LBB0_7:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapFree
	b	LBB0_9
LBB0_8:
	mov	w20, #1
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_registry_get_handle.wszProgramKey:     ; @registry_get_handle.wszProgramKey
	.asciz	"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Wordpad"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_HKEY_CURRENT_USER,4,2          ; @HKEY_CURRENT_USER
	.comm	_REG_OPTION_NON_VOLATILE,4,2    ; @REG_OPTION_NON_VOLATILE
	.comm	_KEY_READ,4,2                   ; @KEY_READ
	.comm	_KEY_WRITE,4,2                  ; @KEY_WRITE
	.no_dead_strip	_registry_get_handle
.subsections_via_symbols
