	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function model256_update
_model256_update:                       ## @model256_update
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r9
	movslq	%esi, %rax
	incl	(%r9,%rax,4)
	decl	8(%rdi)
	jne	LBB0_13
## %bb.1:
	movl	12(%rdi), %ecx
	addl	16(%rdi), %ecx
	movl	%ecx, 12(%rdi)
	cmpl	$32769, %ecx                    ## imm = 0x8001
	jl	LBB0_4
## %bb.2:
	movl	$0, 12(%rdi)
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r9,%rax,4), %ecx
	incl	%ecx
	sarl	%ecx
	movl	%ecx, (%r9,%rax,4)
	addl	%ecx, 12(%rdi)
	movl	4(%r9,%rax,4), %ecx
	incl	%ecx
	sarl	%ecx
	movl	%ecx, 4(%r9,%rax,4)
	addl	12(%rdi), %ecx
	movl	%ecx, 12(%rdi)
	addq	$2, %rax
	cmpq	$256, %rax                      ## imm = 0x100
	jne	LBB0_3
LBB0_4:
	xorl	%r12d, %r12d
	movl	$-2147483648, %eax              ## imm = 0x80000000
	xorl	%edx, %edx
	divl	%ecx
	movq	24(%rdi), %r8
	movl	$0, (%r8)
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	32(%rdi), %rdi
	leaq	112(%r8), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r8), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	$1, %esi
	movq	_MODEL256_SEC_SCALE@GOTPCREL(%rip), %r10
	xorl	%r15d, %r15d
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %esi
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_MODEL256_SEC_SCALE@GOTPCREL(%rip), %r10
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r12
	cmpq	$256, %r12                      ## imm = 0x100
	je	LBB0_9
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
                                        ##     Child Loop BB0_18 Depth 2
                                        ##     Child Loop BB0_23 Depth 2
	movl	%r15d, %ebx
	imull	%eax, %ebx
	shrl	$16, %ebx
	movl	%ebx, (%rdi,%r12,4)
	addl	(%r9,%r12,4), %r15d
	movb	(%r10), %cl
	shrl	%cl, %ebx
	movl	%ebx, %r13d
	subl	%esi, %r13d
	jl	LBB0_25
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%esi, %ecx
	incl	%ebx
	leal	-1(%r12), %esi
	cmpl	$7, %r13d
	jb	LBB0_22
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%r13
	movq	%r13, %r10
	andq	$-8, %r10
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%r10), %rax
	movq	%rax, %r11
	shrq	$3, %r11
	incq	%r11
	movl	%r11d, %r14d
	andl	$3, %r14d
	cmpq	$24, %rax
	jae	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r9d, %r9d
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	andq	$-4, %r11
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rax
	xorl	%r9d, %r9d
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	%xmm0, -112(%rax,%r9,4)
	movdqu	%xmm0, -96(%rax,%r9,4)
	movdqu	%xmm0, -80(%rax,%r9,4)
	movdqu	%xmm0, -64(%rax,%r9,4)
	movdqu	%xmm0, -48(%rax,%r9,4)
	movdqu	%xmm0, -32(%rax,%r9,4)
	movdqu	%xmm0, -16(%rax,%r9,4)
	movdqu	%xmm0, (%rax,%r9,4)
	addq	$32, %r9
	addq	$-4, %r11
	jne	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	testq	%r14, %r14
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	%rcx, %r9
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r9,4), %rax
	shlq	$5, %r14
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_18:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	%xmm0, -16(%rax,%rdx)
	movdqu	%xmm0, (%rax,%rdx)
	addq	$32, %rdx
	cmpq	%rdx, %r14
	jne	LBB0_18
LBB0_19:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r10, %r13
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	%r10, %rcx
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	_MODEL256_SEC_SCALE@GOTPCREL(%rip), %r10
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %edx
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%esi, (%r8,%rcx,4)
	incq	%rcx
	cmpl	%ecx, %edx
	jne	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %esi
	jmp	LBB0_25
