// File: Sooryakiran[P]dotV/src/verilog.cpp
// Function: OR_N_BIT::OR_N_BIT(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
OR_N_BIT::OR_N_BIT(string name, vector<wire> input_wires, wire output_wire, int n_bits){
    this->name = name;
    this->inputs = input_wires;
    this->outputs.push_back(output_wire);
    this->transistors = OR_TRANSISTORS*n_bits;
    this->n_bits = n_bits;

    string array_def = "[" + to_string(n_bits -1) + ":0]";
    this->definition = "module OR_GATE_" + to_string(n_bits) + "_BIT(a, b, c);\n"
                       "\t input " + array_def + " a, b;\n"
                       "\t output " + array_def + " c;\n"
                       "\t assign #" + to_string(OR_DELAY) + "  c = a | b;\n"
                       "endmodule";    

    this->generate =  "OR_GATE_" + to_string(this->n_bits) + "_BIT " + this->name + + " (" + this->inputs.at(0) + ", " + this->inputs.at(1) + ", " + this->outputs.at(0) + ");";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
movq %rsi, -0x340(%rbp)
movq %rdx, -0x358(%rbp)
movq %rcx, -0x350(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x1c4e0
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rsi
callq 0x1b0b0
jmp 0x22639
movq -0x358(%rbp), %rsi
movq -0x348(%rbp), %rdi
subq $-0x80, %rdi
callq 0x1c9a0
jmp 0x22652
movq -0x350(%rbp), %rsi
movq -0x348(%rbp), %rdi
addq $0x98, %rdi
callq 0x1bc10
jmp 0x2266e
movq -0x348(%rbp), %rax
movl -0x24(%rbp), %edx
addl %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %ecx, 0x60(%rax)
movl -0x24(%rbp), %ecx
movl %ecx, 0x190(%rax)
movl -0x24(%rbp), %esi
decl %esi
leaq -0x98(%rbp), %rdi
callq 0x1ced0
jmp 0x2269e
leaq 0x24aee(%rip), %rsi     # 0x47193
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x1d820
jmp 0x226b7
leaq 0x24b43(%rip), %rdx     # 0x47201
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1b430
jmp 0x226cd
leaq -0x78(%rbp), %rdi
callq 0x1bea0
leaq -0x98(%rbp), %rdi
callq 0x1bea0
movl -0x24(%rbp), %esi
leaq -0x1b8(%rbp), %rdi
callq 0x1ced0
jmp 0x226f3
leaq 0x24c0b(%rip), %rsi     # 0x47305
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rdx
callq 0x1d820
jmp 0x2270f
leaq 0x24b00(%rip), %rdx     # 0x47216
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x1b430
jmp 0x2272b
leaq -0x158(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x1d3b0
jmp 0x22744
leaq 0x24ae3(%rip), %rdx     # 0x4722e
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x1b430
jmp 0x22760
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x1d3b0
jmp 0x22779
leaq 0x24a5c(%rip), %rdx     # 0x471dc
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x1b430
jmp 0x22795
leaq -0x1d8(%rbp), %rdi
movl $0x2, %esi
callq 0x1ced0
jmp 0x227a8
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x1c460
jmp 0x227c4
leaq 0x24b23(%rip), %rdx     # 0x472ee
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x1b430
jmp 0x227e0
movq -0x348(%rbp), %rdi
addq $0x20, %rdi
leaq -0xb8(%rbp), %rsi
movq %rsi, -0x360(%rbp)
callq 0x1cd30
movq -0x360(%rbp), %rdi
callq 0x1bea0
leaq -0xd8(%rbp), %rdi
callq 0x1bea0
leaq -0x1d8(%rbp), %rdi
callq 0x1bea0
leaq -0xf8(%rbp), %rdi
callq 0x1bea0
leaq -0x118(%rbp), %rdi
callq 0x1bea0
leaq -0x138(%rbp), %rdi
callq 0x1bea0
leaq -0x158(%rbp), %rdi
callq 0x1bea0
leaq -0x178(%rbp), %rdi
callq 0x1bea0
leaq -0x198(%rbp), %rdi
callq 0x1bea0
leaq -0x1b8(%rbp), %rdi
callq 0x1bea0
movq -0x348(%rbp), %rax
movl 0x190(%rax), %esi
leaq -0x338(%rbp), %rdi
callq 0x1ced0
jmp 0x22891
leaq 0x24a74(%rip), %rsi     # 0x4730c
leaq -0x318(%rbp), %rdi
leaq -0x338(%rbp), %rdx
callq 0x1d820
jmp 0x228ad
leaq 0x248f2(%rip), %rdx     # 0x471a6
leaq -0x2f8(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x1b430
jmp 0x228c9
movq -0x348(%rbp), %rdx
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x1d3b0
jmp 0x228e5
leaq 0x24761(%rip), %rdx     # 0x4704d
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x1b430
jmp 0x22901
movq -0x348(%rbp), %rdi
subq $-0x80, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x368(%rbp)
jmp 0x2291e
movq -0x368(%rbp), %rdx
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x1d3b0
jmp 0x2293a
leaq 0x2470f(%rip), %rdx     # 0x47050
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x1b430
jmp 0x22956
movq -0x348(%rbp), %rdi
subq $-0x80, %rdi
movl $0x1, %esi
callq 0x1b640
movq %rax, -0x370(%rbp)
jmp 0x22974
movq -0x370(%rbp), %rdx
leaq -0x258(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x1d3b0
jmp 0x22990
leaq 0x246b9(%rip), %rdx     # 0x47050
leaq -0x238(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x1b430
jmp 0x229ac
movq -0x348(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x378(%rbp)
jmp 0x229cc
movq -0x378(%rbp), %rdx
leaq -0x218(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x1d3b0
jmp 0x229e8
leaq 0x24d02(%rip), %rdx     # 0x476f1
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x1b430
jmp 0x22a04
movq -0x348(%rbp), %rdi
addq $0x40, %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x1cd30
leaq -0x1f8(%rbp), %rdi
callq 0x1bea0
leaq -0x218(%rbp), %rdi
callq 0x1bea0
leaq -0x238(%rbp), %rdi
callq 0x1bea0
leaq -0x258(%rbp), %rdi
callq 0x1bea0
leaq -0x278(%rbp), %rdi
callq 0x1bea0
leaq -0x298(%rbp), %rdi
callq 0x1bea0
leaq -0x2b8(%rbp), %rdi
callq 0x1bea0
leaq -0x2d8(%rbp), %rdi
callq 0x1bea0
leaq -0x2f8(%rbp), %rdi
callq 0x1bea0
leaq -0x318(%rbp), %rdi
callq 0x1bea0
leaq -0x338(%rbp), %rdi
callq 0x1bea0
leaq -0x58(%rbp), %rdi
callq 0x1bea0
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22d1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22ae5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x1bea0
leaq -0x98(%rbp), %rdi
callq 0x1bea0
jmp 0x22d1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22d11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22bef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22be3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22bd7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22bcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22bbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22bb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22b9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x1bea0
leaq -0x1d8(%rbp), %rdi
callq 0x1bea0
leaq -0xf8(%rbp), %rdi
callq 0x1bea0
leaq -0x118(%rbp), %rdi
callq 0x1bea0
leaq -0x138(%rbp), %rdi
callq 0x1bea0
leaq -0x158(%rbp), %rdi
callq 0x1bea0
leaq -0x178(%rbp), %rdi
callq 0x1bea0
leaq -0x198(%rbp), %rdi
callq 0x1bea0
leaq -0x1b8(%rbp), %rdi
callq 0x1bea0
jmp 0x22d11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22d05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22cf9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22ced
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22ce1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22cd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22cc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22cbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22cb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x22ca5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x1bea0
leaq -0x238(%rbp), %rdi
callq 0x1bea0
leaq -0x258(%rbp), %rdi
callq 0x1bea0
leaq -0x278(%rbp), %rdi
callq 0x1bea0
leaq -0x298(%rbp), %rdi
callq 0x1bea0
leaq -0x2b8(%rbp), %rdi
callq 0x1bea0
leaq -0x2d8(%rbp), %rdi
callq 0x1bea0
leaq -0x2f8(%rbp), %rdi
callq 0x1bea0
leaq -0x318(%rbp), %rdi
callq 0x1bea0
leaq -0x338(%rbp), %rdi
callq 0x1bea0
leaq -0x58(%rbp), %rdi
callq 0x1bea0
movq -0x348(%rbp), %rdi
callq 0x1b6d0
movq -0x30(%rbp), %rdi
callq 0x1da60
nop