	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_config_save_autoconf_profile   ## -- Begin function config_save_autoconf_profile
	.p2align	4, 0x90
_config_save_autoconf_profile:          ## @config_save_autoconf_profile
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %r13
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	callq	_malloc
	movq	%rax, %r12
	movl	(%rbx), %edi
	callq	_malloc
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_strdup
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movb	$0, (%rbx)
	movb	$0, (%r12)
	movq	_invalid_filename_chars@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.1:
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movb	$95, (%rax)
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rsi
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%r14d
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rsi
	testq	%rsi, %rsi
	jne	LBB0_3
LBB0_5:
	movq	%r12, %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_fill_pathname_join
	movq	%r12, %rdi
	callq	_path_is_directory
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_PATH_MAX_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_malloc
	movq	%rax, %rbx
	movb	$0, (%rax)
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r13, %rcx
	callq	_fill_pathname_join
	leaq	L_.str(%rip), %rdx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rcx
	callq	_fill_pathname_noext
	movq	%rbx, %rdi
	callq	_free
	jmp	LBB0_8
LBB0_7:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movq	%r13, %rcx
	callq	_fill_pathname_join
	leaq	L_.str(%rip), %rdx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%r13, %rcx
	callq	_fill_pathname_noext
LBB0_8:
	movq	%r12, %rdi
	callq	_free
	movq	%r15, %rdi
	callq	_free
	movq	%r14, %rdi
	callq	_config_file_new_from_path_to_string
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_config_file_new_alloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_19
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_config_set_string
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edi
	callq	_input_config_get_device_name
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	callq	_config_set_string
	movl	%r12d, %edi
	callq	_input_config_get_pid
	movq	%rax, %r14
	movl	%r12d, %edi
	callq	_input_config_get_vid
	testq	%r14, %r14
	je	LBB0_13
## %bb.11:
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rdx
	callq	_config_set_int
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	_config_set_int
LBB0_13:
	movq	%rbx, %r15
	movq	_RARCH_FIRST_META_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:
	movl	%r12d, %r12d
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	addq	$8, %r14
	cmpq	%rcx, %rbx
	jae	LBB0_18
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	_input_config_binds@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx,%r12,8), %r13
	cmpq	$0, (%r13,%rbx,8)
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	addq	%r14, %r13
	movl	%ebx, %edi
	callq	_input_config_bind_map_get_base
	movq	%r15, %rdi
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edx
	movq	%r13, %rcx
	xorl	%r8d, %r8d
	callq	_input_config_save_keybind
	movq	_RARCH_FIRST_META_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_17
LBB0_18:
	movq	%r15, %rbx
	movq	%r15, %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_config_file_write
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_config_file_free
LBB0_19:
	movq	%r14, %rdi
	callq	_free
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX_LENGTH,4,2            ## @PATH_MAX_LENGTH
	.comm	_invalid_filename_chars,8,3     ## @invalid_filename_chars
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	".cfg"

L_.str.1:                               ## @.str.1
	.asciz	"input_driver"

L_.str.2:                               ## @.str.2
	.asciz	"input_device"

L_.str.3:                               ## @.str.3
	.asciz	"input_vendor_id"

L_.str.4:                               ## @.str.4
	.asciz	"input_product_id"

	.comm	_RARCH_FIRST_META_KEY,4,2       ## @RARCH_FIRST_META_KEY
	.comm	_input_config_binds,8,3         ## @input_config_binds
L_.str.5:                               ## @.str.5
	.asciz	"input"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_config_save_autoconf_profile   ; -- Begin function config_save_autoconf_profile
	.p2align	2
