	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_measurement
_do_measurement:                        ## @do_measurement
	.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
	movl	%ecx, %r14d
	movq	%rdi, %rbx
	movq	_LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT@GOTPCREL(%rip), %rax
	addl	(%rax), %esi
	movq	_LOCHNAGAR2_IMON_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_LOCHNAGAR2_IMON_ENA_MASK@GOTPCREL(%rip), %rcx
	btsl	%esi, %edx
	orl	(%rcx), %edx
	movl	%eax, %esi
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_LOCHNAGAR2_IMON_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movq	_LOCHNAGAR2_IMON_CTRL3@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_LOCHNAGAR2_IMON_CONFIGURE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	$10000, %r9d                    ## imm = 0x2710
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movl	(%r15), %esi
	movq	_LOCHNAGAR2_IMON_MEASURE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_regmap_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:
	leal	(%r14,%r14,2), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	callq	_msleep
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	movl	$5000, %r8d                     ## imm = 0x1388
	movl	$200000, %r9d                   ## imm = 0x30D40
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_write                   ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT,4,2 ## @LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT
	.comm	_LOCHNAGAR2_IMON_CTRL1,4,2      ## @LOCHNAGAR2_IMON_CTRL1
	.comm	_LOCHNAGAR2_IMON_ENA_MASK,4,2   ## @LOCHNAGAR2_IMON_ENA_MASK
	.comm	_LOCHNAGAR2_IMON_CTRL2,4,2      ## @LOCHNAGAR2_IMON_CTRL2
	.comm	_LOCHNAGAR2_IMON_CTRL3,4,2      ## @LOCHNAGAR2_IMON_CTRL3
	.comm	_LOCHNAGAR2_IMON_CONFIGURE_MASK,4,2 ## @LOCHNAGAR2_IMON_CONFIGURE_MASK
	.comm	_LOCHNAGAR2_IMON_DONE_MASK,4,2  ## @LOCHNAGAR2_IMON_DONE_MASK
	.comm	_LOCHNAGAR2_IMON_MEASURE_MASK,4,2 ## @LOCHNAGAR2_IMON_MEASURE_MASK
	.no_dead_strip	_do_measurement
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_measurement
_do_measurement:                        ; @do_measurement
	.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, x3
	mov	x19, x0
Lloh0:
	adrp	x8, _LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w8, w8, w1
	mov	w9, #1
	lsl	w8, w9, w8
Lloh3:
	adrp	x9, _LOCHNAGAR2_IMON_CTRL1@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LOCHNAGAR2_IMON_CTRL1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
Lloh6:
	adrp	x9, _LOCHNAGAR2_IMON_ENA_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _LOCHNAGAR2_IMON_ENA_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w2
	orr	w2, w8, w9
	bl	_regmap_write
	tbnz	w0, #31, LBB0_7
; %bb.1:
Lloh9:
	adrp	x8, _LOCHNAGAR2_IMON_CTRL2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LOCHNAGAR2_IMON_CTRL2@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_regmap_write
	tbnz	w0, #31, LBB0_7
; %bb.2:
Lloh12:
	adrp	x21, _LOCHNAGAR2_IMON_CTRL3@GOTPAGE
Lloh13:
	ldr	x21, [x21, _LOCHNAGAR2_IMON_CTRL3@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh14:
	adrp	x8, _LOCHNAGAR2_IMON_CONFIGURE_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LOCHNAGAR2_IMON_CONFIGURE_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_regmap_write
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	mov	w5, #10000
	bl	_regmap_read_poll_timeout
	tbnz	w0, #31, LBB0_7
; %bb.4:
	ldr	w1, [x21]
Lloh17:
	adrp	x8, _LOCHNAGAR2_IMON_MEASURE_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LOCHNAGAR2_IMON_MEASURE_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_regmap_write
	tbnz	w0, #31, LBB0_7
; %bb.5:
	add	w8, w20, w20, lsl #1
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w0, w8, #1
	bl	_msleep
	ldr	w1, [x21]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #5000
	mov	w5, #3392
	movk	w5, #3, lsl #16
	bl	_regmap_read_poll_timeout
	tbnz	w0, #31, LBB0_7
; %bb.6:
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #0
	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
	b	_regmap_write
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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT,4,2 ; @LOCHNAGAR2_IMON_MEASURED_CHANNELS_SHIFT
	.comm	_LOCHNAGAR2_IMON_CTRL1,4,2      ; @LOCHNAGAR2_IMON_CTRL1
	.comm	_LOCHNAGAR2_IMON_ENA_MASK,4,2   ; @LOCHNAGAR2_IMON_ENA_MASK
	.comm	_LOCHNAGAR2_IMON_CTRL2,4,2      ; @LOCHNAGAR2_IMON_CTRL2
	.comm	_LOCHNAGAR2_IMON_CTRL3,4,2      ; @LOCHNAGAR2_IMON_CTRL3
	.comm	_LOCHNAGAR2_IMON_CONFIGURE_MASK,4,2 ; @LOCHNAGAR2_IMON_CONFIGURE_MASK
	.comm	_LOCHNAGAR2_IMON_DONE_MASK,4,2  ; @LOCHNAGAR2_IMON_DONE_MASK
	.comm	_LOCHNAGAR2_IMON_MEASURE_MASK,4,2 ; @LOCHNAGAR2_IMON_MEASURE_MASK
	.no_dead_strip	_do_measurement
.subsections_via_symbols
