	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiu_gca_update_pad_state
_wiiu_gca_update_pad_state:             ## @wiiu_gca_update_pad_state
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	movq	%rdi, %r14
	cmpl	$0, 16(%rdi)
	je	LBB0_11
## %bb.2:
	movl	$1, %r15d
	xorl	%ebx, %ebx
	movq	_GCA_PORT_POWERED@GOTPCREL(%rip), %r12
	leaq	L_.str.2(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, %rax
	je	LBB0_5
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rax), %rcx
	movl	(%rax), %edi
	addq	%r15, %rsi
	movl	$9, %edx
	callq	*(%rcx)
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	9(%r15), %rax
	incq	%rbx
	cmpq	$28, %r15
	movq	%rax, %r15
	jae	LBB0_11
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	movq	8(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movzbl	(%rsi,%r15), %ecx
	cmpb	(%r12), %cl
	ja	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%rbx), %esi
	movq	%r13, %rdi
	callq	_RARCH_LOG
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_wiiu_gca_unregister_pad
	jmp	LBB0_10
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	movq	%r14, %rdi
	movq	_wiiu_gca_pad_connection@GOTPCREL(%rip), %rsi
	callq	_hid_pad_register
	movq	8(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	8(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rsi
	jmp	LBB0_7
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_ERR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GCA_PORT_POWERED,1,0           ## @GCA_PORT_POWERED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[gca]: Gamepad at port %d connected.\n"

	.comm	_wiiu_gca_pad_connection,4,2    ## @wiiu_gca_pad_connection
L_.str.1:                               ## @.str.1
	.asciz	"[gca]: Failed to register pad.\n"

L_.str.2:                               ## @.str.2
	.asciz	"[gca]: Gamepad at port %d disconnected.\n"

	.no_dead_strip	_wiiu_gca_update_pad_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiu_gca_update_pad_state
_wiiu_gca_update_pad_state:             ; @wiiu_gca_update_pad_state
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x0, LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_11
; %bb.2:
	mov	w24, #1
	mov	w25, #57
Lloh0:
	adrp	x26, _GCA_PORT_POWERED@GOTPAGE
Lloh1:
	ldr	x26, [x26, _GCA_PORT_POWERED@GOTPAGEOFF]
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
Lloh4:
	adrp	x21, _wiiu_gca_pad_connection@GOTPAGE
Lloh5:
	ldr	x21, [x21, _wiiu_gca_pad_connection@GOTPAGEOFF]
Lloh6:
	adrp	x22, l_.str.2@PAGE
Lloh7:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	cbz	x8, LBB0_9
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x10, [x8, #8]
	ldr	x10, [x10]
	ldr	w0, [x8]
	add	x1, x9, x24
	mov	w2, #9
	blr	x10
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x8, x24, #9
	cmp	x24, #28
	mov	x24, x8
	b.hs	LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	and	w8, w24, #0xff
	mul	w8, w8, w25
	lsr	w23, w8, #9
	ldp	x9, x8, [x19]
	ldr	x8, [x8, w23, uxtw #3]
	ldrb	w10, [x9, x24]
	ldrb	w11, [x26]
	cmp	w10, w11
	b.hi	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cbz	x8, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w1, w23, #1
	mov	x0, x22
	bl	_RARCH_LOG
	mov	x0, x19
	mov	x1, x23
	bl	_wiiu_gca_unregister_pad
	b	LBB0_5
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w1, w23, #1
	mov	x0, x20
	bl	_RARCH_LOG
	mov	x0, x19
	mov	x1, x21
	bl	_hid_pad_register
	ldr	x8, [x19, #8]
	lsl	x9, x23, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [x19]
	b	LBB0_4
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_RARCH_ERR
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GCA_PORT_POWERED,1,0           ; @GCA_PORT_POWERED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[gca]: Gamepad at port %d connected.\n"

	.comm	_wiiu_gca_pad_connection,4,2    ; @wiiu_gca_pad_connection
l_.str.1:                               ; @.str.1
	.asciz	"[gca]: Failed to register pad.\n"

l_.str.2:                               ; @.str.2
	.asciz	"[gca]: Gamepad at port %d disconnected.\n"

	.no_dead_strip	_wiiu_gca_update_pad_state
.subsections_via_symbols
