	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function store_res
LCPI0_0:
	.quad	0x3e112e0be826d695              ## double 1.0000000000000001E-9
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_store_res
	.p2align	4, 0x90
_store_res:                             ## @store_res
	.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
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movq	%rdi, %r14
	movl	(%rdi), %edx
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_vkprintf
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	ucomisd	-48(%rbp), %xmm0                ## 8-byte Folded Reload
	jbe	LBB0_2
LBB0_1:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_n_ranges@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.3:
	movq	_Q_range@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%rcx,%rbx), %esi
	movq	%r14, %rdi
	callq	_get_rate_item_fast
	movq	(%r12), %rcx
	cmpl	(%rcx,%rbx), %eax
	jl	LBB0_1
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	4(%rcx,%rbx), %eax
	jg	LBB0_1
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%r13
	movslq	(%r15), %rax
	addq	$12, %rbx
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_7:
	movq	_R_tot@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_Q_limit@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jle	LBB0_1
## %bb.8:
	movq	%r14, %rdi
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_evaluate_rating
	movq	_Q_hash_group_mode@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_store_res_group_mode
	jmp	LBB0_1
LBB0_10:
	movq	_R_cnt@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_20
## %bb.11:
	movq	_RR@GOTPCREL(%rip), %r9
	movq	(%r9), %rdx
	ucomisd	8(%rdx), %xmm0
	jae	LBB0_1
## %bb.12:
	movl	$1, %r10d
	cmpq	$2, %rax
	jl	LBB0_28
## %bb.13:
	movl	$1, %r11d
	movl	$2, %edi
	movl	$2, %ecx
	movq	_R@GOTPCREL(%rip), %r8
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, %rax
	jle	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%edi, %esi
	orl	$1, %esi
	movslq	%esi, %rbx
	movsd	(%rdx,%rbx,8), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	(%rdx,%rcx,8), %xmm1
	movl	%edi, %r10d
	jbe	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%esi, %r10d
	jmp	LBB0_18
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	%edi, %r10d
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movslq	%r10d, %rdi
	ucomisd	(%rdx,%rdi,8), %xmm0
	jae	LBB0_27
## %bb.19:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%r8), %rcx
	movq	(%rcx,%rdi,8), %rdx
	movslq	%r11d, %rsi
	movq	%rdx, (%rcx,%rsi,8)
	movq	(%r9), %rdx
	movsd	(%rdx,%rdi,8), %xmm1            ## xmm1 = mem[0],zero
	movsd	%xmm1, (%rdx,%rsi,8)
	addl	%edi, %edi
	movslq	%edi, %rcx
	movl	%r10d, %r11d
	cmpq	%rcx, %rax
	jge	LBB0_14
	jmp	LBB0_28
LBB0_20:
	incq	%rax
	movq	%rax, (%rcx)
	cmpl	$2, %eax
	jl	LBB0_25
## %bb.21:
	movq	_RR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdi
	movq	_R@GOTPCREL(%rip), %r8
	movl	%eax, %ecx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	shrl	%ecx
	movsd	(%rdi,%rcx,8), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	jae	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	(%r8), %rdi
	movq	(%rdi,%rcx,8), %rbx
	movl	%eax, %esi
	movq	%rbx, (%rdi,%rsi,8)
	movq	(%rdx), %rdi
	movsd	(%rdi,%rcx,8), %xmm1            ## xmm1 = mem[0],zero
	movsd	%xmm1, (%rdi,%rsi,8)
	cmpl	$3, %eax
	movl	%ecx, %eax
	ja	LBB0_22
	jmp	LBB0_26
LBB0_25:
	movl	%eax, %ecx
LBB0_26:
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ecx, %rcx
	movq	%r14, (%rax,%rcx,8)
	movq	_RR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_29
LBB0_27:
	movl	%r11d, %r10d
LBB0_28:
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r10d, %rcx
	movq	%r14, (%rax,%rcx,8)
	movq	(%r9), %rax
LBB0_29:
	movsd	%xmm0, (%rax,%rcx,8)
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"store_res (item_id = %lld, w = %.10lf\n"

	.comm	_n_ranges,4,2                   ## @n_ranges
	.comm	_Q_range,8,3                    ## @Q_range
	.comm	_R_tot,4,2                      ## @R_tot
	.comm	_Q_limit,8,3                    ## @Q_limit
	.comm	_Q_hash_group_mode,8,3          ## @Q_hash_group_mode
	.comm	_R_cnt,8,3                      ## @R_cnt
	.comm	_RR,8,3                         ## @RR
	.comm	_R,8,3                          ## @R
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_store_res                      ; -- Begin function store_res
	.p2align	2
_store_res:                             ; @store_res
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-80]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset b8, -72
	.cfi_offset b9, -80
	fmov	d8, d0
	mov	x19, x0
	ldr	w2, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	mov	x8, #54933
	movk	x8, #59430, lsl #16
	movk	x8, #11787, lsl #32
	movk	x8, #15889, lsl #48
	fmov	d0, x8
	fcmp	d8, d0
	b.pl	LBB0_2
LBB0_1:
	mov	w0, #1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #80               ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh2:
	adrp	x20, _n_ranges@GOTPAGE
