// File: /workspace/github_c_makefile_star2_O0/luixmao[P]verilog/design.cpp
// Function: Design::addFindGate(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Gate* Design::addFindGate(int gtype, string n){
  Gate* ptr;
  map<string, Gate *>::iterator it_gate;
  it_gate=designGates.find(n);
  if(it_gate!= designGates.end() ){
    return it_gate->second;
  }
  else{
    if(gtype == AND){
      ptr = new And(n);
      designGates[n]=ptr;
    }
    else if(gtype == OR){
      ptr = new Or(n);
      designGates[n]=ptr;
    }
    else if(gtype == NAND){
      ptr = new Nand(n);
      designGates[n]=ptr;
    }
    else if(gtype == NOR){
      ptr = new Nor(n);
      designGates[n]=ptr;
    }
    else if(gtype == XOR){
      ptr = new Xor(n);
      designGates[n]=ptr;
    }
    else if(gtype == NOT){
      ptr = new Not(n);
      designGates[n]=ptr;
    }
    else{
      cout << " error in gate type " <<endl;
      return NULL;
    }
  }
return ptr; // return pointer to new gate
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdx, -0x148(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x7e20
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdi
addq $0x50, %rdi
callq 0x80b0
movq -0x140(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x50, %rdi
callq 0x7ea0
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7e70
testb $0x1, %al
jne 0x73ab
jmp 0x73c1
leaq -0x30(%rbp), %rdi
callq 0x7ed0
movq 0x20(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x7932
cmpl $0x0, -0x14(%rbp)
jne 0x748e
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x150(%rbp)
movb $0x1, -0x6d(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3100
jmp 0x73f2
movq -0x150(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4c80
jmp 0x7404
movq -0x150(%rbp), %rax
movb $0x0, -0x6d(%rbp)
movq %rax, -0x28(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x158(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x158(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x7928
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3150
testb $0x1, -0x6d(%rbp)
jne 0x7478
jmp 0x7489
movq -0x150(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
cmpl $0x1, -0x14(%rbp)
jne 0x7570
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x160(%rbp)
movb $0x1, -0x91(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3100
jmp 0x74c5
movq -0x160(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4f10
jmp 0x74da
movq -0x160(%rbp), %rax
movb $0x0, -0x91(%rbp)
movq %rax, -0x28(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x168(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x168(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x7926
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x754f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3150
testb $0x1, -0x91(%rbp)
jne 0x755a
jmp 0x756b
movq -0x160(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
cmpl $0x2, -0x14(%rbp)
jne 0x7652
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x170(%rbp)
movb $0x1, -0xb9(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3100
jmp 0x75a7
movq -0x170(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5430
jmp 0x75bc
movq -0x170(%rbp), %rax
movb $0x0, -0xb9(%rbp)
movq %rax, -0x28(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x178(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x178(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x7924
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7631
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3150
testb $0x1, -0xb9(%rbp)
jne 0x763c
jmp 0x764d
movq -0x170(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
cmpl $0x3, -0x14(%rbp)
jne 0x7734
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x180(%rbp)
movb $0x1, -0xe1(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3100
jmp 0x7689
movq -0x180(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x51a0
jmp 0x769e
movq -0x180(%rbp), %rax
movb $0x0, -0xe1(%rbp)
movq %rax, -0x28(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x188(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x188(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x7922
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7713
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3150
testb $0x1, -0xe1(%rbp)
jne 0x771e
jmp 0x772f
movq -0x180(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
cmpl $0x4, -0x14(%rbp)
jne 0x7816
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x190(%rbp)
movb $0x1, -0x109(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3100
jmp 0x776b
movq -0x190(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x56c0
jmp 0x7780
movq -0x190(%rbp), %rax
movb $0x0, -0x109(%rbp)
movq %rax, -0x28(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x198(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x198(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x7920
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x77f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x3150
testb $0x1, -0x109(%rbp)
jne 0x7800
jmp 0x7811
movq -0x190(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
cmpl $0x5, -0x14(%rbp)
jne 0x78f2
movl $0x40, %edi
callq 0x3230
movq -0x148(%rbp), %rsi
movq %rax, -0x1a0(%rbp)
movb $0x1, -0x131(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3100
jmp 0x784d
movq -0x1a0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x5960
jmp 0x7862
movq -0x1a0(%rbp), %rax
movb $0x0, -0x131(%rbp)
movq %rax, -0x28(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3150
movq -0x140(%rbp), %rdi
movq -0x148(%rbp), %rsi
movq -0x28(%rbp), %rax
movq %rax, -0x1a8(%rbp)
addq $0x50, %rdi
callq 0x8120
movq -0x1a8(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x791e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x78d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3150
testb $0x1, -0x131(%rbp)
jne 0x78df
jmp 0x78f0
movq -0x1a0(%rbp), %rdi
movl $0x40, %esi
callq 0x3240
jmp 0x793f
movq 0xf6d7(%rip), %rdi      # 0x16fd0
leaq 0x8813(%rip), %rsi      # 0x10113
callq 0x3220
movq %rax, %rdi
movq 0xf6b1(%rip), %rsi      # 0x16fc0
callq 0x3270
movq $0x0, -0x8(%rbp)
jmp 0x7932
jmp 0x7920
jmp 0x7922
jmp 0x7924
jmp 0x7926
jmp 0x7928
jmp 0x792a
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3410
nopl (%rax,%rax)