	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setting_action_right_libretro_device_type
_setting_action_right_libretro_device_type: ## @setting_action_right_libretro_device_type
	.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	%r12
	pushq	%rbx
	subq	$544, %rsp                      ## imm = 0x220
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movl	(%rdi), %r15d
	leaq	-560(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_libretro_device_get_size
	movl	%eax, %r14d
	movl	%r15d, %edi
	callq	_input_config_get_device
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%r14d, %r14d
	je	LBB0_7
## %bb.3:
	movl	%r14d, %esi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-560(%rbp,%rdx,4), %ecx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdx
	cmpq	%rdx, %rsi
	jne	LBB0_4
	jmp	LBB0_7
LBB0_1:
	movl	$-1, %r12d
	jmp	LBB0_8
LBB0_6:
	incl	%edx
	movl	%edx, %eax
LBB0_7:
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $edx killed $edx def $rdx
	movl	-560(%rbp,%rdx,4), %ebx
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_input_config_set_device
	movl	%r15d, -568(%rbp)
	movl	%ebx, -564(%rbp)
	leaq	-568(%rbp), %rdi
	callq	_core_set_controller_port_device
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r12d, %eax
	addq	$544, %rsp                      ## imm = 0x220
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_setting_action_right_libretro_device_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setting_action_right_libretro_device_type
_setting_action_right_libretro_device_type: ; @setting_action_right_libretro_device_type
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #528
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	cbz	x0, LBB0_6
; %bb.1:
	ldr	w19, [x0]
	add	x21, sp, #8
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	mov	x1, x0
	add	x0, sp, #8
	mov	x2, x19
	bl	_libretro_device_get_size
	mov	x20, x0
	mov	x0, x19
	bl	_input_config_get_device
	cbz	w20, LBB0_5
; %bb.2:
	mov	x8, #0
	mov	w9, w20
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x21, x8, lsl #2]
	cmp	w0, w10
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	cmp	x9, x8
	b.ne	LBB0_3
LBB0_5:
	mov	w8, #1
	b	LBB0_8
LBB0_6:
	mov	w0, #-1
	b	LBB0_9
LBB0_7:
	add	w8, w8, #1
LBB0_8:
	udiv	w9, w8, w20
	msub	w8, w9, w20, w8
	ldr	w20, [x21, w8, uxtw #2]
	mov	x0, x19
	mov	x1, x20
	bl	_input_config_set_device
	stp	w19, w20, [sp]
	mov	x0, sp
	bl	_core_set_controller_port_device
	mov	w0, #0
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	add	sp, sp, #528
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_setting_action_right_libretro_device_type
.subsections_via_symbols