Lloh3:
	ldr	x20, [x20, _n_ranges@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x21, #0
	mov	x22, #0
Lloh4:
	adrp	x23, _Q_range@GOTPAGE
Lloh5:
	ldr	x23, [x23, _Q_range@GOTPAGEOFF]
	ldr	x8, [x23]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x21
	ldr	w1, [x8, #8]
	mov	x0, x19
	bl	_get_rate_item_fast
	ldr	x8, [x23]
	ldr	w9, [x8, x21]
	cmp	w0, w9
	b.lt	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x8, x21
	ldr	w9, [x9, #4]
	cmp	w0, w9
	b.gt	LBB0_1
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldrsw	x9, [x20]
	add	x21, x21, #12
	cmp	x22, x9
	b.lt	LBB0_4
LBB0_7:
Lloh6:
	adrp	x8, _R_tot@GOTPAGE
Lloh7:
	ldr	x8, [x8, _R_tot@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh8:
	adrp	x20, _Q_limit@GOTPAGE
Lloh9:
	ldr	x20, [x20, _Q_limit@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_1
; %bb.8:
	mov	x0, x19
	fmov	d0, d8
	bl	_evaluate_rating
Lloh10:
	adrp	x8, _Q_hash_group_mode@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Q_hash_group_mode@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_store_res_group_mode
	b	LBB0_1
LBB0_10:
Lloh13:
	adrp	x8, _R_cnt@GOTPAGE
Lloh14:
	ldr	x8, [x8, _R_cnt@GOTPAGEOFF]
	ldr	x9, [x8]
	ldr	x10, [x20]
	cmp	x9, x10
	b.ne	LBB0_14
; %bb.11:
Lloh15:
	adrp	x8, _RR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RR@GOTPAGEOFF]
	ldr	x10, [x8]
	ldr	d1, [x10, #8]
	fcmp	d1, d0
	b.ls	LBB0_1
; %bb.12:
	cmp	x9, #2
	b.ge	LBB0_20
; %bb.13:
	mov	w13, #1
	b	LBB0_28
LBB0_14:
	add	x10, x9, #1
	str	x10, [x8]
Lloh17:
	adrp	x8, _RR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _RR@GOTPAGEOFF]
Lloh19:
	adrp	x9, _R@GOTPAGE
Lloh20:
	ldr	x9, [x9, _R@GOTPAGEOFF]
	cmp	w10, #2
	b.lt	LBB0_18
; %bb.15:
	ldr	x12, [x8]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	lsr	w11, w10, #1
	ldr	d1, [x12, w11, uxtw #3]
	fcmp	d1, d0
	b.ge	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x12, [x9]
	lsl	x13, x11, #3
	ldr	x14, [x12, x13]
	mov	w15, w10
	lsl	x15, x15, #3
	str	x14, [x12, x15]
	ldr	x12, [x8]
	ldr	d1, [x12, x13]
	str	d1, [x12, x15]
	cmp	w10, #3
	mov	x10, x11
	b.hi	LBB0_16
	b	LBB0_19
LBB0_18:
	mov	x11, x10
LBB0_19:
	ldr	x9, [x9]
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
	sbfiz	x10, x11, #3, #32
	b	LBB0_29
LBB0_20:
	mov	w12, #1
	mov	w15, #2
Lloh21:
	adrp	x11, _R@GOTPAGE
Lloh22:
	ldr	x11, [x11, _R@GOTPAGEOFF]
	mov	x14, x15
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	cmp	x9, x15
	b.le	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	orr	w16, w14, #0x1
	ldr	d1, [x10, w16, sxtw #3]
	ldr	d2, [x10, x15, lsl #3]
	fcmp	d1, d2
	mov	x13, x14
	b.le	LBB0_25
; %bb.23:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	x13, x16
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	x13, x14
LBB0_25:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	d1, [x10, w13, sxtw #3]
	fcmp	d1, d0
	b.ls	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_21 Depth=1
	sxtw	x10, w13
	ldr	x14, [x11]
	lsl	x15, x10, #3
	ldr	x10, [x14, x15]
	sbfiz	x12, x12, #3, #32
	str	x10, [x14, x12]
	ldr	x10, [x8]
	ldr	d1, [x10, x15]
	str	d1, [x10, x12]
	lsl	w14, w13, #1
	sxtw	x15, w14
	mov	x12, x13
	cmp	x9, x15
	b.ge	LBB0_21
	b	LBB0_28
LBB0_27:
	mov	x13, x12
LBB0_28:
Lloh23:
	adrp	x9, _R@GOTPAGE
Lloh24:
	ldr	x9, [x9, _R@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
                                        ; kill: def $w13 killed $w13 killed $x13 def $x13
	sbfiz	x10, x13, #3, #32
LBB0_29:
	str	x19, [x9, x10]
	ldr	x8, [x8]
	str	d0, [x8, x10]
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"store_res (item_id = %lld, w = %.10lf\n"

	.comm	_n_ranges,4,2                   ; @n_ranges
	.comm	_Q_range,8,3                    ; @Q_range
	.comm	_R_tot,4,2                      ; @R_tot
	.comm	_Q_limit,8,3                    ; @Q_limit
	.comm	_Q_hash_group_mode,8,3          ; @Q_hash_group_mode
	.comm	_R_cnt,8,3                      ; @R_cnt
	.comm	_RR,8,3                         ; @RR
	.comm	_R,8,3                          ; @R
.subsections_via_symbols