_config_save_autoconf_profile:          ; @config_save_autoconf_profile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	w1, [sp, #12]                   ; 4-byte Folded Spill
	mov	x24, x0
Lloh0:
	adrp	x26, _PATH_MAX_LENGTH@GOTPAGE
Lloh1:
	ldr	x26, [x26, _PATH_MAX_LENGTH@GOTPAGEOFF]
	ldrsw	x22, [x26]
	bl	_config_get_ptr
	ldp	x20, x25, [x0]
	ldr	w0, [x26]
	bl	_malloc
	mov	x23, x0
	ldr	w0, [x26]
	bl	_malloc
	mov	x19, x0
	mov	x0, x24
	bl	_strdup
	mov	x24, x0
	strb	wzr, [x19]
	strb	wzr, [x23]
Lloh2:
	adrp	x27, _invalid_filename_chars@GOTPAGE
Lloh3:
	ldr	x27, [x27, _invalid_filename_chars@GOTPAGEOFF]
	ldr	x8, [x27]
	ldr	x1, [x8]
	cbz	x1, LBB0_5
; %bb.1:
	mov	x28, #0
	mov	w21, #95
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	strb	w21, [x0]
	ldr	x8, [x27]
	ldr	x1, [x8, x28, lsl #3]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_strstr
	cbnz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w28, w28, #1
	ldr	x8, [x27]
	ldr	x1, [x8, w28, uxtw #3]
	cbnz	x1, LBB0_3
LBB0_5:
	mov	x0, x23
	mov	x1, x25
	mov	x2, x20
	mov	x3, x22
	bl	_fill_pathname_join
	mov	x0, x23
	bl	_path_is_directory
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x26]
	bl	_malloc
	mov	x25, x0
	strb	wzr, [x0]
	mov	x1, x23
	mov	x2, x24
	mov	x3, x22
	bl	_fill_pathname_join
Lloh4:
	adrp	x2, l_.str@PAGE
Lloh5:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x25
	mov	x3, x22
	bl	_fill_pathname_noext
	mov	x0, x25
	bl	_free
	b	LBB0_8
LBB0_7:
	mov	x0, x23
	mov	x1, x25
	mov	x2, x24
	mov	x3, x22
	bl	_fill_pathname_join
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x23
	mov	x3, x22
	bl	_fill_pathname_noext
LBB0_8:
	mov	x0, x23
	bl	_free
	mov	x0, x24
	bl	_free
	mov	x0, x19
	bl	_config_file_new_from_path_to_string
	mov	x22, x0
	cbnz	x0, LBB0_10
; %bb.9:
	bl	_config_file_new_alloc
	mov	x22, x0
	cbz	x0, LBB0_20
LBB0_10:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	bl	_config_set_string
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
	mov	x0, x20
	bl	_input_config_get_device_name
	mov	x2, x0
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_config_set_string
	mov	x0, x20
	bl	_input_config_get_pid
	mov	x21, x0
	mov	x0, x20
	bl	_input_config_get_vid
	cbz	x21, LBB0_13
; %bb.11:
	mov	x2, x0
	cbz	x0, LBB0_13
; %bb.12:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_config_set_int
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_config_set_int
LBB0_13:
Lloh16:
	adrp	x24, _RARCH_FIRST_META_KEY@GOTPAGE
Lloh17:
	ldr	x24, [x24, _RARCH_FIRST_META_KEY@GOTPAGEOFF]
	ldr	w8, [x24]
	cbz	w8, LBB0_18
; %bb.14:
	mov	x25, #0
	mov	x21, #0
	mov	w26, w20
Lloh18:
	adrp	x27, _input_config_binds@GOTPAGE
Lloh19:
	ldr	x27, [x27, _input_config_binds@GOTPAGEOFF]
Lloh20:
	adrp	x20, l_.str.5@PAGE
Lloh21:
	add	x20, x20, l_.str.5@PAGEOFF
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x21, x21, #1
	add	x25, x25, #8
	cmp	x21, w8, uxtw
	b.hs	LBB0_18
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x27]
	ldr	x9, [x9, x26, lsl #3]
	ldr	x10, [x9, x21, lsl #3]
	cbz	x10, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x23, x9, x25
	mov	x0, x21
	bl	_input_config_bind_map_get_base
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	mov	x3, x23
	mov	w4, #0
	bl	_input_config_save_keybind
	ldr	w8, [x24]
	b	LBB0_15
LBB0_18:
	mov	x0, x22
	mov	x1, x19
	mov	w2, #0
	bl	_config_file_write
	mov	x20, x0
	mov	x0, x22
	bl	_config_file_free
LBB0_19:
	mov	x0, x19
	bl	_free
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	mov	w20, #0
	b	LBB0_19
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX_LENGTH,4,2            ; @PATH_MAX_LENGTH
	.comm	_invalid_filename_chars,8,3     ; @invalid_filename_chars
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	".cfg"

l_.str.1:                               ; @.str.1
	.asciz	"input_driver"

l_.str.2:                               ; @.str.2
	.asciz	"input_device"

l_.str.3:                               ; @.str.3
	.asciz	"input_vendor_id"

l_.str.4:                               ; @.str.4
	.asciz	"input_product_id"

	.comm	_RARCH_FIRST_META_KEY,4,2       ; @RARCH_FIRST_META_KEY
	.comm	_input_config_binds,8,3         ; @input_config_binds
l_.str.5:                               ; @.str.5
	.asciz	"input"

.subsections_via_symbols
