	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function start_polling_thread
_start_polling_thread:                  ## @start_polling_thread
	.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	%rdi, %r15
	movq	_OS_THREAD_ATTRIB_AFFINITY_CPU2@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	xorl	%eax, %eax
	callq	_new_thread
	movq	%rax, %rbx
	movl	$16, %edi
	movl	$32768, %esi                    ## imm = 0x8000
	callq	_alloc_zeroed
	movq	%rax, %r14
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	leaq	L_.str.1(%rip), %rdi
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movq	_wiiu_hid_polling_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	32768(%r14), %r8
	movq	%rbx, %rdi
	movl	$1, %edx
	movq	%r15, %rcx
	movl	$32768, %r9d                    ## imm = 0x8000
	pushq	%r12
	pushq	$10
	callq	_OSCreateThread
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_3
## %bb.8:
	movq	_wiiu_hid_polling_thread_cleanup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_OSSetThreadCleanupCallback
	movq	%rbx, 8(%r15)
	movq	%r14, (%r15)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_OSResumeThread                 ## TAILCALL
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
LBB0_4:
	callq	_RARCH_LOG
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_free
LBB0_6:
	testq	%r14, %r14
	je	LBB0_7
## %bb.9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free                           ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OS_THREAD_ATTRIB_AFFINITY_CPU2,4,2 ## @OS_THREAD_ATTRIB_AFFINITY_CPU2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[hid]: starting polling thread.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[hid]: allocation failed, aborting thread start.\n"

	.comm	_wiiu_hid_polling_thread,4,2    ## @wiiu_hid_polling_thread
L_.str.2:                               ## @.str.2
	.asciz	"[hid]: OSCreateThread failed.\n"

	.comm	_wiiu_hid_polling_thread_cleanup,4,2 ## @wiiu_hid_polling_thread_cleanup
	.no_dead_strip	_start_polling_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function start_polling_thread
_start_polling_thread:                  ; @start_polling_thread
	.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
	mov	x21, x0
Lloh0:
	adrp	x8, _OS_THREAD_ATTRIB_AFFINITY_CPU2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OS_THREAD_ATTRIB_AFFINITY_CPU2@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_new_thread
	mov	x19, x0
	mov	w0, #16
	mov	w1, #32768
	bl	_alloc_zeroed
	mov	x20, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	cbz	x19, LBB0_5
; %bb.1:
	cbz	x20, LBB0_5
; %bb.2:
Lloh7:
	adrp	x8, _wiiu_hid_polling_thread@GOTPAGE
Lloh8:
	ldr	x8, [x8, _wiiu_hid_polling_thread@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x4, x20, #8, lsl #12            ; =32768
	mov	x0, x19
	mov	w2, #1
	mov	x3, x21
	mov	w5, #32768
	mov	w6, #10
	mov	x7, x22
	bl	_OSCreateThread
	cbz	w0, LBB0_4
; %bb.3:
Lloh10:
	adrp	x8, _wiiu_hid_polling_thread_cleanup@GOTPAGE
Lloh11:
	ldr	x8, [x8, _wiiu_hid_polling_thread_cleanup@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_OSSetThreadCleanupCallback
	stp	x20, x19, [x21]
	mov	x0, x19
	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	_OSResumeThread
LBB0_4:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_5:
	bl	_RARCH_LOG
	cbz	x19, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_free
LBB0_7:
	cbz	x20, LBB0_9
; %bb.8:
	mov	x0, x20
	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	_free
LBB0_9:
	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
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_OS_THREAD_ATTRIB_AFFINITY_CPU2,4,2 ; @OS_THREAD_ATTRIB_AFFINITY_CPU2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[hid]: starting polling thread.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[hid]: allocation failed, aborting thread start.\n"

	.comm	_wiiu_hid_polling_thread,4,2    ; @wiiu_hid_polling_thread
l_.str.2:                               ; @.str.2
	.asciz	"[hid]: OSCreateThread failed.\n"

	.comm	_wiiu_hid_polling_thread_cleanup,4,2 ; @wiiu_hid_polling_thread_cleanup
	.no_dead_strip	_start_polling_thread
.subsections_via_symbols
