// File: /workspace/github_cpp_makefile_star2_O3/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 0x302f
movq %rsi, %r14
cmpl $-0x1, 0x14(%rsi)
je 0x302f
leaq 0x30(%r14), %rsi
leaq 0x118(%rsp), %r15
movq %r15, %rdi
callq 0x3bb8
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0xe8(%rsp), %rdi
movl $0x1, %esi
callq 0x1a25
movl 0x14(%r14), %edx
leaq 0x100(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x1ba1
leaq 0x118(%rsp), %rsi
leaq 0x100(%rsp), %rdx
movq %rbx, %rdi
callq 0x1cff
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x2d40
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x2d5d
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x2d7a
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x3bb8
leaq 0x60(%r14), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x3bb8
movl 0xc(%r14), %edx
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1ba1
leaq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x1cff
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movapd 0x10(%rsp), %xmm0
movupd %xmm0, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x2e1f
subq %rdi, %rsi
callq 0x1100
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2e1f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2e3c
movq 0xc8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x2e59
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x2e76
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 0x1a25
leaq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x3bb8
leaq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x1499
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movapd 0x10(%rsp), %xmm0
movupd %xmm0, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x2f08
subq %rdi, %rsi
callq 0x1100
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2f08
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x2f22
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x2f3f
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x3bb8
movq 0x38(%r14), %rdx
subq 0x30(%r14), %rdx
shrq $0x2, %rdx
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0x1a25
xorps %xmm0, %xmm0
cvtsi2sdl 0x14(%r14), %xmm0
mulsd %xmm0, %xmm0
cvttsd2si %xmm0, %edx
leaq 0x40(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1ba1
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1cff
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x2fe8
subq %rdi, %rsi
callq 0x1100
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2fe8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x2fff
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3016
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3064
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3064
movq 0x4fa2(%rip), %rdi      # 0x7fd8
leaq 0x1ffa(%rip), %rsi      # 0x5037
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 0x3c38
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 0x3093
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3093
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x30af
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x30af
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3170
movq 0x68(%rsp), %rsi
jmp 0x3163
jmp 0x316d
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x30ee
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x30ee
movq %rax, %r14
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3170
movq 0x98(%rsp), %rsi
jmp 0x3163
jmp 0x316d
movq %rax, %r14
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x312c
movq 0xc8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x312c
movq %rax, %r14
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x314e
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x314e
movq %rax, %r14
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x3170
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x3170
movq %rax, %r14
movq (%rbx), %rdi
movq %rbx, %r15
jmp 0x31c7
movq %rax, %r14
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x319d
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x319d
movq %rax, %r14
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x31bf
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x31bf
movq %rax, %r14
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x31d8
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x1100
movq %r14, %rdi
callq 0x1170