// File: /workspace/github_cpp_makefile_star2_O2/archit-p[P]bulletproofs-demo/src/prover.cpp
// Function: Prover::calc_r()
vector <int> Prover::calc_r()
{
    if(x == -1 || z == -1) {
        cout << "Set the x and z values before calling";
        return {-1};
    }
    vector <int> ret = vector_sum(ar, k_product_vector(get_k_vector(1, ar.size()), z));
    ret = vector_sum(ret, k_product_vector(sr, x));
    ret = haderson_product(get_k_vector(y, ar.size()),ret);
    ret = vector_sum(ret, k_product_vector(get_k_vector(2, ar.size()), (int)pow(z, 2))); 
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rdi, %rbx
cmpl $-0x1, 0xc(%rsi)
je 0x27d4
movq %rsi, %r14
cmpl $-0x1, 0x14(%rsi)
je 0x27d4
leaq 0x30(%r14), %rsi
leaq 0x118(%rsp), %r15
movq %r15, %rdi
callq 0x2f60
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0xe8(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x187d
movl 0x14(%r14), %edx
leaq 0x100(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x1959
leaq 0x118(%rsp), %rsi
leaq 0x100(%rsp), %rdx
movq %rbx, %rdi
callq 0x1a6f
leaq 0x100(%rsp), %rdi
callq 0x15ce
leaq 0xe8(%rsp), %rdi
callq 0x15ce
leaq 0x118(%rsp), %rdi
callq 0x15ce
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x2f60
leaq 0x60(%r14), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x2f60
movl 0xc(%r14), %edx
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1959
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x1a6f
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2fe4
movq %r15, %rdi
callq 0x15ce
leaq 0xb8(%rsp), %rdi
callq 0x15ce
leaq 0xa0(%rsp), %rdi
callq 0x15ce
leaq 0xd0(%rsp), %rdi
callq 0x15ce
movl 0x10(%r14), %esi
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0x88(%rsp), %rdi
callq 0x187d
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x2f60
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x13da
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2fe4
movq %r15, %rdi
callq 0x15ce
leaq 0x70(%rsp), %rdi
callq 0x15ce
leaq 0x88(%rsp), %rdi
callq 0x15ce
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x2f60
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0x28(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x187d
cvtsi2sdl 0x14(%r14), %xmm0
mulsd %xmm0, %xmm0
cvttsd2si %xmm0, %edx
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1959
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1a6f
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2fe4
movq %r14, %rdi
callq 0x15ce
leaq 0x40(%rsp), %rdi
callq 0x15ce
leaq 0x28(%rsp), %rdi
callq 0x15ce
leaq 0x58(%rsp), %rdi
callq 0x15ce
jmp 0x27ff
movq 0x47fd(%rip), %rdi      # 0x6fd8
leaq 0x1849(%rip), %rsi      # 0x402b
callq 0x10e0
leaq 0x10(%rsp), %rsi
orl $-0x1, (%rsi)
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0x2fae
movq %rbx, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x15ce
jmp 0x2821
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x15ce
jmp 0x2830
movq %rax, %r14
leaq 0x58(%rsp), %rdi
jmp 0x2886
jmp 0x288d
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x15ce
jmp 0x284b
movq %rax, %r14
leaq 0x88(%rsp), %rdi
jmp 0x2886
jmp 0x288d
movq %rax, %r14
leaq 0xb8(%rsp), %rdi
callq 0x15ce
jmp 0x286c
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x15ce
jmp 0x287e
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
callq 0x15ce
jmp 0x2890
movq %rax, %r14
movq %rbx, %r15
movq %r15, %rdi
callq 0x15ce
movq %r14, %rdi
callq 0x1160
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x15ce
jmp 0x28b8
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0x15ce
jmp 0x2893
movq %rax, %r14
jmp 0x2893