	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_store_res_std                  ## -- Begin function store_res_std
	.p2align	4, 0x90
_store_res_std:                         ## @store_res_std
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_R_tot@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_R_position@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_2
## %bb.1:
	callq	_user_ad_price
	movq	_Q_limit@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leal	-1(%rcx), %edx
	xorl	%esi, %esi
	testl	%eax, %eax
	cmovgl	%eax, %esi
	cmpl	%ecx, %eax
	cmovgel	%edx, %esi
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%esi, %rcx
	incq	(%rax,%rcx,8)
	jmp	LBB0_44
LBB0_2:
	cmpl	$-2147483648, %esi              ## imm = 0x80000000
	je	LBB0_44
## %bb.3:
	movq	_Q_limit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_44
## %bb.4:
	movq	_Q_order@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	$-2, %ecx
	je	LBB0_16
## %bb.5:
	cmpl	$-1, %ecx
	je	LBB0_25
## %bb.6:
	cmpl	$2, %ecx
	jne	LBB0_26
## %bb.7:
	movq	_UserRate@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movslq	%edi, %r8
	movl	(%rdx,%r8,4), %r9d
	movq	_R_cnt@GOTPCREL(%rip), %rdi
	movl	(%rdi), %esi
	cmpl	%eax, %esi
	jne	LBB0_28
## %bb.8:
	movq	_R@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	movq	8(%r10), %rcx
	cmpl	%r9d, (%rdx,%rcx,4)
	jle	LBB0_44
## %bb.9:
	movl	$1, %ecx
	cmpl	$2, %eax
	jb	LBB0_43
## %bb.10:
	movl	$1, %esi
	movl	$2, %edi
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, %edi
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%edi, %ecx
	orl	$1, %ecx
	movslq	%ecx, %rbx
	movq	(%r10,%rbx,8), %rbx
	movl	(%rdx,%rbx,4), %r11d
	movslq	%edi, %rbx
	movq	(%r10,%rbx,8), %rbx
	cmpl	(%rdx,%rbx,4), %r11d
	jg	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%edi, %ecx
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	movslq	%ecx, %rdi
	movq	(%r10,%rdi,8), %rdi
	cmpl	%r9d, (%rdx,%rdi,4)
	jle	LBB0_42
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movslq	%esi, %rsi
	movq	%rdi, (%r10,%rsi,8)
	leal	(%rcx,%rcx), %edi
	movl	%ecx, %esi
	cmpl	%eax, %edi
	jle	LBB0_11
	jmp	LBB0_43
LBB0_16:
	movq	_UserRate@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	movslq	%edi, %r8
	movl	(%r11,%r8,4), %r9d
	movq	_R_cnt@GOTPCREL(%rip), %rdi
	movl	(%rdi), %esi
	cmpl	%eax, %esi
	jne	LBB0_32
## %bb.17:
	movq	_R@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	movq	8(%r10), %rcx
	cmpl	%r9d, (%r11,%rcx,4)
	jge	LBB0_44
## %bb.18:
	movl	$1, %ecx
	cmpl	$2, %eax
	jb	LBB0_43
## %bb.19:
	movl	$1, %esi
	movl	$2, %edi
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, %edi
	jge	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	%edi, %ecx
	orl	$1, %ecx
	movslq	%ecx, %rdx
	movq	(%r10,%rdx,8), %rdx
	movl	(%r11,%rdx,4), %edx
	movslq	%edi, %rbx
	movq	(%r10,%rbx,8), %rbx
	cmpl	(%r11,%rbx,4), %edx
	jl	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_20 Depth=1
	movl	%edi, %ecx
LBB0_23:                                ##   in Loop: Header=BB0_20 Depth=1
	movslq	%ecx, %rdx
	movq	(%r10,%rdx,8), %rdi
	cmpl	%r9d, (%r11,%rdi,4)
	jge	LBB0_42
