// File: /workspace/github_cpp_makefile_star2_O3/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 0x26b0
movq 0x8(%r15), %rax
cmpb $0x2d, (%rax)
jne 0x26b0
cmpb $0x6e, 0x1(%rax)
jne 0x26b0
cmpb $0x0, 0x2(%rax)
jne 0x26b0
movq 0x18(%r15), %rax
cmpb $0x2d, (%rax)
jne 0x26b0
cmpb $0x6b, 0x1(%rax)
jne 0x26b0
cmpb $0x0, 0x2(%rax)
je 0x26ce
movq (%r15), %rdi
callq 0x2597
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 0x303a
movq 0x20(%r15), %rsi
leaq -0x1b8(%rbp), %rdi
leaq -0x388(%rbp), %rdx
callq 0x303a
movq -0x1d8(%rbp), %rbx
callq 0x2040
movq %rax, %r12
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl $0x0, (%r12)
leaq -0x388(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21d0
cmpq %rbx, (%r13)
je 0x2d61
movslq %eax, %rcx
movq %rax, -0x30(%rbp)
cmpq %rax, %rcx
jne 0x2d6d
movl (%r12), %r14d
cmpl $0x22, %r14d
je 0x2d6d
testl %r14d, %r14d
jne 0x2764
movl -0x38(%rbp), %r14d
movl %r14d, (%r12)
movq -0x1b8(%rbp), %r13
movl $0x0, (%r12)
leaq -0x388(%rbp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
movl $0xa, %edx
callq 0x21d0
cmpq %r13, (%rbx)
je 0x2d79
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rcx
cmpq %rdx, %rcx
jb 0x2d85
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x2d85
movq %rax, -0x38(%rbp)
testl %ecx, %ecx
jne 0x27c6
movl %r14d, (%r12)
leaq -0x168(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x18c6(%rip), %rsi      # 0x409e
leaq 0x18cb(%rip), %rdx      # 0x40aa
leaq -0x178(%rbp), %rdi
callq 0x33d8
leaq -0x108(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x18ae(%rip), %rsi      # 0x40ab
leaq 0x18ae(%rip), %rdx      # 0x40b2
leaq -0x118(%rbp), %r15
movq %r15, %rdi
callq 0x33d8
leaq -0xf8(%rbp), %r12
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1887(%rip), %rsi      # 0x40b3
leaq 0x1887(%rip), %rdx      # 0x40ba
movq %r12, %rdi
callq 0x33d8
leaq -0xd8(%rbp), %r12
leaq -0xc8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1867(%rip), %rsi      # 0x40bb
leaq 0x1863(%rip), %rdx      # 0x40be
movq %r12, %rdi
callq 0x33d8
leaq -0x1f0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x58(%rbp), %rcx
movl $0x3, %edx
callq 0x3086
leaq -0x148(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x182e(%rip), %rsi      # 0x40bf
leaq 0x182e(%rip), %rdx      # 0x40c6
leaq -0x158(%rbp), %rdi
callq 0x33d8
leaq -0x388(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
leaq -0x158(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x2150
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x28e8
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1f0(%rbp), %rdi
callq 0x30ce
movq $-0x60, %r14
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x2910
movq (%r13), %rsi
incq %rsi
callq 0x2180
addq $-0x20, %r13
addq $0x20, %r14
jne 0x28fb
movq -0x178(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2935
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x30(%rbp), %rbx
movl %ebx, %r15d
negl %r15d
cmovsl %ebx, %r15d
movl $0x1, %r12d
cmpl $0xa, %r15d
jb 0x2999
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0x2990
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2996
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2999
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x295d
addl $-0x3, %r12d
jmp 0x2999
addl $-0x2, %r12d
jmp 0x2999
decl %r12d
shrl $0x1f, %ebx
leal (%r12,%rbx), %esi
leaq -0x128(%rbp), %r13
movq %r13, -0x10(%r13)
leaq -0x138(%rbp), %rdi
movl $0x2d, %edx
callq 0x21b0
movl %ebx, %edi
leaq -0x138(%rbp), %rbx
addq (%rbx), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x313b
leaq 0x16ed(%rip), %rcx      # 0x40c7
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 0x2a19
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x2a1f
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 0x1698(%rip), %rsi      # 0x40dc
callq 0x2280
leaq -0x48(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x38(%rbp), %rbx
je 0x2a71
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x2a77
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %ebx, %r14d
negl %r14d
cmovsl %ebx, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0x2aee
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r14d, %ecx
cmpl $0x63, %ecx
jbe 0x2ae5
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x2aeb
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x2aee
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x2ab2
addl $-0x3, %r15d
jmp 0x2aee
addl $-0x2, %r15d
jmp 0x2aee
decl %r15d
shrl $0x1f, %ebx
leal (%r15,%rbx), %esi
leaq -0x68(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x21b0
movl %ebx, %edi
addq -0x78(%rbp), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x313b
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
leaq -0x48(%rbp), %rbx
cmpq %rbx, %rcx
je 0x2b3f
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rsi
cmpq %rdi, %rax
leaq -0x108(%rbp), %r14
jbe 0x2b62
movl $0xf, %edi
cmpq %r12, %rsi
je 0x2b5d
movq -0x68(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x2b6d
leaq -0x58(%rbp), %rdi
callq 0x2070
jmp 0x2b7a
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
movq %r14, -0x118(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2ba0
movq %rdx, -0x118(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x108(%rbp)
jmp 0x2ba7
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x110(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x1518(%rip), %rsi      # 0x40e5
leaq -0x118(%rbp), %rdi
callq 0x2280
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2c06
movq %rdx, -0xb8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa8(%rbp)
jmp 0x2c0d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0xb0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x198(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x2050
leaq -0xb8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x23ec
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c6c
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c87
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x118(%rbp), %rdi
cmpq %r14, %rdi
je 0x2ca2
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2cb7
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x58(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2ccc
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2cee
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x138(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d09
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x388(%rbp), %rdi
callq 0x32b0
movl $0x1, %ebx
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d39
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1c8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26ba
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x26ba
leaq 0x1380(%rip), %rdi      # 0x40e8
callq 0x20e0
leaq 0x1374(%rip), %rdi      # 0x40e8
callq 0x21f0
leaq 0x1368(%rip), %rdi      # 0x40e8
callq 0x20e0
leaq 0x135c(%rip), %rdi      # 0x40e8
callq 0x21f0
movq %rax, -0x30(%rbp)
leaq -0x188(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2dba
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2dba
movq %rax, -0x30(%rbp)
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ddb
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2ddb
movq %rax, -0x30(%rbp)
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x2e03
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e03
movq %rax, -0x30(%rbp)
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2e1e
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e1e
movq %rax, -0x30(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2e3d
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e3d
movq %rax, -0x30(%rbp)
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2e65
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e65
movq %rax, -0x30(%rbp)
movq -0x138(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e86
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2e86
movq %rax, -0x30(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x32b0
jmp 0x2f51
movq %rax, -0x30(%rbp)
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x2ebc
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2ebc
movq %rax, -0x30(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x30ce
jmp 0x2ece
movq %rax, -0x30(%rbp)
xorl %r14d, %r14d
movq -0xd8(%rbp,%r14), %rdi
leaq (%r14,%r13), %rax
cmpq %rdi, %rax
je 0x2eed
movq (%rax), %rsi
incq %rsi
callq 0x2180
addq $-0x20, %r14
cmpq $-0x60, %r14
jne 0x2ed1
jmp 0x2f30
jmp 0x2efb
movq %rax, -0x30(%rbp)
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x2f19
movq (%r12), %rsi
incq %rsi
callq 0x2180
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x2f03
jmp 0x2f30
movq %rax, -0x30(%rbp)
movq -0x178(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2f51
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2f51
movq %rax, -0x30(%rbp)
leaq -0x1a8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f70
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x2180
leaq -0x1c8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f8f
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x30(%rbp), %rdi
callq 0x2260
movq %rax, -0x30(%rbp)
jmp 0x2f70
movq %rax, -0x30(%rbp)
jmp 0x2f8f
movq %rax, -0x30(%rbp)
cmpl $0x0, (%r12)
jne 0x2fc7
movl %r14d, (%r12)
jmp 0x2fc7
movq %rax, -0x30(%rbp)
cmpl $0x0, (%r12)
jne 0x2fc7
movl -0x38(%rbp), %eax
movl %eax, (%r12)
cmpl $0x1, %edx
jne 0x2f51
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x21c0
movq 0x2ff1(%rip), %rax      # 0x5fd0
addq $0x10, %rax
movq %rax, -0x388(%rbp)
movq %rbx, %rdi
callq 0x20a0
movq (%r15), %rdi
callq 0x2597
leaq -0x388(%rbp), %rdi
callq 0x2290
callq 0x2230
xorl %ebx, %ebx
jmp 0x2d1a
jmp 0x2f4d
movq %rax, -0x30(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x2290
callq 0x2230
jmp 0x2f51
movq %rax, %rdi
callq 0x3077
nop