	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function input_autoconfigure_joypad_add
_input_autoconfigure_joypad_add:        ## @input_autoconfigure_joypad_add
	.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	$408, %rsp                      ## imm = 0x198
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_input_autoconfigured@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rsi), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_1
## %bb.2:
	movq	8(%r15), %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	sete	%al
	movl	%eax, -436(%rbp)                ## 4-byte Spill
	jmp	LBB0_3
LBB0_1:
	movl	$0, -436(%rbp)                  ## 4-byte Folded Spill
LBB0_3:
	movb	$0, -432(%rbp)
	movb	$0, -304(%rbp)
	movb	$0, -176(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-304(%rbp), %rdx
	movq	%r14, %rdi
	movl	$128, %ecx
	callq	_config_get_array
	leaq	L_.str.1(%rip), %rsi
	leaq	-432(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	movl	$128, %ecx
	callq	_config_get_array
	movq	(%r12), %rax
	movq	(%r15), %rcx
	movl	$1, (%rax,%rcx,4)
	movq	_input_autoconf_binds@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rcx,4), %esi
	movq	%r14, %rdi
	callq	_input_autoconfigure_joypad_conf
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_string_is_equal
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	leaq	-304(%rbp), %r12
	movq	%r12, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	movq	8(%r15), %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	leaq	L_.str.3(%rip), %rsi
	cmoveq	%r12, %rsi
	jmp	LBB0_8
LBB0_12:
	movq	%r13, %rbx
	movl	$0, -440(%rbp)
	leaq	-304(%rbp), %r12
	movq	%r12, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	8(%r15), %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	je	LBB0_14
LBB0_15:
	movq	%r12, %rdi
	callq	_string_is_empty
	testq	%rax, %rax
	leaq	L_.str.3(%rip), %r13
	cmoveq	%r12, %r13
	jmp	LBB0_16
LBB0_6:
	movq	8(%r15), %rsi
LBB0_8:
	leaq	-176(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$128, %edx
	callq	_strlcpy
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	$128, %edx
	callq	_strlcat
	cmpb	$0, _input_autoconfigure_joypad_add.remote_is_bound(%rip)
	jne	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	callq	_task_free_title
	leaq	-176(%rbp), %rdi
	callq	_strdup
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_task_set_title
LBB0_10:
	movb	$1, _input_autoconfigure_joypad_add.remote_is_bound(%rip)
	cmpq	$0, (%r15)
	jne	LBB0_22
## %bb.11:
	movq	_input_autoconfigure_swap_override@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	jmp	LBB0_22
LBB0_14:
	movq	8(%r15), %r13
LBB0_16:
	movq	_MSG_DEVICE_CONFIGURED_IN_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	(%r15), %r9
	leaq	L_.str.5(%rip), %rdx
	leaq	-176(%rbp), %rdi
	movl	$128, %esi
	movq	%r13, %rcx
	movq	%rax, %r8
	callq	_snprintf
	cmpq	$0, (%r15)
	je	LBB0_17
## %bb.20:
	cmpb	$0, -436(%rbp)                  ## 1-byte Folded Reload
	jne	LBB0_22
LBB0_21:
	movq	%rbx, %rdi
	callq	_task_free_title
	leaq	-176(%rbp), %rdi
	callq	_strdup
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_task_set_title
LBB0_22:
	leaq	-304(%rbp), %rdi
	callq	_string_is_empty
	movl	(%r15), %edi
	testq	%rax, %rax
	je	LBB0_23
## %bb.24:
	movq	8(%r15), %rsi
	jmp	LBB0_25
LBB0_23:
	leaq	-304(%rbp), %rsi
LBB0_25:
	callq	_input_config_set_device_display_name
	movq	(%r14), %rdi
	callq	_string_is_empty
	movl	(%r15), %ebx
	testq	%rax, %rax
	je	LBB0_26
## %bb.27:
	leaq	L_.str.3(%rip), %r14
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_input_config_set_device_config_name
	movl	(%r15), %edi
	movq	%r14, %rsi
	jmp	LBB0_28
LBB0_26:
	movq	(%r14), %rdi
	callq	_path_basename
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_input_config_set_device_config_name
	movl	(%r15), %edi
	movq	(%r14), %rsi
LBB0_28:
	callq	_input_config_set_device_config_path
	xorl	%eax, %eax
	callq	_input_autoconfigure_joypad_reindex_devices
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.29:
	addq	$408, %rsp                      ## imm = 0x198
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	leaq	L_.str.6(%rip), %rsi
	leaq	-440(%rbp), %rdx
	movq	%r14, %rdi
	callq	_config_get_bool
	xorl	%ecx, %ecx
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movl	-440(%rbp), %ecx
LBB0_19:
	movq	_input_autoconfigure_swap_override@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	cmpb	$0, -436(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_21
	jmp	LBB0_22
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_input_autoconfigured,8,3       ## @input_autoconfigured
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"input_device_display_name"

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

	.comm	_input_autoconf_binds,8,3       ## @input_autoconf_binds
L_.str.2:                               ## @.str.2
	.asciz	"remote"

.zerofill __DATA,__bss,_input_autoconfigure_joypad_add.remote_is_bound,1,2 ## @input_autoconfigure_joypad_add.remote_is_bound
L_.str.3:                               ## @.str.3
	.asciz	"N/A"

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

	.comm	_input_autoconfigure_swap_override,4,2 ## @input_autoconfigure_swap_override
L_.str.5:                               ## @.str.5
	.asciz	"%s %s #%u."

	.comm	_MSG_DEVICE_CONFIGURED_IN_PORT,4,2 ## @MSG_DEVICE_CONFIGURED_IN_PORT
L_.str.6:                               ## @.str.6
	.asciz	"input_swap_override"

	.no_dead_strip	_input_autoconfigure_joypad_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function input_autoconfigure_joypad_add
_input_autoconfigure_joypad_add:        ; @input_autoconfigure_joypad_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #464
	.cfi_def_cfa_offset 464
	stp	x24, x23, [sp, #400]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #416]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #432]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #448]            ; 16-byte Folded Spill
	add	x29, sp, #448
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x22, _input_autoconfigured@GOTPAGE
Lloh4:
	ldr	x22, [x22, _input_autoconfigured@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x1]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
	bl	_string_is_empty
	cmp	x0, #0
	cset	w23, eq
	b	LBB0_3
LBB0_2:
	mov	w23, #0
LBB0_3:
	strb	wzr, [sp, #8]
	strb	wzr, [sp, #136]
	sturb	wzr, [x29, #-184]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #136
	mov	x0, x20
	mov	w3, #128
	bl	_config_get_array
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	x0, x20
	mov	w3, #128
	bl	_config_get_array
	ldr	x8, [x22]
	ldr	x9, [x19]
	lsl	x9, x9, #2
	mov	w10, #1
	str	w10, [x8, x9]
Lloh9:
	adrp	x8, _input_autoconf_binds@GOTPAGE
Lloh10:
	ldr	x8, [x8, _input_autoconf_binds@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	w1, [x8, x9]
	mov	x0, x20
	bl	_input_autoconfigure_joypad_conf
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #8
	bl	_string_is_equal
	cbz	x0, LBB0_7
; %bb.4:
	add	x22, sp, #136
	add	x0, sp, #136
	bl	_string_is_empty
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x0, [x19, #8]
	bl	_string_is_empty
	cbz	x0, LBB0_10
LBB0_6:
	add	x0, sp, #136
	bl	_string_is_empty
Lloh14:
	adrp	x8, l_.str.3@PAGE
Lloh15:
	add	x8, x8, l_.str.3@PAGEOFF
	cmp	x0, #0
	csel	x1, x22, x8, eq
	b	LBB0_11
LBB0_7:
	str	wzr, [sp, #4]
	add	x22, sp, #136
	add	x0, sp, #136
	bl	_string_is_empty
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x0, [x19, #8]
	bl	_string_is_empty
	cbz	x0, LBB0_15
LBB0_9:
	add	x0, sp, #136
	bl	_string_is_empty
Lloh16:
	adrp	x8, l_.str.3@PAGE
Lloh17:
	add	x8, x8, l_.str.3@PAGEOFF
	cmp	x0, #0
	csel	x22, x22, x8, eq
	b	LBB0_16
LBB0_10:
	ldr	x1, [x19, #8]
LBB0_11:
	sub	x0, x29, #184
	mov	w2, #128
	bl	_strlcpy
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	sub	x0, x29, #184
	mov	w2, #128
	bl	_strlcat
	adrp	x22, _input_autoconfigure_joypad_add.remote_is_bound@PAGE
	ldrb	w8, [x22, _input_autoconfigure_joypad_add.remote_is_bound@PAGEOFF]
	tbnz	w8, #0, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_task_free_title
	sub	x0, x29, #184
	bl	_strdup
	mov	x1, x0
	mov	x0, x21
	bl	_task_set_title
LBB0_13:
	mov	w8, #1
	strb	w8, [x22, _input_autoconfigure_joypad_add.remote_is_bound@PAGEOFF]
	ldr	x9, [x19]
	cbnz	x9, LBB0_19
; %bb.14:
Lloh20:
	adrp	x9, _input_autoconfigure_swap_override@GOTPAGE
Lloh21:
	ldr	x9, [x9, _input_autoconfigure_swap_override@GOTPAGEOFF]
Lloh22:
	str	w8, [x9]
	b	LBB0_19
LBB0_15:
	ldr	x22, [x19, #8]
LBB0_16:
Lloh23:
	adrp	x8, _MSG_DEVICE_CONFIGURED_IN_PORT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSG_DEVICE_CONFIGURED_IN_PORT@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x4, x0
	ldr	x5, [x19]
Lloh26:
	adrp	x2, l_.str.5@PAGE
Lloh27:
	add	x2, x2, l_.str.5@PAGEOFF
	sub	x0, x29, #184
	mov	w1, #128
	mov	x3, x22
	bl	_snprintf
	ldr	x8, [x19]
	cbz	x8, LBB0_27
; %bb.17:
	tbnz	w23, #0, LBB0_19
LBB0_18:
	mov	x0, x21
	bl	_task_free_title
	sub	x0, x29, #184
	bl	_strdup
	mov	x1, x0
	mov	x0, x21
	bl	_task_set_title
LBB0_19:
	add	x0, sp, #136
	bl	_string_is_empty
	mov	x8, x0
	ldr	w0, [x19]
	cbz	x8, LBB0_21
; %bb.20:
	ldr	x1, [x19, #8]
	b	LBB0_22
LBB0_21:
	add	x1, sp, #136
LBB0_22:
	bl	_input_config_set_device_display_name
	ldr	x0, [x20]
	bl	_string_is_empty
	ldr	w21, [x19]
	cbz	x0, LBB0_24
; %bb.23:
Lloh28:
	adrp	x20, l_.str.3@PAGE
Lloh29:
	add	x20, x20, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	x1, x20
	bl	_input_config_set_device_config_name
	ldr	w0, [x19]
	mov	x1, x20
	b	LBB0_25
LBB0_24:
	ldr	x0, [x20]
	bl	_path_basename
	mov	x1, x0
	mov	x0, x21
	bl	_input_config_set_device_config_name
	ldr	w0, [x19]
	ldr	x1, [x20]
LBB0_25:
	bl	_input_config_set_device_config_path
	bl	_input_autoconfigure_joypad_reindex_devices
	ldur	x8, [x29, #-56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_28
; %bb.26:
	ldp	x29, x30, [sp, #448]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #432]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #416]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #400]            ; 16-byte Folded Reload
	add	sp, sp, #464
	ret
LBB0_27:
Lloh33:
	adrp	x1, l_.str.6@PAGE
Lloh34:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x2, sp, #4
	mov	x0, x20
	bl	_config_get_bool
	ldr	w8, [sp, #4]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
Lloh35:
	adrp	x9, _input_autoconfigure_swap_override@GOTPAGE
Lloh36:
	ldr	x9, [x9, _input_autoconfigure_swap_override@GOTPAGEOFF]
Lloh37:
	str	w8, [x9]
	tbz	w23, #0, LBB0_18
	b	LBB0_19
LBB0_28:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_input_autoconfigured,8,3       ; @input_autoconfigured
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"input_device_display_name"

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

	.comm	_input_autoconf_binds,8,3       ; @input_autoconf_binds
l_.str.2:                               ; @.str.2
	.asciz	"remote"

.zerofill __DATA,__bss,_input_autoconfigure_joypad_add.remote_is_bound,1,2 ; @input_autoconfigure_joypad_add.remote_is_bound
l_.str.3:                               ; @.str.3
	.asciz	"N/A"

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

	.comm	_input_autoconfigure_swap_override,4,2 ; @input_autoconfigure_swap_override
l_.str.5:                               ; @.str.5
	.asciz	"%s %s #%u."

	.comm	_MSG_DEVICE_CONFIGURED_IN_PORT,4,2 ; @MSG_DEVICE_CONFIGURED_IN_PORT
l_.str.6:                               ; @.str.6
	.asciz	"input_swap_override"

	.no_dead_strip	_input_autoconfigure_joypad_add
.subsections_via_symbols
