// File: archit-p[P]bulletproofs-demo/src/prover.cpp
// Function: Prover::Prover(int, int, std::vector<int, std::allocator<int>>)
Prover::Prover(int val, int prime, vector <int> gens)
{
    v = val;
    p = prime;
    x = y = z = -1;
    tau[0] = rand()%prime;
    tau[1] = rand()%prime;
    alpha = rand()%prime;
    row = rand()%prime;

    al = get_bit_vector(v);
    ar = get_complement_vector(al);
    n = al.size();

    sl = random_vector(n, 2);
    sr = random_vector(n, 2);

    g = get_gen_vector(gens, n);
    h = get_gen_vector(gens, n);

    a_commit = commit_to(alpha, al, ar);
    s_commit = commit_to(row, sl, sr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rcx, -0x1a0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x168(%rbp)
addq $0x18, %rdi
movq %rdi, -0x198(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x190(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x188(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x180(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rdi
addq $0x78, %rdi
movq %rdi, -0x178(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rdi
addq $0x90, %rdi
movq %rdi, -0x170(%rbp)
callq 0x1b70
movq -0x168(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
callq 0x1030
movl -0x10(%rbp), %ecx
cltd
idivl %ecx
movq -0x168(%rbp), %rax
movl %edx, 0xcc(%rax)
callq 0x1030
movl -0x10(%rbp), %ecx
cltd
idivl %ecx
movq -0x168(%rbp), %rax
movl %edx, 0xd0(%rax)
callq 0x1030
movl -0x10(%rbp), %ecx
cltd
idivl %ecx
movq -0x168(%rbp), %rax
movl %edx, 0xa8(%rax)
callq 0x1030
movl -0x10(%rbp), %ecx
cltd
idivl %ecx
movq -0x168(%rbp), %rax
movl %edx, 0xac(%rax)
movslq 0x8(%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0x2a00
jmp 0x3908
movq -0x168(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x1a8(%rbp)
leaq -0x30(%rbp), %rsi
movq %rsi, -0x1b0(%rbp)
callq 0x5290
movq -0x1b0(%rbp), %rdi
callq 0x1cc0
movq -0x1a8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x52c0
jmp 0x3948
movq -0x168(%rbp), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x3d50
jmp 0x395e
movq -0x168(%rbp), %rdi
addq $0x30, %rdi
leaq -0x58(%rbp), %rsi
movq %rsi, -0x1b8(%rbp)
callq 0x5290
movq -0x1b8(%rbp), %rdi
callq 0x1cc0
leaq -0x70(%rbp), %rdi
callq 0x1cc0
movq -0x168(%rbp), %rdi
addq $0x18, %rdi
callq 0x2450
movq %rax, %rcx
movq -0x168(%rbp), %rax
movl %ecx, (%rax)
movl (%rax), %esi
leaq -0x88(%rbp), %rdi
movl $0x2, %edx
callq 0x2eb0
jmp 0x39bf
movq -0x168(%rbp), %rdi
addq $0x48, %rdi
leaq -0x88(%rbp), %rsi
movq %rsi, -0x1c0(%rbp)
callq 0x5290
movq -0x1c0(%rbp), %rdi
callq 0x1cc0
movq -0x168(%rbp), %rax
movl (%rax), %esi
leaq -0xa0(%rbp), %rdi
movl $0x2, %edx
callq 0x2eb0
jmp 0x3a05
movq -0x168(%rbp), %rdi
addq $0x60, %rdi
leaq -0xa0(%rbp), %rsi
movq %rsi, -0x1c8(%rbp)
callq 0x5290
movq -0x1c8(%rbp), %rdi
callq 0x1cc0
movq -0x1a0(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x52c0
jmp 0x3a44
movq -0x168(%rbp), %rsi
movl (%rsi), %ecx
leaq -0xb8(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x3e10
jmp 0x3a62
movq -0x168(%rbp), %rdi
addq $0x78, %rdi
leaq -0xb8(%rbp), %rsi
movq %rsi, -0x1d0(%rbp)
callq 0x5290
movq -0x1d0(%rbp), %rdi
callq 0x1cc0
leaq -0xd0(%rbp), %rdi
callq 0x1cc0
movq -0x1a0(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x52c0
jmp 0x3aad
movq -0x168(%rbp), %rsi
movl (%rsi), %ecx
leaq -0xe8(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x3e10
jmp 0x3acb
movq -0x168(%rbp), %rdi
addq $0x90, %rdi
leaq -0xe8(%rbp), %rsi
movq %rsi, -0x1e0(%rbp)
callq 0x5290
movq -0x1e0(%rbp), %rdi
callq 0x1cc0
leaq -0x100(%rbp), %rdi
callq 0x1cc0
movq -0x168(%rbp), %rsi
movl 0xa8(%rsi), %eax
movl %eax, -0x1d4(%rbp)
addq $0x18, %rsi
leaq -0x118(%rbp), %rdi
callq 0x52c0
jmp 0x3b29
movq -0x168(%rbp), %rsi
addq $0x30, %rsi
leaq -0x130(%rbp), %rdi
callq 0x52c0
jmp 0x3b42
movl -0x1d4(%rbp), %esi
movq -0x168(%rbp), %rdi
leaq -0x118(%rbp), %rdx
leaq -0x130(%rbp), %rcx
callq 0x3ee0
movl %eax, -0x1e4(%rbp)
jmp 0x3b6a
movq -0x168(%rbp), %rax
movl -0x1e4(%rbp), %ecx
movl %ecx, 0xb0(%rax)
leaq -0x130(%rbp), %rdi
callq 0x1cc0
leaq -0x118(%rbp), %rdi
callq 0x1cc0
movq -0x168(%rbp), %rsi
movl 0xac(%rsi), %eax
movl %eax, -0x1e8(%rbp)
addq $0x48, %rsi
leaq -0x148(%rbp), %rdi
callq 0x52c0
jmp 0x3bba
movq -0x168(%rbp), %rsi
addq $0x60, %rsi
leaq -0x160(%rbp), %rdi
callq 0x52c0
jmp 0x3bd3
movl -0x1e8(%rbp), %esi
movq -0x168(%rbp), %rdi
leaq -0x148(%rbp), %rdx
leaq -0x160(%rbp), %rcx
callq 0x3ee0
movl %eax, -0x1ec(%rbp)
jmp 0x3bfb
movq -0x168(%rbp), %rax
movl -0x1ec(%rbp), %ecx
movl %ecx, 0xb4(%rax)
leaq -0x160(%rbp), %rdi
callq 0x1cc0
leaq -0x148(%rbp), %rdi
callq 0x1cc0
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1cc0
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x1cc0
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x1cc0
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x3cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x1cc0
leaq -0x118(%rbp), %rdi
callq 0x1cc0
jmp 0x3cf7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x3ceb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x1cc0
leaq -0x148(%rbp), %rdi
callq 0x1cc0
movq -0x170(%rbp), %rdi
callq 0x1cc0
movq -0x178(%rbp), %rdi
callq 0x1cc0
movq -0x180(%rbp), %rdi
callq 0x1cc0
movq -0x188(%rbp), %rdi
callq 0x1cc0
movq -0x190(%rbp), %rdi
callq 0x1cc0
movq -0x198(%rbp), %rdi
callq 0x1cc0
movq -0x38(%rbp), %rdi
callq 0x1170
nopl (%rax,%rax)