	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lv0104cs_set_calibscale
_lv0104cs_set_calibscale:               ## @lv0104cs_set_calibscale
	.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, %r14
	imull	$1000000, %esi, %r13d           ## imm = 0xF4240
	addl	%edx, %r13d
	movq	_lv0104cs_calibscales@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movl	$16, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	callq	_ARRAY_SIZE
	decl	%eax
	cltq
	cmpq	%rax, %r15
	jge	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rdi
	imull	$1000000, -16(%rdi,%rbx), %edx  ## imm = 0xF4240
	addl	-12(%rdi,%rbx), %edx
	imull	$1000000, -4(%rdi,%rbx), %eax   ## imm = 0xF4240
	addl	(%rdi,%rbx), %eax
	leal	(%rax,%rdx), %esi
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	sarl	%ecx
	cmpl	%edx, %r13d
	jl	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%ecx, %r13d
	jl	LBB0_14
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	addq	$12, %rbx
	incq	%r15
	cmpl	%ecx, %r13d
	jl	LBB0_1
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%eax, %r13d
	jg	LBB0_1
## %bb.7:
	movl	%r15d, %r13d
	leal	-1(%r13), %r15d
	jmp	LBB0_8
LBB0_2:
	movq	(%r12), %rdi
                                        ## implicit-def: $r13d
	jmp	LBB0_8
LBB0_14:
	movl	%r15d, %r13d
LBB0_8:
	callq	_ARRAY_SIZE
	decl	%eax
	cmpl	%r15d, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_10:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	8(%r14), %edi
	movq	(%r12), %rax
	movslq	%r13d, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	8(%rax,%rcx,4), %esi
	callq	_lv0104cs_write_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movl	%r13d, (%r14)
LBB0_12:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_lv0104cs_calibscales,8,3       ## @lv0104cs_calibscales
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_lv0104cs_set_calibscale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lv0104cs_set_calibscale
_lv0104cs_set_calibscale:               ; @lv0104cs_set_calibscale
	.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	x19, x0
	mov	x22, #0
	mov	x20, #0
	mov	w23, #16960
	movk	w23, #15, lsl #16
	madd	w24, w1, w23, w2
Lloh0:
	adrp	x21, _lv0104cs_calibscales@GOTPAGE
Lloh1:
	ldr	x21, [x21, _lv0104cs_calibscales@GOTPAGEOFF]
	ldr	x0, [x21]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_ARRAY_SIZE
	sub	w8, w0, #1
	cmp	x20, w8, sxtw
	b.ge	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x21]
	add	x8, x0, x22
	ldp	w9, w10, [x8]
	madd	w10, w9, w23, w10
	ldp	w9, w8, [x8, #12]
	madd	w8, w9, w23, w8
	add	w9, w8, w10
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w9, w9, #1
	cmp	w24, w10
	ccmp	w24, w9, #0, ge
	b.lt	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x22, x22, #12
	add	x20, x20, #1
	cmp	w24, w9
	ccmp	w24, w8, #0, ge
	b.gt	LBB0_1
; %bb.4:
	mov	x22, x20
	sub	w20, w20, #1
	b	LBB0_7
LBB0_5:
	ldr	x0, [x21]
                                        ; implicit-def: $w22
	b	LBB0_7
LBB0_6:
	mov	x22, x20
LBB0_7:
	bl	_ARRAY_SIZE
	sub	w8, w0, #1
	cmp	w8, w20
	b.ne	LBB0_9
; %bb.8:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_9:
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w0, [x19, #8]
	ldr	x8, [x21]
	mov	w9, #12
	smaddl	x8, w22, w9, x8
	ldr	w1, [x8, #8]
	bl	_lv0104cs_write_reg
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.10:
	str	w22, [x19]
LBB0_11:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_12:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_lv0104cs_calibscales,8,3       ; @lv0104cs_calibscales
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_lv0104cs_set_calibscale
.subsections_via_symbols
