	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_aem2_sensors
_update_aem2_sensors:                   ## @update_aem2_sensors
	.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
	callq	_mutex_lock
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_REFRESH_INTERVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	32(%r14), %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpq	$0, 24(%r14)
	jne	LBB0_5
LBB0_2:
	movq	%r14, %rdi
	callq	_update_aem_energy
	movq	_AEM_EXHAUST_ELEMENT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	16(%r14), %rcx
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_aem_read_sensor
	movl	(%rbx), %esi
	movq	16(%r14), %rcx
	addq	$4, %rcx
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_aem_read_sensor
	movq	_POWER_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_POWER_AUX@GOTPCREL(%rip), %r15
	cmpl	(%r15), %r12d
	jg	LBB0_5
## %bb.3:
	movslq	%r12d, %r13
	leaq	-1(%r13), %rbx
	shlq	$2, %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_AEM_POWER_CAP_ELEMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r14), %rcx
	addq	%r13, %rcx
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	$2, %r8d
	callq	_aem_read_sensor
	movslq	(%r15), %rax
	incq	%rbx
	incl	%r12d
	addq	$4, %r13
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_REFRESH_INTERVAL,8,3           ## @REFRESH_INTERVAL
	.comm	_AEM_EXHAUST_ELEMENT,4,2        ## @AEM_EXHAUST_ELEMENT
	.comm	_POWER_CAP,4,2                  ## @POWER_CAP
	.comm	_POWER_AUX,4,2                  ## @POWER_AUX
	.comm	_AEM_POWER_CAP_ELEMENT,4,2      ## @AEM_POWER_CAP_ELEMENT
	.no_dead_strip	_update_aem2_sensors
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_aem2_sensors
_update_aem2_sensors:                   ; @update_aem2_sensors
	.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
	bl	_mutex_lock
Lloh0:
	adrp	x8, _jiffies@GOTPAGE
Lloh1:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x19, #32]
Lloh3:
	adrp	x9, _REFRESH_INTERVAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _REFRESH_INTERVAL@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_time_before
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_update_aem_energy
Lloh6:
	adrp	x20, _AEM_EXHAUST_ELEMENT@GOTPAGE
Lloh7:
	ldr	x20, [x20, _AEM_EXHAUST_ELEMENT@GOTPAGEOFF]
	ldr	w1, [x20]
	ldr	x3, [x19, #16]
	mov	x0, x19
	mov	w2, #0
	mov	w4, #1
	bl	_aem_read_sensor
	ldr	w1, [x20]
	ldr	x8, [x19, #16]
	add	x3, x8, #4
	mov	x0, x19
	mov	w2, #1
	mov	w4, #1
	bl	_aem_read_sensor
Lloh8:
	adrp	x8, _POWER_CAP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _POWER_CAP@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
Lloh11:
	adrp	x21, _POWER_AUX@GOTPAGE
Lloh12:
	ldr	x21, [x21, _POWER_AUX@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w20, w8
	b.gt	LBB0_5
; %bb.3:
	sxtw	x8, w20
	sub	x22, x8, #1
	lsl	x23, x8, #2
Lloh13:
	adrp	x24, _AEM_POWER_CAP_ELEMENT@GOTPAGE
Lloh14:
	ldr	x24, [x24, _AEM_POWER_CAP_ELEMENT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	ldr	x8, [x19, #8]
	add	x3, x8, x23
	mov	x0, x19
	mov	x2, x20
	mov	w4, #2
	bl	_aem_read_sensor
	ldrsw	x8, [x21]
	add	x22, x22, #1
	add	w20, w20, #1
	add	x23, x23, #4
	cmp	x22, x8
	b.lt	LBB0_4
LBB0_5:
	mov	x0, x19
	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	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_REFRESH_INTERVAL,8,3           ; @REFRESH_INTERVAL
	.comm	_AEM_EXHAUST_ELEMENT,4,2        ; @AEM_EXHAUST_ELEMENT
	.comm	_POWER_CAP,4,2                  ; @POWER_CAP
	.comm	_POWER_AUX,4,2                  ; @POWER_AUX
	.comm	_AEM_POWER_CAP_ELEMENT,4,2      ; @AEM_POWER_CAP_ELEMENT
	.no_dead_strip	_update_aem2_sensors
.subsections_via_symbols
