// File: /workspace/github_cpp_makefile_star2_O1/archit-p[P]bulletproofs-demo/src/inner_product_arg.cpp
// Function: InnerProdArg::generate_argument()
void InnerProdArg::generate_argument()
{
    vector <int> a_l, a_r, b_l, b_r, a_prime, b_prime, to_send;
    int x_inv = modInverse(x, order);
    cout << "x_inv value is :" << x_inv << endl;
    int c_prime; 
    while(a.size() > 1) {
        get_half(a, a_l, a_r);
        get_half(b, b_l, b_r);

        a_prime = vector_sum(k_product_vector(a_l, x, order), k_product_vector(a_r, x_inv, order), order);
        b_prime = vector_sum(k_product_vector(b_l, x_inv), k_product_vector(b_r, x), order);
        c_prime = inner_product(a_prime, b_prime, order);
        
        a.clear();
        b.clear();

        a = a_prime;
        b = b_prime;

        to_send.push_back(c_prime);
    }

    to_send.push_back(a[0]);
    to_send.push_back(b[0]);
    
    final_arg = serialize(to_send);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
xorl %eax, %eax
movq %rax, 0xf0(%rsp)
movq %rax, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movq %rax, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movq %rax, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movq %rax, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x38(%rdi), %esi
movl 0x40(%rdi), %edi
callq 0x1684
movl %eax, %ebp
movq 0x41ae(%rip), %rdi      # 0x7fd8
leaq 0x126f(%rip), %rsi      # 0x50a0
movl $0x10, %edx
callq 0x1110
movq 0x4196(%rip), %rdi      # 0x7fd8
movl %ebp, %esi
callq 0x1150
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq (%rbx), %rdx
movq 0x8(%rbx), %rax
subq %rdx, %rax
cmpq $0x5, %rax
jb 0x4220
leaq 0x18(%rbx), %r14
leaq 0x190(%rsp), %r15
movq %rbx, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x1898
movq %r14, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x1898
leaq 0x1d8(%rsp), %r13
movq %r13, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3a82
movl 0x38(%rbx), %ecx
movl 0x40(%rbx), %edx
leaq 0x130(%rsp), %rdi
movq %r13, %rsi
callq 0x1c10
movq %r15, %r12
leaq 0x1a8(%rsp), %r13
movq %r13, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x3a82
movl 0x38(%rbx), %ecx
leaq 0x1c0(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x1c10
movl 0x38(%rbx), %ecx
leaq 0x20(%rsp), %rdi
leaq 0x130(%rsp), %rsi
movq %r15, %rdx
callq 0x1dc0
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x20(%rsp), %rax
movq %rax, 0x60(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
movq %r12, %r15
je 0x3f7b
subq %rdi, %rsi
callq 0x1100
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3f92
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x3faf
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x3fcc
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x3fe9
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x4006
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %r15, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3a82
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x1bbd
leaq 0x160(%rsp), %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3a82
movl 0x40(%rbx), %edx
leaq 0x178(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1bbd
movl 0x38(%rbx), %ecx
leaq 0x20(%rsp), %rdi
leaq 0x118(%rsp), %rsi
movq %r13, %rdx
callq 0x1dc0
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, 0x48(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x40aa
subq %rdi, %rsi
callq 0x1100
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x40c1
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x40de
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x40fb
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x4118
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x4135
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x100(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3a82
leaq 0x148(%rsp), %r12
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
callq 0x3a82
movl 0x38(%rbx), %edx
leaq 0x100(%rsp), %rdi
movq %r12, %rsi
callq 0x158a
movl %eax, 0x1c(%rsp)
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x4190
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x41ad
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x41ba
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x41c8
movq %rax, 0x20(%rbx)
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x45ca
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x45ca
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x41ff
movl 0x1c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x420c
movq %rsp, %rdi
leaq 0x1c(%rsp), %rdx
callq 0x1f62
movq (%rbx), %rdx
movq 0x8(%rbx), %rax
subq %rdx, %rax
cmpq $0x4, %rax
ja 0x3e93
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x423b
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x4243
movq %rsp, %rdi
callq 0x1f62
movq 0x18(%rbx), %rdx
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x4262
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x426a
movq %rsp, %rdi
callq 0x1f62
leaq 0x1f0(%rsp), %rdi
movq %rsp, %rsi
callq 0x3a82
movq 0x1f0(%rsp), %r14
movq 0x1f8(%rsp), %r15
movq %r15, %rdi
subq %r14, %rdi
callq 0x1120
movq %rax, %r12
subq %r14, %r15
je 0x42bb
sarq $0x2, %r15
cmpq $0x1, %r15
adcq $0x0, %r15
shlq $0x2, %r15
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x10a0
movq %r12, 0x30(%rbx)
testq %r14, %r14
je 0x42d7
movq 0x200(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x1100
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x42ed
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4304
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x431b
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4338
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4355
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x4372
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x438f
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4500
jmp 0x4500
jmp 0x4500
movq %rax, %rbx
jmp 0x4419
movq %rax, %rbx
jmp 0x43fc
movq %rax, %rbx
jmp 0x43df
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x43df
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x43fc
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x4419
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x4503
movq 0x1e8(%rsp), %rsi
jmp 0x44f6
jmp 0x4500
movq %rax, %rbx
jmp 0x44a5
movq %rax, %rbx
jmp 0x4488
movq %rax, %rbx
jmp 0x446b
movq %rax, %rbx
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x446b
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x4488
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x44a5
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x4503
movq 0x1a0(%rsp), %rsi
jmp 0x44f6
movq %rax, %rbx
jmp 0x44e1
movq %rax, %rbx
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x44e1
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x4503
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x4503
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4519
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x4530
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x4547
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4564
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4581
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x459e
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x45bb
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x1170
nop