	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hts221_update_avg
_hts221_update_avg:                     ## @hts221_update_avg
	.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
	movq	_hts221_avg_list@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	%esi, %r15d
	movq	_HTS221_AVG_DEPTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.5:
	movq	%r15, %rcx
	shlq	$4, %rcx
	movq	(%r12,%rcx), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdx, (%rcx,%rbx,8)
	je	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	cmpq	%rbx, %rax
	jne	LBB0_6
	jmp	LBB0_8
LBB0_1:
	xorl	%ebx, %ebx
LBB0_2:
	cmpl	%eax, %ebx
	jne	LBB0_3
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_3:
	movq	%r15, %r13
	shlq	$4, %r13
	movl	8(%r12,%r13), %edi
	callq	___ffs
	movl	%ebx, %r8d
	movl	%eax, %ecx
	shll	%cl, %r8d
	movl	8(%r12,%r13), %edx
	movl	12(%r12,%r13), %esi
	andl	%edx, %r8d
	movl	8(%r14), %edi
	movl	%r8d, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_9
## %bb.4:
	movq	(%r14), %rax
	movl	%ebx, (%rax,%r15,4)
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_hts221_avg_list,8,3            ## @hts221_avg_list
	.comm	_HTS221_AVG_DEPTH,4,2           ## @HTS221_AVG_DEPTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hts221_update_avg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hts221_update_avg
_hts221_update_avg:                     ; @hts221_update_avg
	.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	x19, x0
Lloh0:
	adrp	x8, _hts221_avg_list@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hts221_avg_list@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	w20, w1
Lloh3:
	adrp	x9, _HTS221_AVG_DEPTH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HTS221_AVG_DEPTH@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x21, #0
	lsl	x10, x20, #4
	ldr	x10, [x8, x10]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x21, lsl #3]
	cmp	x11, x2
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #1
	cmp	x9, x21
	b.ne	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w21, #0
LBB0_5:
	cmp	w21, w9
	b.ne	LBB0_7
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_7:
	add	x22, x8, x20, lsl #4
	ldr	w0, [x22, #8]
	bl	___ffs
	lsl	w8, w21, w0
	ldp	w2, w1, [x22, #8]
	and	w3, w8, w2
	ldr	w0, [x19, #8]
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_9
; %bb.8:
	mov	w0, #0
	ldr	x8, [x19]
	str	w21, [x8, x20, lsl #2]
LBB0_9:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_hts221_avg_list,8,3            ; @hts221_avg_list
	.comm	_HTS221_AVG_DEPTH,4,2           ; @HTS221_AVG_DEPTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hts221_update_avg
.subsections_via_symbols