LBB0_9:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpl	40(%rdx), %esi
	jge	LBB0_12
## %bb.10:
	movl	%esi, %eax
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	$255, (%r8,%rax,4)
	incq	%rax
	movslq	40(%rdx), %rcx
	cmpq	%rcx, %rax
	jl	LBB0_11
LBB0_12:
	movl	16(%rdx), %eax
	movl	44(%rdx), %ecx
	leal	(%rax,%rax,4), %eax
	sarl	$2, %eax
	cmpl	%ecx, %eax
	cmovgel	%ecx, %eax
	movl	%eax, 16(%rdx)
	movl	%eax, 8(%rdx)
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODEL256_SEC_SCALE,4,2         ## @MODEL256_SEC_SCALE
	.no_dead_strip	_model256_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function model256_update
_model256_update:                       ; @model256_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	w16, w10, w9
	str	w16, [x0, #12]
	cmp	w16, #8, lsl #12                ; =32768
	b.le	LBB0_5
; %bb.3:
	mov	x9, #0
	str	wzr, [x0, #12]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	asr	w10, w10, #1
	str	w10, [x8, x9]
	ldr	w11, [x0, #12]
	add	w16, w11, w10
	str	w16, [x0, #12]
	add	x9, x9, #4
	cmp	x9, #1024
	b.ne	LBB0_4
LBB0_5:
	mov	x10, #0
	mov	w11, #0
	mov	w17, #-2147483648
	ldp	x9, x13, [x0, #24]
	mov	x14, x9
	str	wzr, [x14], #32
	mov	w12, #1
Lloh0:
	adrp	x15, _MODEL256_SEC_SCALE@GOTPAGE
Lloh1:
	ldr	x15, [x15, _MODEL256_SEC_SCALE@GOTPAGEOFF]
	udiv	w16, w17, w16
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w11, w17, w11
	add	x10, x10, #1
	cmp	x10, #256
	b.eq	LBB0_15
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
	mul	w17, w11, w16
	lsr	w1, w17, #16
	lsl	x17, x10, #2
	str	w1, [x13, x17]
	ldr	w17, [x8, x17]
	ldr	w2, [x15]
	lsr	w2, w1, w2
	subs	w3, w2, w12
	b.lt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w6, w12
	add	w12, w2, #1
	sub	w1, w10, #1
	cmp	w3, #15
	b.hs	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x3, x6
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x4, x3, #1
	and	x5, x4, #0x1fffffff0
	add	x3, x5, x6
	dup.4s	v0, w1
	add	x6, x14, x6, lsl #2
	mov	x7, x5
LBB0_11:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	q0, q0, [x6, #-32]
	stp	q0, q0, [x6], #64
	subs	x7, x7, #16
	b.ne	LBB0_11
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	x4, x5
	b.eq	LBB0_6
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x4, x9, x3, lsl #2
	sub	w2, w2, w3
	add	w2, w2, #1
LBB0_14:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	w1, [x4], #4
	subs	w2, w2, #1
	b.ne	LBB0_14
	b	LBB0_6
LBB0_15:
	ldr	w8, [x0, #40]
	cmp	w12, w8
	b.ge	LBB0_18
; %bb.16:
	mov	w10, w12
	mov	w8, #255
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x9, x10, lsl #2]
	add	x11, x10, #1
	ldrsw	x12, [x0, #40]
	mov	x10, x11
	cmp	x11, x12
	b.lt	LBB0_17
LBB0_18:
	ldr	w8, [x0, #16]
	add	w8, w8, w8, lsl #2
	asr	w8, w8, #2
	ldr	w9, [x0, #44]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x0, #16]
	str	w8, [x0, #8]
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MODEL256_SEC_SCALE,4,2         ; @MODEL256_SEC_SCALE
	.no_dead_strip	_model256_update
.subsections_via_symbols
