	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_avg                     ## -- Begin function update_avg
	.p2align	4, 0x90
_update_avg:                            ## @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
	cmpq	$0, (%rdi)
	movl	8(%rdi), %eax
	je	LBB0_1
## %bb.4:
	leaq	16(%rdi), %r8
	movl	16(%rdi), %esi
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_5
## %bb.6:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_8:
	leaq	96(%rdi), %rax
	leaq	104(%rdi), %rcx
	jmp	LBB0_11
LBB0_1:
	cmpl	$131, %eax
	jne	LBB0_27
## %bb.2:
	leaq	16(%rdi), %r8
	movl	16(%rdi), %esi
LBB0_3:
	leaq	48(%rdi), %rax
	leaq	56(%rdi), %rcx
	jmp	LBB0_11
LBB0_5:
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	testl	%esi, %esi
	jne	LBB0_14
LBB0_13:
	movq	%r10, 24(%rdi)
	movq	%r9, 32(%rdi)
	movl	$1, %esi
	jmp	LBB0_26
LBB0_9:
	leaq	80(%rdi), %rax
	leaq	88(%rdi), %rcx
	jmp	LBB0_11
LBB0_10:
	leaq	64(%rdi), %rax
	leaq	72(%rdi), %rcx
	jmp	LBB0_11
LBB0_7:
	leaq	112(%rdi), %rax
	leaq	120(%rdi), %rcx
LBB0_11:
	movq	(%rax), %r10
	movq	(%rcx), %r9
	testl	%esi, %esi
	je	LBB0_13
LBB0_14:
	movq	%r10, %rax
	movslq	%esi, %rcx
	subq	24(%rdi), %rax
	jl	LBB0_19
## %bb.15:
	movslq	40(%rdi), %r11
	leaq	-1(%rcx), %rdx
	imulq	%r11, %rdx
	addq	%rdx, %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_16
## %bb.17:
	cqto
	idivq	%rcx
	jmp	LBB0_18
LBB0_16:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_18:
	movl	%eax, 40(%rdi)
LBB0_19:
	movq	%r9, %rax
	subq	32(%rdi), %rax
	jl	LBB0_24
## %bb.20:
	movslq	44(%rdi), %r11
	leaq	-1(%rcx), %rdx
	imulq	%r11, %rdx
	addq	%rdx, %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_21
## %bb.22:
	cqto
	idivq	%rcx
	jmp	LBB0_23
LBB0_21:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_23:
	movl	%eax, 44(%rdi)
LBB0_24:
	movq	%r10, 24(%rdi)
	movq	%r9, 32(%rdi)
	movq	_AVGN_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jge	LBB0_27
## %bb.25:
	incl	%esi
LBB0_26:
	movl	%esi, (%r8)
LBB0_27:
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_3
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_AVGN_MAX,4,2                   ## @AVGN_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_avg                     ; -- Begin function update_avg
	.p2align	2
_update_avg:                            ; @update_avg
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0]
	ldr	w10, [x0, #8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x8, x0
	ldr	w9, [x8, #16]!
	sub	w10, w10, #128
	cmp	w10, #4
	b.hi	LBB0_7
; %bb.2:
Lloh0:
	adrp	x11, lJTI0_0@PAGE
Lloh1:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_3
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_3:
	add	x10, x0, #96
	add	x12, x0, #104
	b	LBB0_12
LBB0_4:
	cmp	w10, #131
	b.ne	LBB0_20
; %bb.5:
	mov	x8, x0
	ldr	w9, [x8, #16]!
LBB0_6:
	add	x10, x0, #48
	add	x12, x0, #56
	b	LBB0_12
LBB0_7:
	mov	x10, #0
	mov	x11, #0
	cbnz	w9, LBB0_13
LBB0_8:
	stp	x11, x10, [x0, #24]
	mov	w9, #1
	b	LBB0_19
LBB0_9:
	add	x10, x0, #80
	add	x12, x0, #88
	b	LBB0_12
LBB0_10:
	add	x10, x0, #64
	add	x12, x0, #72
	b	LBB0_12
LBB0_11:
	add	x10, x0, #112
	add	x12, x0, #120
LBB0_12:
	ldr	x11, [x10]
	ldr	x10, [x12]
	cbz	w9, LBB0_8
LBB0_13:
	ldr	x12, [x0, #24]
	subs	x12, x11, x12
	b.lt	LBB0_15
; %bb.14:
	ldrsw	x13, [x0, #40]
	sxtw	x14, w9
	sub	x15, x14, #1
	madd	x12, x13, x15, x12
	sdiv	x12, x12, x14
	str	w12, [x0, #40]
LBB0_15:
	ldr	x12, [x0, #32]
	subs	x12, x10, x12
	b.lt	LBB0_17
; %bb.16:
	ldrsw	x13, [x0, #44]
	mov	x14, x9
	sxtw	x14, w14
	sub	x15, x14, #1
	madd	x12, x13, x15, x12
	sdiv	x12, x12, x14
	str	w12, [x0, #44]
LBB0_17:
	stp	x11, x10, [x0, #24]
Lloh2:
	adrp	x10, _AVGN_MAX@GOTPAGE
Lloh3:
	ldr	x10, [x10, _AVGN_MAX@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ge	LBB0_20
; %bb.18:
	add	w9, w9, #1
LBB0_19:
	str	w9, [x8]
LBB0_20:
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_9-LBB0_3)>>2
	.byte	(LBB0_10-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_11-LBB0_3)>>2
                                        ; -- End function
	.comm	_AVGN_MAX,4,2                   ; @AVGN_MAX
.subsections_via_symbols
