	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function halbtc_set_bt_reg
_halbtc_set_bt_reg:                     ## @halbtc_set_bt_reg
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -96(%rbp)
	movl	%ecx, %edi
	callq	_cpu_to_le16
	movl	%eax, -48(%rbp)
	movq	_BT_OP_WRITE_REG_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$4, %ecx
	movl	$200, %r8d
	callq	_halbtc_send_bt_mp_operation
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	%r15, -80(%rbp)
	movq	%r14, -72(%rbp)
	movq	_BT_OP_WRITE_REG_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-96(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$4, %ecx
	movl	$200, %r8d
	callq	_halbtc_send_bt_mp_operation
LBB0_2:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BT_OP_WRITE_REG_VALUE,4,2      ## @BT_OP_WRITE_REG_VALUE
	.comm	_BT_OP_WRITE_REG_ADDR,4,2       ## @BT_OP_WRITE_REG_ADDR
	.no_dead_strip	_halbtc_set_bt_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function halbtc_set_bt_reg
_halbtc_set_bt_reg:                     ; @halbtc_set_bt_reg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp, #32]
	stp	xzr, xzr, [sp]
	mov	x0, x3
	bl	_cpu_to_le16
	str	w0, [sp, #48]
Lloh3:
	adrp	x8, _BT_OP_WRITE_REG_VALUE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BT_OP_WRITE_REG_VALUE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #32
	mov	x0, x19
	mov	w3, #4
	mov	w4, #200
	bl	_halbtc_send_bt_mp_operation
	cbz	w0, LBB0_2
; %bb.1:
	stp	x21, x20, [sp, #16]
Lloh6:
	adrp	x8, _BT_OP_WRITE_REG_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BT_OP_WRITE_REG_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #4
	mov	w4, #200
	bl	_halbtc_send_bt_mp_operation
LBB0_2:
	ldur	x8, [x29, #-40]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BT_OP_WRITE_REG_VALUE,4,2      ; @BT_OP_WRITE_REG_VALUE
	.comm	_BT_OP_WRITE_REG_ADDR,4,2       ; @BT_OP_WRITE_REG_ADDR
	.no_dead_strip	_halbtc_set_bt_reg
.subsections_via_symbols
