// File: /workspace/github_cpp_makefile_star2_O1/Sooryakiran[P]dotV/src/main.cpp
// Function: main
int main(int argc, char * argv[]){
    /*------------------------------------------------------------------------------------------
    Input Validation
    ------------------------------------------------------------------------------------------*/
    if(argc != 5){
        invalid_args(argv[0]);
        return 0;
    }

    if(strcmp(argv[1], "-n") || strcmp(argv[3], "-k")){
        invalid_args(argv[0]);
        return 0;
    }

    string n_str = argv[2];
    string k_str = argv[4];
    int n, k;
    try{
        n = stoi(n_str);
        k = stoi(k_str);
    }
    catch(exception e){
        invalid_args(argv[0]);
        return 0;
    }

    /*------------------------------------------------------------------------------------------
    Create instances of the chips.
    ------------------------------------------------------------------------------------------*/
    WALLACE_TREE_MULTIPLIER_PIPELINED wtm("Sample Adder",
                                         {"input_1", "input_2", "clk"},
                                         "outputs",
                                         n, k);


    /*------------------------------------------------------------------------------------------
    Generate Verilog and write it to file. File save location ./generated_codes/
    ------------------------------------------------------------------------------------------*/
    generate_file("generated_codes/wtm_" + to_string(n) + "_bits_k_" + to_string(k) + ".v", wtm.generate_verilog());
   
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rsi, %r15
cmpl $0x5, %edi
jne 0x26b9
movq 0x8(%r15), %rdi
leaq 0x1a02(%rip), %rsi      # 0x409e
callq 0x21d0
testl %eax, %eax
jne 0x26b9
movq 0x18(%r15), %rdi
leaq 0x19f1(%rip), %rsi      # 0x40a1
callq 0x21d0
testl %eax, %eax
je 0x26d7
movq (%r15), %rdi
callq 0x25a7
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rsi
leaq -0x1d8(%rbp), %rdi
leaq -0x388(%rbp), %rdx
callq 0x304c
movq 0x20(%r15), %rsi
leaq -0x1b8(%rbp), %rdi
leaq -0x388(%rbp), %rdx
callq 0x304c
movq -0x1d8(%rbp), %rbx
callq 0x2040
movq %rax, %r12
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, (%r12)
leaq -0x388(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21e0
cmpq %rbx, (%r13)
je 0x2d74
movq %rax, %r14
movslq %r14d, %rax
cmpq %r14, %rax
jne 0x2d80
movl (%r12), %eax
cmpl $0x22, %eax
je 0x2d80
testl %eax, %eax
jne 0x2769
movl -0x30(%rbp), %eax
movl %eax, (%r12)
movq -0x1b8(%rbp), %r13
movl (%r12), %eax
movl %eax, -0x34(%rbp)
movl $0x0, (%r12)
leaq -0x388(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x21e0
cmpq %r13, (%rbx)
je 0x2d8c
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rcx
cmpq %rdx, %rcx
jb 0x2d98
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x2d98
movq %rax, -0x30(%rbp)
testl %ecx, %ecx
jne 0x27d5
movl -0x34(%rbp), %eax
movl %eax, (%r12)
leaq -0x168(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x18bc(%rip), %rsi      # 0x40a4
leaq 0x18c1(%rip), %rdx      # 0x40b0
leaq -0x178(%rbp), %rdi
callq 0x33e0
leaq -0x128(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x18a4(%rip), %rsi      # 0x40b1
leaq 0x18a4(%rip), %rdx      # 0x40b8
leaq -0x138(%rbp), %r15
movq %r15, %rdi
callq 0x33e0
leaq -0x118(%rbp), %r15
leaq -0x108(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x187d(%rip), %rsi      # 0x40b9
leaq 0x187d(%rip), %rdx      # 0x40c0
movq %r15, %rdi
callq 0x33e0
leaq -0xf8(%rbp), %r15
leaq -0xe8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x185d(%rip), %rsi      # 0x40c1
leaq 0x1859(%rip), %rdx      # 0x40c4
movq %r15, %rdi
callq 0x33e0
leaq -0x1f0(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x58(%rbp), %rcx
movl $0x3, %edx
callq 0x3098
leaq -0x148(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1824(%rip), %rsi      # 0x40c5
leaq 0x1824(%rip), %rdx      # 0x40cc
leaq -0x158(%rbp), %rdi
callq 0x33e0
leaq -0x388(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
leaq -0x158(%rbp), %rcx
movl %r14d, %r8d
movq -0x30(%rbp), %r9
callq 0x2150
movq -0x158(%rbp), %rdi
cmpq %rbx, %rdi
je 0x28f7
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1f0(%rbp), %rdi
callq 0x30e0
movq $-0x60, %rbx
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x291f
movq (%r13), %rsi
incq %rsi
callq 0x2180
addq $-0x20, %r13
addq $0x20, %rbx
jne 0x290a
movq -0x178(%rbp), %rdi
cmpq %r12, %rdi
je 0x2944
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x2180
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x29a4
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x299b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x29a1
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x29a4
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2968
addl $-0x3, %r12d
jmp 0x29a4
addl $-0x2, %r12d
jmp 0x29a4
decl %r12d
shrl $0x1f, %r14d
leal (%r12,%r14), %esi
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0xb8(%rbp), %rdi
movl $0x2d, %edx
callq 0x21b0
movl %r14d, %edi
leaq -0xb8(%rbp), %rbx
addq (%rbx), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x314a
leaq 0x16e6(%rip), %rcx      # 0x40cd
movl $0x14, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
leaq -0x88(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2a26
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x2a2c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x98(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1691(%rip), %rsi      # 0x40e2
callq 0x2290
leaq -0x48(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x30(%rbp), %r13
je 0x2a7e
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x2a84
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0x2afb
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r14d, %ecx
cmpl $0x63, %ecx
jbe 0x2af2
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2af8
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2afb
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2abf
addl $-0x3, %r15d
jmp 0x2afb
addl $-0x2, %r15d
jmp 0x2afb
decl %r15d
shrl $0x1f, %r13d
leal (%r15,%r13), %esi
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x21b0
movl %r13d, %edi
addq -0x78(%rbp), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x314a
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbx, %rcx
je 0x2b4a
movq -0x48(%rbp), %rsi
cmpq %rsi, %rax
leaq -0x128(%rbp), %r14
jbe 0x2b6a
movl $0xf, %esi
cmpq %r12, -0x78(%rbp)
je 0x2b65
movq -0x68(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x2b79
movq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x2070
jmp 0x2b86
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
movq %r14, -0x138(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2bac
movq %rdx, -0x138(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x128(%rbp)
jmp 0x2bb3
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x130(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1512(%rip), %rsi      # 0x40eb
leaq -0x138(%rbp), %rdi
callq 0x2290
leaq -0xc8(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2c12
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0x2c19
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0xd0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x198(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x2050
leaq -0xd8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x23fc
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c78
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c93
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x138(%rbp), %rdi
cmpq %r14, %rdi
je 0x2cae
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2cc3
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2cd8
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2cfa
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x2d1c
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x388(%rbp), %rdi
callq 0x32b8
movl $0x1, %ebx
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d4c
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1c8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26c3
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x26c3
leaq 0x1373(%rip), %rdi      # 0x40ee
callq 0x20e0
leaq 0x1367(%rip), %rdi      # 0x40ee
callq 0x2200
leaq 0x135b(%rip), %rdi      # 0x40ee
callq 0x20e0
leaq 0x134f(%rip), %rdi      # 0x40ee
callq 0x2200
movq %rax, %r14
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2dcb
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2dcb
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2deb
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2deb
movq %rax, %r14
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x2e12
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e12
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2e2c
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e2c
movq %rax, %r14
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2e46
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e46
movq %rax, %r14
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2e6d
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e6d
movq %rax, %r14
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x2e94
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e94
movq %rax, %r14
leaq -0x388(%rbp), %rdi
callq 0x32b8
jmp 0x2f6e
movq %rax, %r14
movq -0x158(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2ec8
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2ec8
movq %rax, %r14
leaq -0x1f0(%rbp), %rdi
callq 0x30e0
jmp 0x2ed9
movq %rax, %r14
xorl %ebx, %ebx
movq -0xf8(%rbp,%rbx), %rdi
leaq (%rbx,%r13), %rax
cmpq %rdi, %rax
je 0x2ef7
movq (%rax), %rsi
incq %rsi
callq 0x2180
addq $-0x20, %rbx
cmpq $-0x60, %rbx
jne 0x2edb
movb $0x1, %al
jmp 0x2f0e
jmp 0x2f09
jmp 0x2f09
movq %rax, %r14
xorl %eax, %eax
leaq -0x138(%rbp), %rcx
cmpq %r15, %rcx
sete %cl
orb %al, %cl
jne 0x2f4e
addq $-0x10, %r15
leaq -0x138(%rbp), %rbx
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2f3e
movq (%r15), %rsi
incq %rsi
callq 0x2180
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %rbx, %r15
movq %rax, %r15
jne 0x2f2a
movq -0x178(%rbp), %rdi
cmpq %r12, %rdi
je 0x2f6e
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2f6e
movq %rax, %r14
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f8d
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1c8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2fac
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2270
movq %rax, %r14
jmp 0x2f8d
movq %rax, %r14
jmp 0x2fac
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x2fde
movl -0x34(%rbp), %eax
jmp 0x2fda
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x2fde
movl -0x30(%rbp), %eax
movl %eax, (%r12)
cmpl $0x1, %edx
jne 0x2f6e
movq %r14, %rdi
callq 0x21c0
movq 0x2fde(%rip), %rax      # 0x5fd0
addq $0x10, %rax
movq %rax, -0x388(%rbp)
movq %r14, %rdi
callq 0x20a0
movq (%r15), %rdi
callq 0x25a7
leaq -0x388(%rbp), %rdi
callq 0x22a0
callq 0x2240
xorl %ebx, %ebx
jmp 0x2d2d
jmp 0x2f6b
movq %rax, %r14
leaq -0x388(%rbp), %rdi
callq 0x22a0
callq 0x2240
jmp 0x2f6e
movq %rax, %rdi
callq 0x3089
nop