## %bb.24:                              ##   in Loop: Header=BB0_20 Depth=1
	movslq	%esi, %rdx
	movq	%rdi, (%r10,%rdx,8)
	leal	(%rcx,%rcx), %edi
	movl	%ecx, %esi
	cmpl	%eax, %edi
	jle	LBB0_20
	jmp	LBB0_43
LBB0_25:
	movq	_R_cnt@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%esi, %esi
	cmpl	%eax, %edx
	cmovnel	%edx, %esi
	movslq	%edi, %rax
	movq	_R@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leal	1(%rsi), %edi
	movl	%edi, (%rcx)
	movslq	%esi, %rcx
	movq	%rax, (%rdx,%rcx,8)
	jmp	LBB0_44
LBB0_26:
	movq	_R_cnt@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	cmpl	%eax, %edx
	jge	LBB0_44
## %bb.27:
	movslq	%edi, %rax
	movq	_R@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	leal	1(%rdx), %edi
	movl	%edi, (%rcx)
	movq	%rax, (%rsi,%rdx,8)
	jmp	LBB0_44
LBB0_28:
	leal	1(%rsi), %ecx
	movl	%ecx, (%rdi)
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testl	%esi, %esi
	jle	LBB0_39
## %bb.29:
	movl	%ecx, %esi
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	shrl	%esi
	movq	(%rax,%rsi,8), %rdi
	cmpl	%r9d, (%rdx,%rdi,4)
	jge	LBB0_39
## %bb.31:                              ##   in Loop: Header=BB0_30 Depth=1
	movl	%ecx, %ebx
	movq	%rdi, (%rax,%rbx,8)
	cmpl	$3, %ecx
	movl	%esi, %ecx
	ja	LBB0_30
	jmp	LBB0_40
LBB0_32:
	leal	1(%rsi), %ecx
	movl	%ecx, (%rdi)
	movq	_R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testl	%esi, %esi
	jle	LBB0_39
## %bb.33:
	movl	%ecx, %esi
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	shrl	%esi
	movq	(%rax,%rsi,8), %rdi
	cmpl	%r9d, (%r11,%rdi,4)
	jle	LBB0_39
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=1
	movl	%ecx, %edx
	movq	%rdi, (%rax,%rdx,8)
	cmpl	$3, %ecx
	movl	%esi, %ecx
	ja	LBB0_34
	jmp	LBB0_40
LBB0_39:
	movl	%ecx, %esi
LBB0_40:
	movslq	%esi, %rcx
	movq	%r8, (%rax,%rcx,8)
	jmp	LBB0_44
LBB0_42:
	movl	%esi, %ecx
LBB0_43:
	movslq	%ecx, %rax
	movq	%r8, (%r10,%rax,8)
LBB0_44:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R_tot,4,2                      ## @R_tot
	.comm	_R_position,4,2                 ## @R_position
	.comm	_Q_limit,4,2                    ## @Q_limit
	.comm	_R,8,3                          ## @R
	.comm	_Q_order,4,2                    ## @Q_order
	.comm	_R_cnt,4,2                      ## @R_cnt
	.comm	_UserRate,8,3                   ## @UserRate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_store_res_std                  ; -- Begin function store_res_std
	.p2align	2
_store_res_std:                         ; @store_res_std
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x8, _R_tot@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R_tot@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh2:
	adrp	x8, _R_position@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R_position@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	cmp	w1, #1
	b.lt	LBB0_2
; %bb.1:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_user_ad_price
Lloh5:
	adrp	x8, _Q_limit@GOTPAGE
