	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiu_hid_polling_thread_cleanup
_wiiu_hid_polling_thread_cleanup:       ## @wiiu_hid_polling_thread_cleanup
	.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
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	xorl	%r12d, %r12d
	movq	_adapters@GOTPCREL(%rip), %rbx
	leaq	L_.str.2(%rip), %r15
	movq	_ADAPTER_STATE_READING@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	xorl	%esi, %esi
	cmpq	%rcx, (%rdx)
	movq	8(%rdx), %rdi
	sete	%sil
	addl	%esi, %eax
	movq	%rdi, %rdx
	testq	%rdi, %rdi
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	je	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$5000, %edi                     ## imm = 0x1388
	callq	_usleep
	xorl	%r14d, %r14d
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$999, %r12d                     ## imm = 0x3E7
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	incl	%r12d
	testb	%r14b, %r14b
	je	LBB0_1
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_LOG
	movb	$1, %r14b
	cmpq	$0, (%rbx)
	je	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	callq	_RARCH_LOG
	movq	(%rbx), %rdi
	movq	8(%rdi), %rax
	movq	%rax, (%rbx)
	callq	_delete_adapter
	cmpq	$0, (%rbx)
	jne	LBB0_7
	jmp	LBB0_9
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RARCH_WARN                     ## TAILCALL
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Waiting for in-flight reads to finish.\n"

	.comm	_adapters,8,3                   ## @adapters
	.comm	_ADAPTER_STATE_READING,8,3      ## @ADAPTER_STATE_READING
L_.str.1:                               ## @.str.1
	.asciz	"All in-flight reads complete.\n"

L_.str.2:                               ## @.str.2
	.asciz	"[hid]: shutting down adapter..\n"

L_.str.3:                               ## @.str.3
	.asciz	"[hid]: timed out waiting for in-flight read to finish.\n"

	.no_dead_strip	_wiiu_hid_polling_thread_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiu_hid_polling_thread_cleanup
_wiiu_hid_polling_thread_cleanup:       ; @wiiu_hid_polling_thread_cleanup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	mov	w21, #0
Lloh2:
	adrp	x22, _adapters@GOTPAGE
Lloh3:
	ldr	x22, [x22, _adapters@GOTPAGEOFF]
Lloh4:
	adrp	x19, l_.str.1@PAGE
Lloh5:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh6:
	adrp	x23, _ADAPTER_STATE_READING@GOTPAGE
Lloh7:
	ldr	x23, [x23, _ADAPTER_STATE_READING@GOTPAGEOFF]
Lloh8:
	adrp	x20, l_.str.2@PAGE
Lloh9:
	add	x20, x20, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #5000
	bl	_usleep
	mov	w8, #0
	cmp	w21, #999
	b.eq	LBB0_10
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w21, w21, #1
	cbnz	w8, LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w9, #0
	ldr	x10, [x23]
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x11, x8, [x8]
	cmp	x11, x10
	cinc	w9, w9, eq
	cbnz	x8, LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w9, LBB0_1
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_RARCH_LOG
	ldr	x8, [x22]
	cbz	x8, LBB0_9
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	bl	_RARCH_LOG
	ldr	x0, [x22]
	ldr	x8, [x0, #8]
	str	x8, [x22]
	bl	_delete_adapter
	ldr	x8, [x22]
	cbnz	x8, LBB0_8
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #1
	cmp	w21, #999
	b.ne	LBB0_2
LBB0_10:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_RARCH_WARN
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Waiting for in-flight reads to finish.\n"

	.comm	_adapters,8,3                   ; @adapters
	.comm	_ADAPTER_STATE_READING,8,3      ; @ADAPTER_STATE_READING
l_.str.1:                               ; @.str.1
	.asciz	"All in-flight reads complete.\n"

l_.str.2:                               ; @.str.2
	.asciz	"[hid]: shutting down adapter..\n"

l_.str.3:                               ; @.str.3
	.asciz	"[hid]: timed out waiting for in-flight read to finish.\n"

	.no_dead_strip	_wiiu_hid_polling_thread_cleanup
.subsections_via_symbols
