	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kpad_register
_kpad_register:                         ## @kpad_register
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_wiimotes@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	%edi, %r12d
	cmpq	%rsi, (%rax,%r12,8)
	jne	LBB0_1
## %bb.3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rsi, %r14
	movl	%edi, %ebx
	callq	_kpad_deregister
	movl	%ebx, %edi
	callq	_get_slot_for_channel
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:
	movq	(%r15), %rcx
	movq	%r14, (%rcx,%r12,8)
	movq	_kpad_driver@GOTPCREL(%rip), %rsi
	movl	%eax, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_pad_connect              ## TAILCALL
LBB0_4:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_ERR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_wiimotes,8,3                   ## @wiimotes
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't get a slot for this remote.\n"

	.comm	_kpad_driver,4,2                ## @kpad_driver
	.no_dead_strip	_kpad_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kpad_register
_kpad_register:                         ; @kpad_register
	.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
Lloh0:
	adrp	x21, _wiimotes@GOTPAGE
Lloh1:
	ldr	x21, [x21, _wiimotes@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8, w0, uxtw #3]
	cmp	x8, x1
	b.ne	LBB0_2
; %bb.1:
	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_2:
	mov	x19, x1
	mov	x20, x0
	bl	_kpad_deregister
	mov	x0, x20
	bl	_get_slot_for_channel
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	w8, w20
	ldr	x9, [x21]
	str	x19, [x9, x8, lsl #3]
Lloh2:
	adrp	x1, _kpad_driver@GOTPAGE
Lloh3:
	ldr	x1, [x1, _kpad_driver@GOTPAGEOFF]
	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
	b	_input_pad_connect
LBB0_4:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_RARCH_ERR
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_wiimotes,8,3                   ; @wiimotes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't get a slot for this remote.\n"

	.comm	_kpad_driver,4,2                ; @kpad_driver
	.no_dead_strip	_kpad_register
.subsections_via_symbols
