	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ina3221_write_chip
_ina3221_write_chip:                    ## @ina3221_write_chip
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %ebx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	cmpl	$128, %ebx
	je	LBB0_5
## %bb.1:
	cmpl	$129, %ebx
	jne	LBB0_6
## %bb.2:
	movq	_ina3221_avg_samples@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_find_closest
	movl	%eax, %ebx
	movq	_INA3221_CONFIG_AVG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r14), %eax
	movq	_INA3221_CONFIG_AVG_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	jmp	LBB0_3
LBB0_5:
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_ina3221_interval_ms_to_conv_time
	movl	%eax, %r15d
	movq	_ina3221_conv_time@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_find_closest
	movl	%eax, %ebx
	movq	_INA3221_CONFIG_VBUS_CT_MASK@GOTPCREL(%rip), %rax
	movq	_INA3221_CONFIG_VSH_CT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	notl	%edx
	movq	_INA3221_CONFIG_VBUS_CT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %eax
	shll	%cl, %eax
	andl	(%r14), %edx
	movq	_INA3221_CONFIG_VSH_CT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	orl	%edx, %ebx
LBB0_3:
	movl	4(%r14), %edi
	movq	_INA3221_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movl	%ebx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ina3221_avg_samples,4,2        ## @ina3221_avg_samples
	.comm	_INA3221_CONFIG_AVG_MASK,4,2    ## @INA3221_CONFIG_AVG_MASK
	.comm	_INA3221_CONFIG_AVG_SHIFT,4,2   ## @INA3221_CONFIG_AVG_SHIFT
	.comm	_INA3221_CONFIG,4,2             ## @INA3221_CONFIG
	.comm	_ina3221_conv_time,4,2          ## @ina3221_conv_time
	.comm	_INA3221_CONFIG_VBUS_CT_MASK,4,2 ## @INA3221_CONFIG_VBUS_CT_MASK
	.comm	_INA3221_CONFIG_VSH_CT_MASK,4,2 ## @INA3221_CONFIG_VSH_CT_MASK
	.comm	_INA3221_CONFIG_VBUS_CT_SHIFT,4,2 ## @INA3221_CONFIG_VBUS_CT_SHIFT
	.comm	_INA3221_CONFIG_VSH_CT_SHIFT,4,2 ## @INA3221_CONFIG_VSH_CT_SHIFT
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.no_dead_strip	_ina3221_write_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ina3221_write_chip
_ina3221_write_chip:                    ; @ina3221_write_chip
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	bl	_dev_get_drvdata
	mov	x19, x0
	cmp	w21, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w21, #129
	b.ne	LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _ina3221_avg_samples@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ina3221_avg_samples@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x21
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_find_closest
Lloh3:
	adrp	x8, _INA3221_CONFIG_AVG_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INA3221_CONFIG_AVG_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x8]
	ldp	w10, w8, [x19]
	bic	w9, w10, w9
Lloh6:
	adrp	x10, _INA3221_CONFIG_AVG_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _INA3221_CONFIG_AVG_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	lsl	w10, w0, w10
	orr	w20, w10, w9
	b	LBB0_4
LBB0_3:
	ldr	w0, [x19]
	mov	x1, x20
	bl	_ina3221_interval_ms_to_conv_time
	mov	x20, x0
Lloh9:
	adrp	x8, _ina3221_conv_time@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ina3221_conv_time@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	mov	x0, x21
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	bl	_find_closest
Lloh12:
	adrp	x8, _INA3221_CONFIG_VBUS_CT_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INA3221_CONFIG_VBUS_CT_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _INA3221_CONFIG_VSH_CT_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _INA3221_CONFIG_VSH_CT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w9, w9, w8
Lloh18:
	adrp	x10, _INA3221_CONFIG_VBUS_CT_SHIFT@GOTPAGE
Lloh19:
	ldr	x10, [x10, _INA3221_CONFIG_VBUS_CT_SHIFT@GOTPAGEOFF]
	ldp	w11, w8, [x19]
	bic	w9, w11, w9
Lloh20:
	ldr	w10, [x10]
	lsl	w10, w0, w10
	orr	w9, w10, w9
Lloh21:
	adrp	x10, _INA3221_CONFIG_VSH_CT_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _INA3221_CONFIG_VSH_CT_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w10, w0, w10
	orr	w20, w9, w10
LBB0_4:
Lloh24:
	adrp	x9, _INA3221_CONFIG@GOTPAGE
Lloh25:
	ldr	x9, [x9, _INA3221_CONFIG@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x9]
	mov	x0, x8
	mov	x2, x20
	bl	_regmap_write
	cbnz	w0, LBB0_7
; %bb.5:
	str	w20, [x19]
	b	LBB0_7
LBB0_6:
Lloh27:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ina3221_avg_samples,4,2        ; @ina3221_avg_samples
	.comm	_INA3221_CONFIG_AVG_MASK,4,2    ; @INA3221_CONFIG_AVG_MASK
	.comm	_INA3221_CONFIG_AVG_SHIFT,4,2   ; @INA3221_CONFIG_AVG_SHIFT
	.comm	_INA3221_CONFIG,4,2             ; @INA3221_CONFIG
	.comm	_ina3221_conv_time,4,2          ; @ina3221_conv_time
	.comm	_INA3221_CONFIG_VBUS_CT_MASK,4,2 ; @INA3221_CONFIG_VBUS_CT_MASK
	.comm	_INA3221_CONFIG_VSH_CT_MASK,4,2 ; @INA3221_CONFIG_VSH_CT_MASK
	.comm	_INA3221_CONFIG_VBUS_CT_SHIFT,4,2 ; @INA3221_CONFIG_VBUS_CT_SHIFT
	.comm	_INA3221_CONFIG_VSH_CT_SHIFT,4,2 ; @INA3221_CONFIG_VSH_CT_SHIFT
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.no_dead_strip	_ina3221_write_chip
.subsections_via_symbols
