	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_mapping_key
_get_mapping_key:                       ## @get_mapping_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	%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	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %ebx
	leaq	_get_mapping_key.subkey(%rip), %rdi
	callq	_lstrlenW
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_strlenW
	addl	%eax, %r14d
	movq	%r12, %rdi
	callq	_strlenW
	addl	%eax, %r14d
	movq	%r15, %rdi
	callq	_strlenW
	addl	%eax, %r14d
	movl	%ebx, %edi
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_HeapAlloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	leaq	_get_mapping_key.subkey(%rip), %rsi
	movq	%r13, %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	callq	_sprintfW
	movq	_HKEY_CURRENT_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_2
## %bb.1:
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_RegCreateKeyW
	testq	%rax, %rax
	je	LBB0_5
LBB0_4:
	movq	$0, -48(%rbp)
LBB0_5:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_HeapFree
	movq	-48(%rbp), %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_RegOpenKeyW
	testq	%rax, %rax
	jne	LBB0_4
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @get_mapping_key.subkey
_get_mapping_key.subkey:
	.asciz	"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s"

	.comm	_HKEY_CURRENT_USER,4,2          ## @HKEY_CURRENT_USER
	.no_dead_strip	_get_mapping_key
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_mapping_key
_get_mapping_key:                       ; @get_mapping_key
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_GetProcessHeap
	mov	x19, x0
Lloh0:
	adrp	x24, _get_mapping_key.subkey@PAGE
Lloh1:
	add	x24, x24, _get_mapping_key.subkey@PAGEOFF
	mov	x0, x24
	bl	_lstrlenW
	mov	x25, x0
	mov	x0, x22
	bl	_strlenW
	add	w25, w0, w25
	mov	x0, x23
	bl	_strlenW
	add	w25, w25, w0
	mov	x0, x21
	bl	_strlenW
	add	w2, w25, w0
	mov	x0, x19
	mov	w1, #0
	bl	_HeapAlloc
	mov	x19, x0
	mov	x1, x24
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	bl	_sprintfW
Lloh2:
	adrp	x8, _HKEY_CURRENT_USER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HKEY_CURRENT_USER@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x2, sp, #8
	mov	x1, x19
	cbz	x20, LBB0_4
; %bb.1:
	bl	_RegCreateKeyW
	cbz	x0, LBB0_3
LBB0_2:
	str	xzr, [sp, #8]
LBB0_3:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
	ldr	x0, [sp, #8]
	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
LBB0_4:
	bl	_RegOpenKeyW
	cbnz	x0, LBB0_2
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_get_mapping_key.subkey:                ; @get_mapping_key.subkey
	.asciz	"Software\\Wine\\DirectInput\\Mappings\\%s\\%s\\%s"

	.comm	_HKEY_CURRENT_USER,4,2          ; @HKEY_CURRENT_USER
	.no_dead_strip	_get_mapping_key
.subsections_via_symbols
