// File: /workspace/github_cpp_makefile_star2_O3/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 0x1666
movl %eax, %ebp
movq 0x40ca(%rip), %rdi      # 0x7fd8
leaq 0x118b(%rip), %rsi      # 0x50a0
movl $0x10, %edx
callq 0x1110
movq 0x40b2(%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 0x4304
leaq 0x18(%rbx), %r14
leaq 0x190(%rsp), %r15
movq %rbx, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x1878
movq %r14, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x1878
leaq 0x1d8(%rsp), %r13
movq %r13, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3bb8
movl 0x38(%rbx), %ecx
movl 0x40(%rbx), %edx
leaq 0x130(%rsp), %rdi
movq %r13, %rsi
callq 0x1bf4
movq %r15, %r12
leaq 0x1a8(%rsp), %r13
movq %r13, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x3bb8
movl 0x38(%rbx), %ecx
leaq 0x1c0(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x1bf4
movl 0x38(%rbx), %ecx
leaq 0x20(%rsp), %rdi
leaq 0x130(%rsp), %rsi
movq %r15, %rdx
callq 0x1db0
movq 0x60(%rsp), %rdi
movq 0x70(%rsp), %rsi
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
movq %r12, %r15
je 0x4076
subq %rdi, %rsi
callq 0x1100
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x4076
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x4093
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x40b0
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x40cd
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x40ea
movq 0x1e8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %r15, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3bb8
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x1ba1
leaq 0x160(%rsp), %r12
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3bb8
movl 0x40(%rbx), %edx
leaq 0x178(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1ba1
movl 0x38(%rbx), %ecx
leaq 0x20(%rsp), %rdi
leaq 0x118(%rsp), %rsi
movq %r13, %rdx
callq 0x1db0
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
movaps 0x20(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x41a5
subq %rdi, %rsi
callq 0x1100
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x41a5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x41c2
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x41df
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x41fc
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x4219
movq 0x1a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
leaq 0x100(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x3bb8
leaq 0x148(%rsp), %r12
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
callq 0x3bb8
movl 0x38(%rbx), %edx
leaq 0x100(%rsp), %rdi
movq %r12, %rsi
callq 0x156c
movl %eax, 0x1c(%rsp)
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x4274
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x4291
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x429e
movq %rax, 0x8(%rbx)
movq 0x18(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x42ac
movq %rax, 0x20(%rbx)
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x46b4
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x46b4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x42e3
movl 0x1c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x42f0
movq %rsp, %rdi
leaq 0x1c(%rsp), %rdx
callq 0x1f5e
movq (%rbx), %rdx
movq 0x8(%rbx), %rax
subq %rdx, %rax
cmpq $0x4, %rax
ja 0x3f77
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
cmpq %rax, %rsi
je 0x4322
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x4334
movq %rsp, %rdi
callq 0x1f5e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movq 0x18(%rbx), %rdx
cmpq %rax, %rsi
je 0x434c
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x4354
movq %rsp, %rdi
callq 0x1f5e
leaq 0x1f0(%rsp), %rdi
movq %rsp, %rsi
callq 0x3bb8
movq 0x1f0(%rsp), %r14
movq 0x1f8(%rsp), %r15
movq %r15, %rdi
subq %r14, %rdi
callq 0x1120
movq %rax, %r12
subq %r14, %r15
je 0x43a5
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 0x43c1
movq 0x200(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x1100
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x43d7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x43ee
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x4405
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4422
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x443f
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x445c
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x4479
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 0x45ea
jmp 0x45ea
jmp 0x45ea
movq %rax, %rbx
jmp 0x4503
movq %rax, %rbx
jmp 0x44e6
movq %rax, %rbx
jmp 0x44c9
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
testq %rdi, %rdi
je 0x44c9
movq 0x1d0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x44e6
movq 0x1b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x4503
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x45ed
movq 0x1e8(%rsp), %rsi
jmp 0x45e0
jmp 0x45ea
movq %rax, %rbx
jmp 0x458f
movq %rax, %rbx
jmp 0x4572
movq %rax, %rbx
jmp 0x4555
movq %rax, %rbx
movq 0x178(%rsp), %rdi
testq %rdi, %rdi
je 0x4555
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x4572
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x458f
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x190(%rsp), %rdi
testq %rdi, %rdi
je 0x45ed
movq 0x1a0(%rsp), %rsi
jmp 0x45e0
movq %rax, %rbx
jmp 0x45cb
movq %rax, %rbx
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x45cb
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x45ed
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
jmp 0x45ed
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4603
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x461a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x4631
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x464e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x466b
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x4688
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x46a5
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x1100
movq %rbx, %rdi
callq 0x1170
nop