// File: Sooryakiran[P]dotV/src/verilog.cpp
// Function: FLIP_FLOP_N_BIT::FLIP_FLOP_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)
FLIP_FLOP_N_BIT::FLIP_FLOP_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->n_bits = n_bits;
    
    this->declare("A", CHIP_INPUTS);
    this->declare("CLK", CHIP_INPUTS, 1);
    this->declare("OUT", CHIP_OUTPUTS_REG);

    BehaviourModel flipflop({"posedge CLK"});
    flipflop.add("OUT", "#" + to_string(FLIP_FLOP_DELAY) + " A", N_BLOCK);
    flipflop.num_transistors = this->n_bits * FLIP_FLOP_TRANSISTORS;

    this->add_submodule(flipflop);

    this->definition = this->auto_gen("module FLIP_FLOP_" + to_string(n_bits) + "_BIT");
    this->generate = "FLIP_FLOP_" + to_string(n_bits) + "_BIT " + this->name + " (" + this->inputs.at(0) + ", " + this->inputs.at(1) + ", " + this->outputs.at(0) + " );";

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rsi, -0x3e8(%rbp)
movq %rdx, -0x400(%rbp)
movq %rcx, -0x3f8(%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, -0x3f0(%rbp)
callq 0x1c4e0
movq -0x3f0(%rbp), %rdi
movq -0x3e8(%rbp), %rsi
callq 0x1b0b0
jmp 0x2d749
movq -0x400(%rbp), %rsi
movq -0x3f0(%rbp), %rdi
subq $-0x80, %rdi
callq 0x1c9a0
jmp 0x2d762
movq -0x3f8(%rbp), %rsi
movq -0x3f0(%rbp), %rdi
addq $0x98, %rdi
callq 0x1bc10
jmp 0x2d77e
movq -0x3f0(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, 0x190(%rax)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x408(%rbp)
callq 0x1da80
movq -0x408(%rbp), %rdx
leaq 0x19f26(%rip), %rsi     # 0x476d2
leaq -0x58(%rbp), %rdi
callq 0x1d8a0
jmp 0x2d7b7
movq -0x3f0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
xorl %edx, %edx
callq 0x1b740
jmp 0x2d7cb
leaq -0x58(%rbp), %rdi
callq 0x1bea0
leaq -0x59(%rbp), %rdi
callq 0x1ca40
leaq -0x81(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x1da80
movq -0x410(%rbp), %rdx
leaq 0x19ecf(%rip), %rsi     # 0x476cd
leaq -0x80(%rbp), %rdi
callq 0x1d8a0
jmp 0x2d809
movq -0x3f0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x1df40
jmp 0x2d822
leaq -0x80(%rbp), %rdi
callq 0x1bea0
leaq -0x81(%rbp), %rdi
callq 0x1ca40
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x1da80
movq -0x418(%rbp), %rdx
leaq 0x19f25(%rip), %rsi     # 0x4777d
leaq -0xa8(%rbp), %rdi
callq 0x1d8a0
jmp 0x2d866
movq -0x3f0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movl $0x3, %edx
callq 0x1b740
jmp 0x2d880
leaq -0xa8(%rbp), %rdi
callq 0x1bea0
leaq -0xa9(%rbp), %rdi
callq 0x1ca40
movb $0x1, -0x13a(%rbp)
leaq -0x130(%rbp), %rax
movq %rax, -0x428(%rbp)
movq %rax, -0x138(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0x1da80
movq -0x428(%rbp), %rdi
movq -0x420(%rbp), %rdx
leaq 0x19de9(%rip), %rsi     # 0x476c5
callq 0x1d8a0
jmp 0x2d8e3
movb $0x0, -0x13a(%rbp)
leaq -0x130(%rbp), %rax
movq %rax, -0x110(%rbp)
movq $0x1, -0x108(%rbp)
leaq -0x13b(%rbp), %rdi
movq %rdi, -0x430(%rbp)
callq 0x1b490
movq -0x430(%rbp), %rcx
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x100(%rbp), %rdi
callq 0x1b4a0
jmp 0x2d939
leaq -0xe8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x1cce0
jmp 0x2d94e
leaq -0x100(%rbp), %rdi
callq 0x1c100
leaq -0x13b(%rbp), %rdi
callq 0x1b420
leaq -0x130(%rbp), %rax
movq %rax, -0x440(%rbp)
addq $0x20, %rax
movq %rax, -0x438(%rbp)
movq -0x438(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x448(%rbp)
callq 0x1bea0
movq -0x440(%rbp), %rcx
movq -0x448(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x438(%rbp)
jne 0x2d97f
leaq -0x139(%rbp), %rdi
callq 0x1ca40
leaq -0x161(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x1da80
movq -0x450(%rbp), %rdx
leaq 0x19da0(%rip), %rsi     # 0x4777d
leaq -0x160(%rbp), %rdi
callq 0x1d8a0
jmp 0x2d9eb
leaq -0x1c8(%rbp), %rdi
movl $0x6, %esi
callq 0x1ced0
jmp 0x2d9fe
leaq 0x197e4(%rip), %rsi     # 0x471e9
leaq -0x1a8(%rbp), %rdi
leaq -0x1c8(%rbp), %rdx
callq 0x1d820
jmp 0x2da1a
leaq 0x19cb0(%rip), %rdx     # 0x476d1
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x1b430
jmp 0x2da36
leaq -0xe8(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x188(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1cc50
jmp 0x2da54
leaq -0x188(%rbp), %rdi
callq 0x1bea0
leaq -0x1a8(%rbp), %rdi
callq 0x1bea0
leaq -0x1c8(%rbp), %rdi
callq 0x1bea0
leaq -0x160(%rbp), %rdi
callq 0x1bea0
leaq -0x161(%rbp), %rdi
callq 0x1ca40
movq -0x3f0(%rbp), %rax
movl 0x190(%rax), %ecx
addl %ecx, %ecx
movl %ecx, %eax
leal (%rax,%rax,8), %eax
movl %eax, -0xe8(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x1bc00
jmp 0x2dabf
movq -0x3f0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x1d220
jmp 0x2dad4
leaq -0x200(%rbp), %rdi
callq 0x1d1c0
movl -0x24(%rbp), %esi
leaq -0x280(%rbp), %rdi
callq 0x1ced0
jmp 0x2daf1
leaq 0x19bfc(%rip), %rsi     # 0x476f4
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rdx
callq 0x1d820
jmp 0x2db0d
leaq 0x19a5e(%rip), %rdx     # 0x47572
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x1b430
jmp 0x2db29
movq -0x3f0(%rbp), %rsi
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rdx
callq 0x1bc40
jmp 0x2db45
movq -0x3f0(%rbp), %rdi
addq $0x20, %rdi
leaq -0x220(%rbp), %rsi
movq %rsi, -0x458(%rbp)
callq 0x1cd30
movq -0x458(%rbp), %rdi
callq 0x1bea0
leaq -0x240(%rbp), %rdi
callq 0x1bea0
leaq -0x260(%rbp), %rdi
callq 0x1bea0
leaq -0x280(%rbp), %rdi
callq 0x1bea0
movl -0x24(%rbp), %esi
leaq -0x3e0(%rbp), %rdi
callq 0x1ced0
jmp 0x2dba4
leaq 0x19b50(%rip), %rsi     # 0x476fb
leaq -0x3c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rdx
callq 0x1d820
jmp 0x2dbc0
leaq 0x195df(%rip), %rdx     # 0x471a6
leaq -0x3a0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0x1b430
jmp 0x2dbdc
movq -0x3f0(%rbp), %rdx
leaq -0x380(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x1d3b0
jmp 0x2dbf8
leaq 0x1944e(%rip), %rdx     # 0x4704d
leaq -0x360(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x1b430
jmp 0x2dc14
movq -0x3f0(%rbp), %rdi
subq $-0x80, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x460(%rbp)
jmp 0x2dc31
movq -0x460(%rbp), %rdx
leaq -0x340(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x1d3b0
jmp 0x2dc4d
leaq 0x193fc(%rip), %rdx     # 0x47050
leaq -0x320(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x1b430
jmp 0x2dc69
movq -0x3f0(%rbp), %rdi
subq $-0x80, %rdi
movl $0x1, %esi
callq 0x1b640
movq %rax, -0x468(%rbp)
jmp 0x2dc87
movq -0x468(%rbp), %rdx
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x1d3b0
jmp 0x2dca3
leaq 0x193a6(%rip), %rdx     # 0x47050
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x1b430
jmp 0x2dcbf
movq -0x3f0(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b640
movq %rax, -0x470(%rbp)
jmp 0x2dcdf
movq -0x470(%rbp), %rdx
leaq -0x2c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x1d3b0
jmp 0x2dcfb
leaq 0x199ee(%rip), %rdx     # 0x476f0
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x1b430
jmp 0x2dd17
movq -0x3f0(%rbp), %rdi
addq $0x40, %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x1cd30
leaq -0x2a0(%rbp), %rdi
callq 0x1bea0
leaq -0x2c0(%rbp), %rdi
callq 0x1bea0
leaq -0x2e0(%rbp), %rdi
callq 0x1bea0
leaq -0x300(%rbp), %rdi
callq 0x1bea0
leaq -0x320(%rbp), %rdi
callq 0x1bea0
leaq -0x340(%rbp), %rdi
callq 0x1bea0
leaq -0x360(%rbp), %rdi
callq 0x1bea0
leaq -0x380(%rbp), %rdi
callq 0x1bea0
leaq -0x3a0(%rbp), %rdi
callq 0x1bea0
leaq -0x3c0(%rbp), %rdi
callq 0x1bea0
leaq -0x3e0(%rbp), %rdi
callq 0x1bea0
leaq -0xe8(%rbp), %rdi
callq 0x1d1c0
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2ddfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1bea0
leaq -0x59(%rbp), %rdi
callq 0x1ca40
jmp 0x2e18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2de2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1bea0
leaq -0x81(%rbp), %rdi
callq 0x1ca40
jmp 0x2e18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2de63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1bea0
leaq -0xa9(%rbp), %rdi
callq 0x1ca40
jmp 0x2e18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2df00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2dea8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x1c100
leaq -0x13b(%rbp), %rdi
callq 0x1b420
leaq -0x130(%rbp), %rax
movq %rax, -0x480(%rbp)
addq $0x20, %rax
movq %rax, -0x478(%rbp)
movq -0x478(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x488(%rbp)
callq 0x1bea0
movq -0x480(%rbp), %rcx
movq -0x488(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x478(%rbp)
jne 0x2decd
jmp 0x2df00
leaq -0x139(%rbp), %rdi
callq 0x1ca40
testb $0x1, -0x13a(%rbp)
jne 0x2df17
jmp 0x2df64
movq -0x138(%rbp), %rax
leaq -0x130(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x490(%rbp)
je 0x2df62
movq -0x490(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x498(%rbp)
callq 0x1bea0
movq -0x498(%rbp), %rax
leaq -0x130(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x490(%rbp)
jne 0x2df31
jmp 0x2df64
jmp 0x2e18a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2dfdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2dfd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2dfc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2dfb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x1bea0
leaq -0x1a8(%rbp), %rdi
callq 0x1bea0
leaq -0x1c8(%rbp), %rdi
callq 0x1bea0
leaq -0x160(%rbp), %rdi
callq 0x1bea0
leaq -0x161(%rbp), %rdi
callq 0x1ca40
jmp 0x2e17e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e17e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x1d1c0
jmp 0x2e17e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e05c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e050
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x1bea0
leaq -0x260(%rbp), %rdi
callq 0x1bea0
leaq -0x280(%rbp), %rdi
callq 0x1bea0
jmp 0x2e17e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e172
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e166
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e15a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e14e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e142
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e136
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e12a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e11e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2e112
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x1bea0
leaq -0x2e0(%rbp), %rdi
callq 0x1bea0
leaq -0x300(%rbp), %rdi
callq 0x1bea0
leaq -0x320(%rbp), %rdi
callq 0x1bea0
leaq -0x340(%rbp), %rdi
callq 0x1bea0
leaq -0x360(%rbp), %rdi
callq 0x1bea0
leaq -0x380(%rbp), %rdi
callq 0x1bea0
leaq -0x3a0(%rbp), %rdi
callq 0x1bea0
leaq -0x3c0(%rbp), %rdi
callq 0x1bea0
leaq -0x3e0(%rbp), %rdi
callq 0x1bea0
leaq -0xe8(%rbp), %rdi
callq 0x1d1c0
movq -0x3f0(%rbp), %rdi
callq 0x1b6d0
movq -0x30(%rbp), %rdi
callq 0x1da60
nop