// File: /workspace/github_cpp_makefile_star2_O1/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 0x2ef8
movq %rsi, %r14
cmpl $-0x1, 0x14(%rsi)
je 0x2ef8
leaq 0x30(%r14), %rsi
leaq 0x118(%rsp), %r15
movq %r15, %rdi
callq 0x3a82
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0xe8(%rsp), %rdi
movl $0x1, %esi
callq 0x1a45
movl 0x14(%r14), %edx
leaq 0x100(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x1bbd
leaq 0x118(%rsp), %rsi
leaq 0x100(%rsp), %rdx
movq %rbx, %rdi
callq 0x1d15
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x2c8c
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x2ca9
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x2cc6
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x3a82
leaq 0x60(%r14), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x3a82
movl 0xc(%r14), %edx
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1bbd
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x1d15
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b48
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2d3f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2d5c
movq 0xc8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2d79
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x2d96
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movl 0x10(%r14), %esi
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0x88(%rsp), %rdi
callq 0x1a45
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x3a82
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x14bd
leaq 0x10(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b48
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2dfc
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x2e16
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x2e33
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x3a82
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x1a45
cvtsi2sdl 0x14(%r14), %xmm0
mulsd %xmm0, %xmm0
cvttsd2si %xmm0, %edx
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bbd
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1d15
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b48
movq (%r14), %rdi
testq %rdi, %rdi
je 0x2eb1
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2ec8
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2edf
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x2f2d
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x2f2d
movq 0x50d9(%rip), %rdi      # 0x7fd8
leaq 0x2125(%rip), %rsi      # 0x502b
movl $0x25, %edx
callq 0x1110
leaq 0x10(%rsp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3b02
movq %rbx, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2f5c
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x2f5c
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2f78
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x2f78
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3039
movq 0x68(%rsp), %rsi
jmp 0x302c
jmp 0x3036
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x2fb7
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x2fb7
movq %rax, %r14
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3039
movq 0x98(%rsp), %rsi
jmp 0x302c
jmp 0x3036
movq %rax, %r14
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2ff5
movq 0xc8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x2ff5
movq %rax, %r14
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x3017
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3017
movq %rax, %r14
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x3039
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3039
movq %rax, %r14
movq (%rbx), %rdi
movq %rbx, %r15
jmp 0x3090
movq %rax, %r14
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x3066
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3066
movq %rax, %r14
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x3088
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3088
movq %rax, %r14
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x30a1
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x1100
movq %r14, %rdi
callq 0x1170
nop