// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movl %r8d, %r12d
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0xa690
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa410
leaq 0x80(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa810
leaq 0x98(%rbx), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xa3e0
movl %r12d, 0x190(%rbx)
leaq 0xb38d(%rip), %rsi      # 0x1f6f2
leaq -0x298(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xac60
leaq -0x298(%rbp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xa270
leaq -0x298(%rbp), %rdi
callq 0xa370
leaq 0xb351(%rip), %rsi      # 0x1f6ed
leaq -0x278(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xac60
leaq -0x278(%rbp), %rsi
pushq $0x1
popq %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0xaea0
leaq -0x278(%rbp), %rdi
callq 0xa370
leaq 0xb3c7(%rip), %rsi      # 0x1f79d
leaq -0x258(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xac60
leaq -0x258(%rbp), %rsi
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0xa270
leaq -0x258(%rbp), %rdi
callq 0xa370
leaq 0xb2d7(%rip), %rsi      # 0x1f6e5
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0xac60
leaq -0xa0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
pushq $0x1
popq %rdx
leaq -0x88(%rbp), %rcx
callq 0xa170
leaq -0xd8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xa8f0
leaq -0xa0(%rbp), %rdi
callq 0xa550
leaq -0x68(%rbp), %rdi
callq 0xa370
leaq 0xb339(%rip), %rsi      # 0x1f79d
leaq -0x238(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0xac60
leaq -0x48(%rbp), %rdi
pushq $0x6
popq %rsi
callq 0xa9a0
leaq 0xad7f(%rip), %rsi      # 0x1f209
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0xac40
leaq 0xb253(%rip), %rdx      # 0x1f6f1
leaq -0x218(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa150
leaq -0xd8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x218(%rbp), %rdx
xorl %ecx, %ecx
callq 0xa8b0
leaq -0x218(%rbp), %rdi
callq 0xa370
leaq -0x68(%rbp), %rdi
callq 0xa370
leaq -0x48(%rbp), %rdi
callq 0xa370
leaq -0x238(%rbp), %rdi
callq 0xa370
imull $0x12, 0x190(%rbx), %eax
leaq -0xd8(%rbp), %rsi
movl %eax, (%rsi)
leaq -0x2d0(%rbp), %rdi
callq 0xa3d0
leaq 0x178(%rbx), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0xa130
leaq -0x2d0(%rbp), %rdi
callq 0xaa60
leaq -0x88(%rbp), %rdi
movl %r12d, %esi
callq 0xa9a0
leaq 0xb1cf(%rip), %rsi      # 0x1f714
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0xac40
leaq 0xb036(%rip), %rdx      # 0x1f592
leaq -0x1f8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xa150
leaq -0x68(%rbp), %rdi
leaq -0x1f8(%rbp), %rdx
movq %rbx, %rsi
callq 0xa3f0
leaq 0x20(%rbx), %rdi
leaq -0x68(%rbp), %r13
movq %r13, %rsi
callq 0xa920
movq %r13, %rdi
callq 0xa370
leaq -0x1f8(%rbp), %rdi
callq 0xa370
leaq -0x48(%rbp), %rdi
callq 0xa370
leaq -0x88(%rbp), %rdi
callq 0xa370
leaq -0xf8(%rbp), %rdi
movl %r12d, %esi
callq 0xa9a0
leaq 0xb14d(%rip), %rsi      # 0x1f71b
leaq -0x118(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
callq 0xac40
leaq 0xabde(%rip), %rdx      # 0x1f1c6
leaq -0x138(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xa150
leaq -0x158(%rbp), %rdi
leaq -0x138(%rbp), %rsi
movq %rbx, %rdx
callq 0xaaf0
leaq 0xaa55(%rip), %rdx      # 0x1f06d
leaq -0x178(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xa150
movq %r15, %rdi
xorl %esi, %esi
callq 0xa200
leaq -0x198(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movq %rax, %rdx
callq 0xaaf0
leaq 0xaa1e(%rip), %rdx      # 0x1f070
leaq -0x1b8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0xa150
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0xa200
leaq -0x1d8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
movq %rax, %rdx
callq 0xaaf0
leaq 0xa9e3(%rip), %rdx      # 0x1f070
leaq -0x88(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xa150
movq %r14, %rdi
xorl %esi, %esi
callq 0xa200
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0xaaf0
leaq 0xb04c(%rip), %rdx      # 0x1f710
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xa150
addq $0x40, %rbx
leaq -0x68(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa920
movq %r14, %rdi
callq 0xa370
leaq -0x48(%rbp), %rdi
callq 0xa370
leaq -0x88(%rbp), %rdi
callq 0xa370
leaq -0x1d8(%rbp), %rdi
callq 0xa370
leaq -0x1b8(%rbp), %rdi
callq 0xa370
leaq -0x198(%rbp), %rdi
callq 0xa370
leaq -0x178(%rbp), %rdi
callq 0xa370
leaq -0x158(%rbp), %rdi
callq 0xa370
leaq -0x138(%rbp), %rdi
callq 0xa370
leaq -0x118(%rbp), %rdi
callq 0xa370
leaq -0xf8(%rbp), %rdi
callq 0xa370
leaq -0xd8(%rbp), %rdi
callq 0xaa60
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0xa370
jmp 0x148ac
movq %rax, %r14
jmp 0x148b8
movq %rax, %r14
jmp 0x148d5
movq %rax, %r14
jmp 0x148f2
movq %rax, %r14
jmp 0x148fe
movq %rax, %r14
jmp 0x1490a
movq %rax, %r14
jmp 0x14916
jmp 0x14847
movq %rax, %r14
leaq -0x1f8(%rbp), %rdi
callq 0xa370
jmp 0x147d9
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0xa370
jmp 0x147e7
movq %rax, %r14
leaq -0x88(%rbp), %rdi
jmp 0x1491d
jmp 0x14847
movq %rax, %r14
leaq -0x2d0(%rbp), %rdi
callq 0xaa60
jmp 0x14922
jmp 0x14847
movq %rax, %r14
leaq -0x218(%rbp), %rdi
callq 0xa370
jmp 0x1481f
movq %rax, %r14
leaq -0x68(%rbp), %rdi
callq 0xa370
jmp 0x1482d
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0xa370
jmp 0x1483b
movq %rax, %r14
leaq -0x238(%rbp), %rdi
jmp 0x1491d
movq %rax, %r14
jmp 0x14922
movq %rax, %r14
leaq -0xa0(%rbp), %rdi
callq 0xa550
jmp 0x14863
movq %rax, %r14
leaq -0x68(%rbp), %rdi
jmp 0x1489a
jmp 0x14930
movq %rax, %r14
leaq -0x258(%rbp), %rdi
jmp 0x1489a
jmp 0x14930
movq %rax, %r14
leaq -0x278(%rbp), %rdi
jmp 0x1489a
jmp 0x14930
movq %rax, %r14
leaq -0x298(%rbp), %rdi
callq 0xa370
jmp 0x14933
jmp 0x14930
movq %rax, %r14
leaq -0x88(%rbp), %rdi
callq 0xa370
leaq -0x1d8(%rbp), %rdi
callq 0xa370
jmp 0x148c9
movq %rax, %r14
leaq -0x1b8(%rbp), %rdi
callq 0xa370
leaq -0x198(%rbp), %rdi
callq 0xa370
jmp 0x148e6
movq %rax, %r14
leaq -0x178(%rbp), %rdi
callq 0xa370
leaq -0x158(%rbp), %rdi
callq 0xa370
leaq -0x138(%rbp), %rdi
callq 0xa370
leaq -0x118(%rbp), %rdi
callq 0xa370
leaq -0xf8(%rbp), %rdi
callq 0xa370
leaq -0xd8(%rbp), %rdi
callq 0xaa60
jmp 0x14933
movq %rax, %r14
movq %rbx, %rdi
callq 0xa230
movq %r14, %rdi
callq 0xad00
nop