	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ina2xx_write_raw
_ina2xx_write_raw:                      ## @ina2xx_write_raw
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_iio_priv
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_iio_buffer_enabled
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_2:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r12d, %r15d
	movq	%r13, %rdi
	callq	_mutex_lock
	movl	4(%r13), %edi
	movq	_INA2XX_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-60(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_22
## %bb.3:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	-60(%rbp), %eax
	movl	%eax, -44(%rbp)
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	cmpq	$130, %r12
	je	LBB0_7
## %bb.4:
	cmpq	$129, %r12
	je	LBB0_9
## %bb.5:
	cmpq	$128, %r12
	jne	LBB0_12
## %bb.6:
	leaq	-44(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_ina226_set_average
	jmp	LBB0_18
LBB0_7:
	movl	(%r14), %eax
	movq	_INA2XX_SHUNT_VOLTAGE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.8:
	imull	$1000, -48(%rbp), %eax          ## 4-byte Folded Reload
                                        ## imm = 0x3E8
	movslq	%r15d, %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	addl	%eax, %esi
	leaq	-44(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_ina219_set_vshunt_pga_gain
	jmp	LBB0_18
LBB0_9:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	8(%rdi), %rax
	movl	(%rax), %edx
	movq	_ina226@GOTPCREL(%rip), %rsi
	movl	(%r14), %eax
	movq	_INA2XX_SHUNT_VOLTAGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	(%rsi), %edx
	jne	LBB0_14
## %bb.10:
	cmpl	%ecx, %eax
	movl	%r15d, %esi
	leaq	-44(%rbp), %rdx
	jne	LBB0_16
## %bb.11:
	callq	_ina226_set_int_time_vshunt
	jmp	LBB0_18
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_13:
	leaq	-44(%rbp), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_ina219_set_vbus_range_denom
	jmp	LBB0_18
LBB0_14:
	cmpl	%ecx, %eax
	movl	%r15d, %esi
	leaq	-44(%rbp), %rdx
	jne	LBB0_17
## %bb.15:
	callq	_ina219_set_int_time_vshunt
	jmp	LBB0_18
LBB0_16:
	callq	_ina226_set_int_time_vbus
	jmp	LBB0_18
LBB0_17:
	callq	_ina219_set_int_time_vbus
LBB0_18:
	movl	%eax, %ebx
LBB0_19:
	testl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jne	LBB0_22
## %bb.20:
	movl	-44(%rbp), %edx
	xorl	%ebx, %ebx
	cmpl	-60(%rbp), %edx
	je	LBB0_22
## %bb.21:
	movl	4(%r13), %edi
	movq	_INA2XX_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_regmap_write
	movl	%eax, %ebx
LBB0_22:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_23:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_INA2XX_CONFIG,4,2              ## @INA2XX_CONFIG
	.comm	_ina226,4,2                     ## @ina226
	.comm	_INA2XX_SHUNT_VOLTAGE,4,2       ## @INA2XX_SHUNT_VOLTAGE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ina2xx_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ina2xx_write_raw
_ina2xx_write_raw:                      ; @ina2xx_write_raw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x4
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x22, x0
	bl	_iio_priv
	mov	x19, x0
	mov	x0, x22
	bl	_iio_buffer_enabled
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_24
LBB0_2:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x25, _INA2XX_CONFIG@GOTPAGE
Lloh4:
	ldr	x25, [x25, _INA2XX_CONFIG@GOTPAGEOFF]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x22, x0
	cbnz	w0, LBB0_23
; %bb.3:
	ldr	w8, [sp, #12]
	str	w8, [sp, #8]
	cmp	x24, #130
	b.eq	LBB0_7
; %bb.4:
	cmp	x24, #129
	b.eq	LBB0_9
; %bb.5:
	cmp	x24, #128
	b.ne	LBB0_12
; %bb.6:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_ina226_set_average
	b	LBB0_18
LBB0_7:
	ldr	w8, [x23]
Lloh5:
	adrp	x9, _INA2XX_SHUNT_VOLTAGE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _INA2XX_SHUNT_VOLTAGE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.8:
	mov	w8, #1000
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x9, w20, w9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	madd	w1, w21, w8, w9
	add	x2, sp, #8
	mov	x0, x19
	bl	_ina219_set_vshunt_pga_gain
	b	LBB0_18
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w10, [x8]
Lloh8:
	adrp	x8, _ina226@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ina226@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x8]
	ldr	w8, [x23]
Lloh11:
	adrp	x9, _INA2XX_SHUNT_VOLTAGE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _INA2XX_SHUNT_VOLTAGE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	cmp	w10, w11
	b.ne	LBB0_14
; %bb.10:
	cmp	w8, w9
	b.ne	LBB0_16
; %bb.11:
	bl	_ina226_set_int_time_vshunt
	b	LBB0_18
LBB0_12:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_19
LBB0_13:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_ina219_set_vbus_range_denom
	b	LBB0_18
LBB0_14:
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.15:
	bl	_ina219_set_int_time_vshunt
	b	LBB0_18
LBB0_16:
	bl	_ina226_set_int_time_vbus
	b	LBB0_18
LBB0_17:
	bl	_ina219_set_int_time_vbus
LBB0_18:
	mov	x22, x0
LBB0_19:
	cbnz	w22, LBB0_23
; %bb.20:
	ldp	w2, w8, [sp, #8]
	cmp	w2, w8
	b.ne	LBB0_22
; %bb.21:
	mov	w22, #0
	b	LBB0_23
LBB0_22:
	ldr	w0, [x19, #4]
	ldr	w1, [x25]
	bl	_regmap_write
	mov	x22, x0
LBB0_23:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_24:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_INA2XX_CONFIG,4,2              ; @INA2XX_CONFIG
	.comm	_ina226,4,2                     ; @ina226
	.comm	_INA2XX_SHUNT_VOLTAGE,4,2       ; @INA2XX_SHUNT_VOLTAGE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ina2xx_write_raw
.subsections_via_symbols
