	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ina3221_write_curr
_ina3221_write_curr:                    ## @ina3221_write_curr
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %ebx
	movq	%rsi, %r14
	callq	_dev_get_drvdata
	movq	%rax, %r12
	movq	8(%rax), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %ebx
	movq	_ina3221_curr_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %rax
	movl	(%rax,%rcx,4), %r14d
	movq	_INT_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ebx
	movl	%eax, %esi
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ebx
	movl	%r15d, %edi
	movl	%eax, %edx
	callq	_clamp_val
	imull	%eax, %ebx
	movl	%ebx, %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %edi
	movl	$-163800, %esi                  ## imm = 0xFFFD8028
	movl	$163800, %edx                   ## imm = 0x27FD8
	callq	_clamp_val
	movl	%eax, %edi
	movl	$5, %esi
	callq	_DIV_ROUND_CLOSEST
	andl	$65528, %eax                    ## imm = 0xFFF8
	movl	(%r12), %edi
	movl	%r14d, %esi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ina3221_curr_reg,8,3           ## @ina3221_curr_reg
	.comm	_INT_MIN,4,2                    ## @INT_MIN
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.no_dead_strip	_ina3221_write_curr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ina3221_write_curr
_ina3221_write_curr:                    ; @ina3221_write_curr
	.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, x3
	mov	x20, x2
	mov	x21, x1
	bl	_dev_get_drvdata
	mov	x22, x0
	ldr	x8, [x0, #8]
	sbfiz	x9, x20, #2, #32
	ldr	w23, [x8, x9]
Lloh0:
	adrp	x8, _ina3221_curr_reg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ina3221_curr_reg@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	w20, [x8, x9]
Lloh3:
	adrp	x8, _INT_MIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INT_MIN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sdiv	w1, w8, w23
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	sdiv	w2, w8, w23
	mov	x0, x19
	bl	_clamp_val
	mul	w0, w0, w23
	mov	w1, #1000
	bl	_DIV_ROUND_CLOSEST
	mov	w1, #32808
	movk	w1, #65533, lsl #16
	mov	w2, #32728
	movk	w2, #2, lsl #16
	bl	_clamp_val
	mov	w1, #5
	bl	_DIV_ROUND_CLOSEST
	and	w2, w0, #0xfff8
	ldr	w0, [x22]
	mov	x1, x20
	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
	b	_regmap_write
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ina3221_curr_reg,8,3           ; @ina3221_curr_reg
	.comm	_INT_MIN,4,2                    ; @INT_MIN
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.no_dead_strip	_ina3221_write_curr
.subsections_via_symbols
