	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mb1232_read_distance
_mb1232_read_distance:                  ## @mb1232_read_distance
	.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
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	12(%rbx), %r12
	movq	%r12, %rdi
	callq	_reinit_completion
	movq	_MB1232_RANGE_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	cmpq	$0, (%rbx)
	js	LBB0_8
## %bb.4:
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$34, %rsi
	addl	%eax, %esi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wait_for_completion_killable_timeout
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	jne	LBB0_9
## %bb.7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_1:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_8:
	movl	$15, %edi
	callq	_msleep
LBB0_9:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_i2c_master_recv
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	-44(%rbp), %edi
	callq	___be16_to_cpu
	movl	%eax, %r13d
	testl	%eax, %eax
	jns	LBB0_14
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_5:
	movl	%eax, %r13d
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_dev_err
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MB1232_RANGE_COMMAND,4,2       ## @MB1232_RANGE_COMMAND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write command - err: %d\n"

	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"i2c_master_recv: ret=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"distance=%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mb1232_read_distance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mb1232_read_distance
_mb1232_read_distance:                  ; @mb1232_read_distance
	.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	x23, x0
	ldr	x20, [x0, #16]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	add	x22, x23, #12
	mov	x0, x22
	bl	_reinit_completion
Lloh0:
	adrp	x8, _MB1232_RANGE_COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MB1232_RANGE_COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_write_byte
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	x8, [x23]
	tbnz	x8, #63, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _HZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w1, w8, w9
	mov	x0, x22
	bl	_wait_for_completion_killable_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.3:
	cbnz	w21, LBB0_7
; %bb.4:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_10
LBB0_5:
	mov	x21, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_12
LBB0_6:
	mov	w0, #15
	bl	_msleep
LBB0_7:
	add	x1, sp, #12
	mov	x0, x20
	mov	w2, #4
	bl	_i2c_master_recv
	tbnz	w0, #31, LBB0_11
; %bb.8:
	ldr	w0, [sp, #12]
	bl	___be16_to_cpu
	mov	x21, x0
	tbz	w0, #31, LBB0_13
; %bb.9:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_11:
	mov	x21, x0
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_12:
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MB1232_RANGE_COMMAND,4,2       ; @MB1232_RANGE_COMMAND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write command - err: %d\n"

	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"i2c_master_recv: ret=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"distance=%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mb1232_read_distance
.subsections_via_symbols