Lloh6:
	ldr	x8, [x8, _Q_limit@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sub	w9, w8, #1
	cmp	w0, #0
	csel	w10, w0, wzr, gt
	cmp	w0, w8
	csel	w8, w10, w9, lt
Lloh8:
	adrp	x9, _R@GOTPAGE
Lloh9:
	ldr	x9, [x9, _R@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	sbfiz	x8, x8, #3, #32
	ldr	x10, [x9, x8]
	add	x10, x10, #1
	str	x10, [x9, x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	w8, #-2147483648
	cmp	w1, w8
	b.eq	LBB0_31
; %bb.3:
Lloh11:
	adrp	x8, _Q_limit@GOTPAGE
Lloh12:
	ldr	x8, [x8, _Q_limit@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_31
; %bb.4:
Lloh14:
	adrp	x9, _Q_order@GOTPAGE
Lloh15:
	ldr	x9, [x9, _Q_order@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmn	w9, #2
	b.eq	LBB0_16
; %bb.5:
	cmn	w9, #1
	b.eq	LBB0_20
; %bb.6:
	cmp	w9, #2
	b.ne	LBB0_21
; %bb.7:
Lloh17:
	adrp	x9, _UserRate@GOTPAGE
Lloh18:
	ldr	x9, [x9, _UserRate@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x9]
	mov	x9, x0
	sxtw	x9, w9
	ldr	w11, [x10, w0, sxtw #2]
Lloh20:
	adrp	x14, _R_cnt@GOTPAGE
Lloh21:
	ldr	x14, [x14, _R_cnt@GOTPAGEOFF]
	ldr	w13, [x14]
	cmp	w13, w8
	b.ne	LBB0_23
; %bb.8:
Lloh22:
	adrp	x12, _R@GOTPAGE
Lloh23:
	ldr	x12, [x12, _R@GOTPAGEOFF]
Lloh24:
	ldr	x12, [x12]
	ldr	x13, [x12, #8]
	ldr	w13, [x10, x13, lsl #2]
	cmp	w13, w11
	b.le	LBB0_31
; %bb.9:
	cmp	w8, #2
	b.lo	LBB0_19
; %bb.10:
	mov	w13, #1
	mov	w15, #2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	cmp	w15, w8
	b.ge	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	sxtw	x14, w15
	orr	x14, x14, #0x1
	ldr	x16, [x12, x14, lsl #3]
	ldr	w16, [x10, x16, lsl #2]
	ldr	x17, [x12, w15, sxtw #3]
	ldr	w17, [x10, x17, lsl #2]
	cmp	w16, w17
	csel	w14, w14, w15, gt
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x14, x15
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x15, [x12, w14, sxtw #3]
	ldr	w16, [x10, x15, lsl #2]
	cmp	w16, w11
	b.le	LBB0_39
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	str	x15, [x12, w13, sxtw #3]
	lsl	w15, w14, #1
	mov	x13, x14
	cmp	w15, w8
	b.le	LBB0_11
	b	LBB0_38
LBB0_16:
Lloh25:
	adrp	x9, _UserRate@GOTPAGE
Lloh26:
	ldr	x9, [x9, _UserRate@GOTPAGEOFF]
Lloh27:
	ldr	x10, [x9]
	sxtw	x9, w0
	ldr	w11, [x10, w0, sxtw #2]
Lloh28:
	adrp	x14, _R_cnt@GOTPAGE
Lloh29:
	ldr	x14, [x14, _R_cnt@GOTPAGEOFF]
	ldr	w13, [x14]
	cmp	w13, w8
	b.ne	LBB0_26
; %bb.17:
Lloh30:
	adrp	x12, _R@GOTPAGE
Lloh31:
	ldr	x12, [x12, _R@GOTPAGEOFF]
Lloh32:
	ldr	x12, [x12]
	ldr	x13, [x12, #8]
	ldr	w13, [x10, x13, lsl #2]
	cmp	w13, w11
	b.ge	LBB0_31
; %bb.18:
	cmp	w8, #2
	b.hs	LBB0_32
LBB0_19:
	mov	w14, #1
	b	LBB0_38
LBB0_20:
Lloh33:
	adrp	x9, _R_cnt@GOTPAGE
Lloh34:
	ldr	x9, [x9, _R_cnt@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w10, w8
	csel	w8, wzr, w10, eq
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
Lloh35:
	adrp	x10, _R@GOTPAGE
Lloh36:
	ldr	x10, [x10, _R@GOTPAGEOFF]
	sxtw	x11, w0
Lloh37:
	ldr	x10, [x10]
	add	w12, w8, #1
	str	w12, [x9]
	str	x11, [x10, w8, sxtw #3]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_21:
Lloh38:
	adrp	x10, _R_cnt@GOTPAGE
Lloh39:
	ldr	x10, [x10, _R_cnt@GOTPAGEOFF]
	ldrsw	x9, [x10]
	cmp	w9, w8
	b.ge	LBB0_31
; %bb.22:
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
Lloh40:
	adrp	x8, _R@GOTPAGE
Lloh41:
	ldr	x8, [x8, _R@GOTPAGEOFF]
	sxtw	x11, w0
Lloh42:
	ldr	x8, [x8]
	add	w12, w9, #1
	str	w12, [x10]
	str	x11, [x8, x9, lsl #3]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_23:
	add	w12, w13, #1
	str	w12, [x14]
Lloh43:
	adrp	x8, _R@GOTPAGE
Lloh44:
	ldr	x8, [x8, _R@GOTPAGEOFF]
Lloh45:
	ldr	x8, [x8]
	cmp	w13, #1
	b.lt	LBB0_29
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	lsr	w13, w12, #1
	ldr	x14, [x8, w13, uxtw #3]
	ldr	w15, [x10, x14, lsl #2]
	cmp	w15, w11
	b.ge	LBB0_29
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	str	x14, [x8, w12, uxtw #3]
	cmp	w12, #3
	mov	x12, x13
	b.hi	LBB0_24
	b	LBB0_30
LBB0_26:
	add	w12, w13, #1
	str	w12, [x14]
Lloh46:
	adrp	x8, _R@GOTPAGE
Lloh47:
	ldr	x8, [x8, _R@GOTPAGEOFF]
Lloh48:
	ldr	x8, [x8]
	cmp	w13, #1
	b.lt	LBB0_29
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	lsr	w13, w12, #1
	ldr	x14, [x8, w13, uxtw #3]
	ldr	w15, [x10, x14, lsl #2]
	cmp	w15, w11
	b.le	LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	str	x14, [x8, w12, uxtw #3]
	cmp	w12, #3
	mov	x12, x13
	b.hi	LBB0_27
	b	LBB0_30
LBB0_29:
	mov	x13, x12
LBB0_30:
	str	x9, [x8, w13, sxtw #3]
LBB0_31:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_32:
	mov	w13, #1
	mov	w15, #2
LBB0_33:                                ; =>This Inner Loop Header: Depth=1
	cmp	w15, w8
	b.ge	LBB0_35
; %bb.34:                               ;   in Loop: Header=BB0_33 Depth=1
	sxtw	x14, w15
	orr	x14, x14, #0x1
	ldr	x16, [x12, x14, lsl #3]
	ldr	w16, [x10, x16, lsl #2]
	ldr	x17, [x12, w15, sxtw #3]
	ldr	w17, [x10, x17, lsl #2]
	cmp	w16, w17
	csel	w14, w14, w15, lt
	b	LBB0_36
LBB0_35:                                ;   in Loop: Header=BB0_33 Depth=1
	mov	x14, x15
LBB0_36:                                ;   in Loop: Header=BB0_33 Depth=1
	ldr	x15, [x12, w14, sxtw #3]
	ldr	w16, [x10, x15, lsl #2]
	cmp	w16, w11
	b.ge	LBB0_39
; %bb.37:                               ;   in Loop: Header=BB0_33 Depth=1
	str	x15, [x12, w13, sxtw #3]
	lsl	w15, w14, #1
	mov	x13, x14
	cmp	w15, w8
	b.le	LBB0_33
LBB0_38:
	str	x9, [x12, w14, sxtw #3]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_39:
	str	x9, [x12, w13, sxtw #3]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_R_tot,4,2                      ; @R_tot
	.comm	_R_position,4,2                 ; @R_position
	.comm	_Q_limit,4,2                    ; @Q_limit
	.comm	_R,8,3                          ; @R
	.comm	_Q_order,4,2                    ; @Q_order
	.comm	_R_cnt,4,2                      ; @R_cnt
	.comm	_UserRate,8,3                   ; @UserRate
.subsections_via_symbols
