	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function model_update
_model_update:                          ## @model_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	(%rdi), %r8
	movslq	%esi, %rax
	incl	(%r8,%rax,4)
	decl	8(%rdi)
	je	LBB0_1
## %bb.10:
	popq	%rbp
	retq
LBB0_1:
	movl	12(%rdi), %esi
	addl	16(%rdi), %esi
	movl	%esi, 12(%rdi)
	cmpl	$32768, %esi                    ## imm = 0x8000
	jle	LBB0_2
## %bb.3:
	movl	$0, 12(%rdi)
	cmpl	$0, 20(%rdi)
	jle	LBB0_9
## %bb.4:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r8,%rax,4), %esi
	incl	%esi
	sarl	%esi
	movl	%esi, (%r8,%rax,4)
	addl	12(%rdi), %esi
	movl	%esi, 12(%rdi)
	incq	%rax
	movslq	20(%rdi), %r9
	cmpq	%r9, %rax
	jl	LBB0_5
	jmp	LBB0_6
LBB0_2:
	movl	20(%rdi), %r9d
LBB0_6:
	xorl	%ecx, %ecx
	movl	$-2147483648, %eax              ## imm = 0x80000000
	xorl	%edx, %edx
	divl	%esi
	testl	%r9d, %r9d
	jle	LBB0_9
## %bb.7:
	movq	24(%rdi), %r9
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %edx
	imull	%eax, %edx
	shrl	$16, %edx
	movl	%edx, (%r9,%rsi,4)
	addl	(%r8,%rsi,4), %ecx
	incq	%rsi
	movslq	20(%rdi), %rdx
	cmpq	%rdx, %rsi
	jl	LBB0_8
LBB0_9:
	movl	16(%rdi), %eax
	movl	32(%rdi), %ecx
	leal	(%rax,%rax,4), %eax
	sarl	$2, %eax
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, 16(%rdi)
	movl	%eax, 8(%rdi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_model_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function model_update
_model_update:                          ; @model_update
	.cfi_startproc
; %bb.0:
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0]
	sbfiz	x9, x1, #2, #32
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldr	w9, [x0, #8]
	subs	w9, w9, #1
	str	w9, [x0, #8]
	b.eq	LBB0_2
; %bb.1:
	ret
LBB0_2:
	ldp	w10, w9, [x0, #12]
	add	w9, w10, w9
	str	w9, [x0, #12]
	cmp	w9, #8, lsl #12                 ; =32768
	b.le	LBB0_7
; %bb.3:
	str	wzr, [x0, #12]
	ldr	w9, [x0, #20]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x11, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x9, x11, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	asr	w10, w10, #1
	str	w10, [x8, x9]
	ldr	w9, [x0, #12]
	add	w9, w9, w10
	str	w9, [x0, #12]
	add	x11, x11, #1
	ldrsw	x10, [x0, #20]
	cmp	x11, x10
	b.lt	LBB0_5
; %bb.6:
	cmp	w10, #1
	b.ge	LBB0_8
	b	LBB0_10
LBB0_7:
	ldr	w10, [x0, #20]
	cmp	w10, #1
	b.lt	LBB0_10
LBB0_8:
	mov	x10, #0
	mov	w11, #0
	mov	w13, #-2147483648
	ldr	x12, [x0, #24]
	udiv	w9, w13, w9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mul	w13, w11, w9
	lsr	w13, w13, #16
	lsl	x14, x10, #2
	str	w13, [x12, x14]
	ldr	w13, [x8, x14]
	add	w11, w13, w11
	add	x10, x10, #1
	ldrsw	x13, [x0, #20]
	cmp	x10, x13
	b.lt	LBB0_9
LBB0_10:
	ldr	w8, [x0, #16]
	add	w8, w8, w8, lsl #2
	asr	w8, w8, #2
	ldr	w9, [x0, #32]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x0, #16]
	str	w8, [x0, #8]
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_model_update
.subsections_via_symbols
