	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function compass_heading_data_show
_compass_heading_data_show:             ## @compass_heading_data_show
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r15
	callq	_to_i2c_client
	movq	%rax, %r12
	movq	_compass_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	movl	$65, %esi
	callq	_compass_command
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.2:
	movl	$10, %edi
	callq	_msleep
	leaq	-34(%rbp), %rsi
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_i2c_master_recv
	movl	%eax, %ebx
	movq	_compass_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	js	LBB0_3
## %bb.4:
	movzwl	-34(%rbp), %eax
	rolw	$8, %ax
	movzwl	%ax, %ecx
	movl	$3435973837, %edx               ## imm = 0xCCCCCCCD
	imulq	%rcx, %rdx
	shrq	$35, %rdx
	leal	(%rdx,%rdx), %eax
	leal	(%rax,%rax,4), %eax
	subl	%eax, %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_sprintf
	movl	%eax, %ebx
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	movq	_compass_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_warn
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_compass_mutex,4,2              ## @compass_mutex
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c read data cmd failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"%d.%d\n"

	.no_dead_strip	_compass_heading_data_show
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function compass_heading_data_show
_compass_heading_data_show:             ; @compass_heading_data_show
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x0
	bl	_to_i2c_client
	mov	x22, x0
Lloh0:
	adrp	x0, _compass_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _compass_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x22
	mov	w1, #65
	bl	_compass_command
	cmp	w0, #1
	b.ne	LBB0_3
; %bb.1:
	mov	w23, #10
	mov	w0, #10
	bl	_msleep
	add	x1, sp, #14
	mov	x0, x22
	mov	w2, #2
	bl	_i2c_master_recv
	mov	x21, x0
Lloh2:
	adrp	x0, _compass_mutex@GOTPAGE
Lloh3:
	ldr	x0, [x0, _compass_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	tbnz	w21, #31, LBB0_4
; %bb.2:
	ldrh	w8, [sp, #14]
	rev16	w8, w8
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x9, w8, w9
	lsr	x2, x9, #35
	msub	w3, w2, w23, w8
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_sprintf
	mov	x21, x0
	b	LBB0_5
LBB0_3:
	mov	x21, x0
Lloh6:
	adrp	x0, _compass_mutex@GOTPAGE
Lloh7:
	ldr	x0, [x0, _compass_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_compass_mutex,4,2              ; @compass_mutex
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c read data cmd failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"%d.%d\n"

	.no_dead_strip	_compass_heading_data_show
.subsections_via_symbols
