	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function srf08_write_range_mm
_srf08_write_range_mm:                  ## @srf08_write_range_mm
	.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
	imull	$799063683, %esi, %eax          ## imm = 0x2FA0BE83
	cmpl	$99882960, %eax                 ## imm = 0x5F417D0
	ja	LBB0_2
## %bb.1:
	movl	%esi, %r12d
	movl	%esi, %eax
	imulq	$799063683, %rax, %rbx          ## imm = 0x2FA0BE83
	shrq	$35, %rbx
	leal	-257(%rbx), %eax
	cmpl	$-257, %eax                     ## imm = 0xFEFF
	jbe	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	decl	%ebx
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_SRF08_WRITE_RANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	%r12d, (%r14)
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_dev_err
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SRF08_WRITE_RANGE,4,2          ## @SRF08_WRITE_RANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"write_range - err: %d\n"

	.no_dead_strip	_srf08_write_range_mm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function srf08_write_range_mm
_srf08_write_range_mm:                  ; @srf08_write_range_mm
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	w8, #48771
	movk	w8, #12192, lsl #16
	umull	x8, w1, w8
	lsr	x8, x8, #35
	mov	w9, #43
	msub	w9, w8, w9, w1
	cbnz	w9, LBB0_4
; %bb.1:
	sub	w9, w8, #257
	cmn	w9, #257
	b.ls	LBB0_4
; %bb.2:
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
	sub	w22, w8, #1
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
Lloh0:
	adrp	x8, _SRF08_WRITE_RANGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SRF08_WRITE_RANGE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x22
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_5
; %bb.3:
	str	w19, [x20]
	mov	x0, x21
	bl	_mutex_unlock
	mov	w22, #0
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_6
LBB0_5:
	mov	x22, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x22
	bl	_dev_err
	mov	x0, x21
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SRF08_WRITE_RANGE,4,2          ; @SRF08_WRITE_RANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"write_range - err: %d\n"

	.no_dead_strip	_srf08_write_range_mm
.subsections_via_symbols
