	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_mapping_settings          ## -- Begin function load_mapping_settings
	.p2align	4, 0x90
_load_mapping_settings:                 ## @load_mapping_settings
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$12, -96(%rbp)
	leaq	-96(%rbp), %rsi
	callq	_IDirectInputDevice8_GetDeviceInfo
	leaq	16(%rbx), %rdi
	leaq	-80(%rbp), %rsi
	callq	_StringFromCLSID
	movq	_S_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movl	-88(%rbp), %edi
	movq	-80(%rbp), %rdx
	movq	_FALSE@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%r14, %rsi
	callq	_get_mapping_key
	testl	%eax, %eax
	je	LBB0_10
## %bb.3:
	movl	%eax, %r14d
	cmpl	$0, (%rbx)
	jle	LBB0_9
## %bb.4:
	movq	8(%rbx), %rax
	movl	$8, %r12d
	xorl	%r15d, %r15d
	leaq	-57(%rbp), %r13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %rdi
	addq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	8(%rbx), %rax
	movq	_DIAH_UNMAPPED@GOTPCREL(%rip), %rcx
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rcx), %ecx
	movl	%ecx, -4(%rax,%r12)
	incq	%r15
	movslq	(%rbx), %rcx
	addq	$16, %r12
	cmpq	%rcx, %r15
	jge	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$4, -64(%rbp)
	movl	4(%rax,%r12), %edx
	movq	%r13, %rdi
	leaq	_load_mapping_settings.format(%rip), %rsi
	callq	_sprintfW
	movl	%r14d, %edi
	movq	%r13, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-68(%rbp), %r8
                                        ## kill: def $r8d killed $r8d killed $r8
	leaq	-64(%rbp), %r9
	callq	_RegQueryValueExW
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-68(%rbp), %ecx
	movq	8(%rbx), %rax
	movl	%ecx, -8(%rax,%r12)
	movl	-92(%rbp), %ecx
	movl	%ecx, (%rax,%r12)
	movq	_DIAH_USERCONFIG@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_1:
	movq	_FALSE@GOTPCREL(%rip), %r15
	jmp	LBB0_11
LBB0_9:
	movl	%r14d, %edi
	callq	_RegCloseKey
	movq	_TRUE@GOTPCREL(%rip), %r15
LBB0_10:
	movq	-80(%rbp), %rdi
	callq	_CoTaskMemFree
LBB0_11:
	movl	(%r15), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_13
## %bb.12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_S_OK,8,3                       ## @S_OK
	.comm	_FALSE,4,2                      ## @FALSE
	.section	__TEXT,__const
_load_mapping_settings.format:          ## @load_mapping_settings.format
	.asciz	"%x"

	.comm	_DIAH_USERCONFIG,4,2            ## @DIAH_USERCONFIG
	.comm	_DIAH_UNMAPPED,4,2              ## @DIAH_UNMAPPED
	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_load_mapping_settings          ; -- Begin function load_mapping_settings
	.p2align	2
_load_mapping_settings:                 ; @load_mapping_settings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x2
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	mov	w8, #12
	str	w8, [sp, #16]
	add	x1, sp, #16
	bl	_IDirectInputDevice8_GetDeviceInfo
	add	x0, x19, #16
	add	x1, sp, #32
	bl	_StringFromCLSID
Lloh3:
	adrp	x8, _S_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x21, _FALSE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.1:
	ldr	w0, [sp, #24]
	ldr	x2, [sp, #32]
	ldr	w3, [x21]
	mov	x1, x20
	bl	_get_mapping_key
	cbz	w0, LBB0_9
; %bb.2:
	mov	x20, x0
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
	mov	x22, #0
	mov	x23, #0
	ldr	x8, [x19, #8]
	mov	w24, #4
Lloh8:
	adrp	x25, _DIAH_USERCONFIG@GOTPAGE
Lloh9:
	ldr	x25, [x25, _DIAH_USERCONFIG@GOTPAGEOFF]
Lloh10:
	adrp	x26, _DIAH_UNMAPPED@GOTPAGE
Lloh11:
	ldr	x26, [x26, _DIAH_UNMAPPED@GOTPAGEOFF]
Lloh12:
	adrp	x21, _load_mapping_settings.format@PAGE
Lloh13:
	add	x21, x21, _load_mapping_settings.format@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x22
	add	x0, x8, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x19, #8]
	mov	x9, x26
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x9]
	add	x10, x8, x22
	str	w9, [x10, #4]
	add	x23, x23, #1
	ldrsw	x9, [x19]
	add	x22, x22, #16
	cmp	x23, x9
	b.ge	LBB0_8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	w24, [sp, #8]
	add	x8, x8, x22
	ldr	w2, [x8, #12]
	add	x0, sp, #47
	mov	x1, x21
	bl	_sprintfW
	add	x1, sp, #47
	add	x4, sp, #12
	add	x5, sp, #8
	mov	x0, x20
	mov	w2, #0
	mov	x3, #0
	bl	_RegQueryValueExW
	cbnz	w0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [sp, #12]
	ldr	x8, [x19, #8]
	add	x10, x8, x22
	str	w9, [x10]
	ldr	w9, [sp, #20]
	str	w9, [x10, #8]
	mov	x9, x25
	b	LBB0_5
LBB0_8:
	mov	x0, x20
	bl	_RegCloseKey
Lloh14:
	adrp	x21, _TRUE@GOTPAGE
Lloh15:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
LBB0_9:
	ldr	x0, [sp, #32]
	bl	_CoTaskMemFree
LBB0_10:
	ldr	w0, [x21]
	ldr	x8, [sp, #56]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_S_OK,8,3                       ; @S_OK
	.comm	_FALSE,4,2                      ; @FALSE
	.section	__TEXT,__const
_load_mapping_settings.format:          ; @load_mapping_settings.format
	.asciz	"%x"

	.comm	_DIAH_USERCONFIG,4,2            ; @DIAH_USERCONFIG
	.comm	_DIAH_UNMAPPED,4,2              ; @DIAH_UNMAPPED
	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
