	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiu_attach_callback
_wiiu_attach_callback:                  ## @wiiu_attach_callback
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	movq	%rbx, %rdi
	callq	_log_device
	testq	%rbx, %rbx
	jne	LBB0_4
	jmp	LBB0_6
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_LOG
	testq	%rbx, %rbx
	je	LBB0_6
LBB0_4:
	movq	%rbx, %rdi
	callq	_new_attach_event
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r14, (%rax)
	movq	%rax, %rdi
	callq	_synchronized_add_event
	movq	_DEVICE_USED@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	xorl	%edi, %edi
	callq	_delete_attach_event
	movq	_DEVICE_UNUSED@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[hid]: Device attach event generated.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[hid]: Device detach event generated.\n"

	.comm	_DEVICE_USED,4,2                ## @DEVICE_USED
	.comm	_DEVICE_UNUSED,4,2              ## @DEVICE_UNUSED
	.no_dead_strip	_wiiu_attach_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiu_attach_callback
_wiiu_attach_callback:                  ; @wiiu_attach_callback
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x20, x1
	cbz	x2, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	mov	x0, x20
	bl	_log_device
	cbnz	x20, LBB0_3
	b	LBB0_5
LBB0_2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_LOG
	cbz	x20, LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_new_attach_event
	cbz	x0, LBB0_5
; %bb.4:
	str	x19, [x0]
	bl	_synchronized_add_event
Lloh4:
	adrp	x8, _DEVICE_USED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DEVICE_USED@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	mov	x0, #0
	bl	_delete_attach_event
Lloh6:
	adrp	x8, _DEVICE_UNUSED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEVICE_UNUSED@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[hid]: Device attach event generated.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[hid]: Device detach event generated.\n"

	.comm	_DEVICE_USED,4,2                ; @DEVICE_USED
	.comm	_DEVICE_UNUSED,4,2              ; @DEVICE_UNUSED
	.no_dead_strip	_wiiu_attach_callback
.subsections_via_symbols
