	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upd                            ## -- Begin function upd
	.p2align	4, 0x90
_upd:                                   ## @upd
	.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
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	_MAXQ@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rax
	movl	-4(%rdi,%rax,4), %r15d
	movl	%esi, %edi
	movl	%r15d, %esi
	callq	_rating_cmp
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	xorl	%r12d, %r12d
	cmpl	%r14d, %r15d
	sete	%r12b
	movq	%rbx, %r15
	movl	(%rbx), %eax
	leal	-2(%rax), %ebx
	cmpl	$2, %eax
	jl	LBB0_8
## %bb.2:
	movl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ecx, %ecx
	cmpl	%r14d, %eax
	sete	%cl
	orl	%ecx, %r12d
	leaq	-1(%rbx), %rax
	testq	%rbx, %rbx
	movq	%rax, %rbx
	jle	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rbx,4), %esi
	movl	%r14d, %edi
	callq	_rating_cmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13,%rbx,4), %eax
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, 4(%r13,%rbx,4)
	jmp	LBB0_6
LBB0_7:
	movl	$-1, %ebx
LBB0_8:
	movslq	%ebx, %rax
	testl	%r12d, %r12d
	jne	LBB0_14
## %bb.9:
	movl	(%r15), %ecx
	addl	$-2, %ecx
	movl	%ecx, %edx
	subl	%ebx, %edx
	jle	LBB0_14
## %bb.10:
	movslq	%ecx, %rcx
	movq	%rax, %rsi
	notq	%rsi
	addq	%rcx, %rsi
	andq	$3, %rdx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rcx,4), %edi
	movl	%edi, 4(%r13,%rcx,4)
	decq	%rcx
	decq	%rdx
	jne	LBB0_11
LBB0_12:
	cmpq	$3, %rsi
	jb	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movups	-12(%r13,%rcx,4), %xmm0
	movups	%xmm0, -8(%r13,%rcx,4)
	addq	$-4, %rcx
	cmpq	%rax, %rcx
	jg	LBB0_13
LBB0_14:
	movl	%r14d, 4(%r13,%rax,4)
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXQ,4,2                       ## @MAXQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_upd                            ; -- Begin function upd
	.p2align	2
_upd:                                   ; @upd
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _MAXQ@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MAXQ@GOTPAGEOFF]
	ldrsw	x8, [x22]
	add	x8, x0, x8, lsl #2
	ldur	w21, [x8, #-4]
	mov	x0, x1
	mov	x1, x21
	bl	_rating_cmp
	cbz	x0, LBB0_12
; %bb.1:
	cmp	w21, w19
	cset	w23, eq
	ldr	w8, [x22]
	subs	w21, w8, #2
	b.ge	LBB0_3
	b	LBB0_7
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w19
	cset	w8, eq
	orr	w23, w23, w8
	sub	x8, x21, #1
	cmp	x21, #0
	mov	x21, x8
	b.le	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20, x21, lsl #2]
	mov	x0, x19
	bl	_rating_cmp
	cbz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20, x21, lsl #2]
	cbz	w23, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x20, x21, lsl #2
	str	w8, [x9, #4]
	b	LBB0_2
LBB0_6:
	mov	w21, #-1
LBB0_7:
	cbnz	w23, LBB0_11
; %bb.8:
	ldr	w8, [x22]
	sub	w8, w8, #2
	cmp	w8, w21
	b.le	LBB0_11
; %bb.9:
	sxtw	x8, w8
	mov	x9, x21
	sxtw	x9, w9
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	x10, x20, x8, lsl #2
	ldr	w11, [x10]
	str	w11, [x10, #4]
	sub	x8, x8, #1
	cmp	x8, x9
	b.gt	LBB0_10
LBB0_11:
	add	w8, w21, #1
	str	w19, [x20, w8, sxtw #2]
LBB0_12:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXQ,4,2                       ; @MAXQ
.subsections_via_symbols
