	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btstack_thread_func
_btstack_thread_func:                   ## @btstack_thread_func
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	xorl	%eax, %eax
	callq	_bt_open_ptr
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -32(%rbp)
	movaps	%xmm0, -48(%rbp)
	movl	$0, -16(%rbp)
	movq	_btstack_thread_stop@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	leaq	-48(%rbp), %rdx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_CFRunLoopSourceCreate
	movq	_btstack_quit_source@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	callq	_CFRunLoopGetCurrent
	movl	(%rbx), %esi
	movq	_kCFRunLoopCommonModes@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_CFRunLoopAddSource
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_LOG
	movq	_btstack_set_power_mode_ptr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_HCI_POWER_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bt_send_cmd_ptr
	leaq	L_.str.2(%rip), %rdi
	callq	_RARCH_LOG
	xorl	%eax, %eax
	callq	_CFRunLoopRun
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_LOG
	movl	(%rbx), %edi
	callq	_CFRunLoopSourceInvalidate
	movl	(%rbx), %edi
	callq	_CFRelease
LBB0_2:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[BTstack]: Thread started"

	.comm	_btstack_thread_stop,4,2        ## @btstack_thread_stop
	.comm	_btstack_quit_source,4,2        ## @btstack_quit_source
	.comm	_kCFRunLoopCommonModes,4,2      ## @kCFRunLoopCommonModes
L_.str.1:                               ## @.str.1
	.asciz	"[BTstack]: Turning on...\n"

	.comm	_btstack_set_power_mode_ptr,4,2 ## @btstack_set_power_mode_ptr
	.comm	_HCI_POWER_ON,4,2               ## @HCI_POWER_ON
L_.str.2:                               ## @.str.2
	.asciz	"BTstack: Thread running...\n"

L_.str.3:                               ## @.str.3
	.asciz	"[BTstack]: Thread done.\n"

	.no_dead_strip	_btstack_thread_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btstack_thread_func
_btstack_thread_func:                   ; @btstack_thread_func
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	bl	_bt_open_ptr
	cbnz	x0, LBB0_2
; %bb.1:
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
Lloh2:
	adrp	x8, _btstack_thread_stop@GOTPAGE
Lloh3:
	ldr	x8, [x8, _btstack_thread_stop@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #32]
	mov	x2, sp
	mov	w1, #0
	bl	_CFRunLoopSourceCreate
Lloh5:
	adrp	x19, _btstack_quit_source@GOTPAGE
Lloh6:
	ldr	x19, [x19, _btstack_quit_source@GOTPAGEOFF]
	str	w0, [x19]
	bl	_CFRunLoopGetCurrent
	ldr	w1, [x19]
Lloh7:
	adrp	x8, _kCFRunLoopCommonModes@GOTPAGE
Lloh8:
	ldr	x8, [x8, _kCFRunLoopCommonModes@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	bl	_CFRunLoopAddSource
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_LOG
Lloh12:
	adrp	x8, _btstack_set_power_mode_ptr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _btstack_set_power_mode_ptr@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _HCI_POWER_ON@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HCI_POWER_ON@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_bt_send_cmd_ptr
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_LOG
	bl	_CFRunLoopRun
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_LOG
	ldr	w0, [x19]
	bl	_CFRunLoopSourceInvalidate
	ldr	w0, [x19]
	bl	_CFRelease
LBB0_2:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[BTstack]: Thread started"

	.comm	_btstack_thread_stop,4,2        ; @btstack_thread_stop
	.comm	_btstack_quit_source,4,2        ; @btstack_quit_source
	.comm	_kCFRunLoopCommonModes,4,2      ; @kCFRunLoopCommonModes
l_.str.1:                               ; @.str.1
	.asciz	"[BTstack]: Turning on...\n"

	.comm	_btstack_set_power_mode_ptr,4,2 ; @btstack_set_power_mode_ptr
	.comm	_HCI_POWER_ON,4,2               ; @HCI_POWER_ON
l_.str.2:                               ; @.str.2
	.asciz	"BTstack: Thread running...\n"

l_.str.3:                               ; @.str.3
	.asciz	"[BTstack]: Thread done.\n"

	.no_dead_strip	_btstack_thread_func
.subsections_via_symbols
