// File: Sooryakiran[P]dotV/src/verilog.cpp
// Function: NAND::NAND(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>>)
NAND::NAND(string name, vector<wire> input_wires, wire output_wire){
    this->name = name;
    this->inputs = input_wires;
    this->outputs.push_back(output_wire);
    this->transistors = NAND_TRANSISTORS;
    this->definition = "module NAND_GATE(a, b, c);\n"
                    "\t input a, b;\n"
                    "\t output c;\n"
                    "\t assign #" + to_string(NAND_DELAY) + "  c = ~(a & b);\n"
                    "endmodule";

    this->generate = "NAND_GATE " + this->name + " (" + this->inputs.at(0) + ", " + this->inputs.at(1) + ", " + this->outputs.at(0) + ");";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rsi, -0x198(%rbp)
movq %rdx, -0x1b0(%rbp)
movq %rcx, -0x1a8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x1c4e0
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0x1b0b0
jmp 0x22d85
movq -0x1b0(%rbp), %rsi
movq -0x1a0(%rbp), %rdi
subq $-0x80, %rdi
callq 0x1c9a0
jmp 0x22d9e
movq -0x1a8(%rbp), %rsi
movq -0x1a0(%rbp), %rdi
addq $0x98, %rdi
callq 0x1bc10
jmp 0x22dba
movq -0x1a0(%rbp), %rax
movl $0x4, 0x60(%rax)
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
callq 0x1ced0
jmp 0x22ddb
leaq 0x24533(%rip), %rsi     # 0x47315
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x1d820
jmp 0x22df4
leaq 0x2455a(%rip), %rdx     # 0x47355
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1b430
jmp 0x22e0a
movq -0x1a0(%rbp), %rdi
addq $0x20, %rdi
leaq -0x50(%rbp), %rsi
movq %rsi, -0x1b8(%rbp)
callq 0x1cd30
movq -0x1b8(%rbp), %rdi
callq 0x1bea0
leaq -0x70(%rbp), %rdi
callq 0x1bea0
leaq -0x90(%rbp), %rdi
callq 0x1bea0
movq -0x1a0(%rbp), %rdx
leaq 0x2451b(%rip), %rsi     # 0x4736f
leaq -0x190(%rbp), %rdi
callq 0x1c5a0
jmp 0x22e62
leaq 0x241e4(%rip), %rdx     # 0x4704d
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x1b430
jmp 0x22e7e
movq -0x1a0(%rbp), %rdi
subq $-0x80, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x1c0(%rbp)
jmp 0x22e9b
movq -0x1c0(%rbp), %rdx
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x1d3b0
jmp 0x22eb7
leaq 0x24192(%rip), %rdx     # 0x47050
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1b430
jmp 0x22ed3
movq -0x1a0(%rbp), %rdi
subq $-0x80, %rdi
movl $0x1, %esi
callq 0x1b640
movq %rax, -0x1c8(%rbp)
jmp 0x22ef1
movq -0x1c8(%rbp), %rdx
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x1d3b0
jmp 0x22f0d
leaq 0x2413c(%rip), %rdx     # 0x47050
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1b430
jmp 0x22f29
movq -0x1a0(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x1d0(%rbp)
jmp 0x22f49
movq -0x1d0(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1d3b0
jmp 0x22f65
leaq 0x24785(%rip), %rdx     # 0x476f1
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1b430
jmp 0x22f81
movq -0x1a0(%rbp), %rdi
addq $0x40, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1cd30
leaq -0xb0(%rbp), %rdi
callq 0x1bea0
leaq -0xd0(%rbp), %rdi
callq 0x1bea0
leaq -0xf0(%rbp), %rdi
callq 0x1bea0
leaq -0x110(%rbp), %rdi
callq 0x1bea0
leaq -0x130(%rbp), %rdi
callq 0x1bea0
leaq -0x150(%rbp), %rdi
callq 0x1bea0
leaq -0x170(%rbp), %rdi
callq 0x1bea0
leaq -0x190(%rbp), %rdi
callq 0x1bea0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x23100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x23035
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1bea0
leaq -0x90(%rbp), %rdi
callq 0x1bea0
jmp 0x23100
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x230b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x1bea0
leaq -0xf0(%rbp), %rdi
callq 0x1bea0
leaq -0x110(%rbp), %rdi
callq 0x1bea0
leaq -0x130(%rbp), %rdi
callq 0x1bea0
leaq -0x150(%rbp), %rdi
callq 0x1bea0
leaq -0x170(%rbp), %rdi
callq 0x1bea0
leaq -0x190(%rbp), %rdi
callq 0x1bea0
movq -0x1a0(%rbp), %rdi
callq 0x1b6d0
movq -0x28(%rbp), %rdi
callq 0x1da60
nopw %cs:(%rax,%rax)