// File: /workspace/github_c_makefile_star2_O0/luixmao[P]verilog/design.cpp
// Function: Design::dump(std::ostream&)
void Design::dump(ostream &os){
  //module
  os<< "module "<< desname <<"(";
  for(unsigned int i=0; i!=pis.size(); i++){
    os << pis[i] ; 
    if(i!=pis.size()-1 || pos.size()!=0 ){
      os<<",";
    }
  }
  for(unsigned int i=0; i!=pos.size(); i++){
    os << pos[i] ;   
    if(i!=pos.size()-1){
      os<<",";
    }
  }
  os <<"); "<<endl;


  // dump inputs
  for(unsigned int i=0; i!=pis.size(); i++){
    os<< " input " << pis[i] <<";" <<endl; 
  }

  //dump outputs
  for(unsigned int i=0; i!=pos.size(); i++){
    os<< " output " << pos[i] <<";" <<endl; 
  }


  //dump nets
  vector<Net *>* ptr_nets= getWireNets();  
  for(unsigned i =0 ; i!=ptr_nets->size(); i++){
    os << " wire " << ((*ptr_nets)[i])->name() << ';'<<endl;
  }

  //dump gates
  map<string, Gate *>::iterator it_gate;
  for(it_gate=designGates.begin() ; it_gate!=designGates.end(); it_gate++){
    (it_gate->second)->dump(os);
  }

  //dump endmodule
  os<< "endmodule"<<endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x94fa(%rip), %rsi      # 0x10363
callq 0x3220
movq -0x88(%rbp), %rsi
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
leaq 0x9262(%rip), %rsi      # 0x100e9
callq 0x3220
movl $0x0, -0x14(%rbp)
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %eax
movq %rax, -0x90(%rbp)
addq $0x80, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
je 0x6f5e
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
addq $0x80, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x8100
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x3200
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %eax
movq %rax, -0x98(%rbp)
addq $0x80, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0x98(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x6f3e
movq -0x88(%rbp), %rdi
addq $0x98, %rdi
callq 0x80e0
cmpq $0x0, %rax
je 0x6f4e
movq -0x10(%rbp), %rdi
leaq 0x91a2(%rip), %rsi      # 0x100eb
callq 0x3220
jmp 0x6f50
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6e93
movl $0x0, -0x18(%rbp)
movq -0x88(%rbp), %rdi
movl -0x18(%rbp), %eax
movq %rax, -0xa8(%rbp)
addq $0x98, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
je 0x7017
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
addq $0x98, %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x8100
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x3200
movq -0x88(%rbp), %rdi
movl -0x18(%rbp), %eax
movq %rax, -0xb0(%rbp)
addq $0x98, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x7007
movq -0x10(%rbp), %rdi
leaq 0x90e9(%rip), %rsi      # 0x100eb
callq 0x3220
jmp 0x7009
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6f65
movq -0x10(%rbp), %rdi
leaq 0x90cb(%rip), %rsi      # 0x100ed
callq 0x3220
movq %rax, %rdi
movq 0xff8f(%rip), %rsi      # 0x16fc0
callq 0x3270
movl $0x0, -0x1c(%rbp)
movq -0x88(%rbp), %rdi
movl -0x1c(%rbp), %eax
movq %rax, -0xc0(%rbp)
addq $0x80, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
je 0x70d3
movq -0x10(%rbp), %rdi
leaq 0x907d(%rip), %rsi      # 0x100f1
callq 0x3220
movq -0x88(%rbp), %rdi
movq %rax, -0xc8(%rbp)
addq $0x80, %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0x8100
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x3200
movq %rax, %rdi
leaq 0x8fee(%rip), %rsi      # 0x1009f
callq 0x3220
movq %rax, %rdi
movq 0xff00(%rip), %rsi      # 0x16fc0
callq 0x3270
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x703d
movl $0x0, -0x20(%rbp)
movq -0x88(%rbp), %rdi
movl -0x20(%rbp), %eax
movq %rax, -0xd0(%rbp)
addq $0x98, %rdi
callq 0x80e0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
je 0x7170
movq -0x10(%rbp), %rdi
leaq 0x8fe8(%rip), %rsi      # 0x100f9
callq 0x3220
movq -0x88(%rbp), %rdi
movq %rax, -0xd8(%rbp)
addq $0x98, %rdi
movl -0x20(%rbp), %eax
movl %eax, %esi
callq 0x8100
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x3200
movq %rax, %rdi
leaq 0x8f51(%rip), %rsi      # 0x1009f
callq 0x3220
movq %rax, %rdi
movq 0xfe63(%rip), %rsi      # 0x16fc0
callq 0x3270
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x70da
movq -0x88(%rbp), %rdi
callq 0x7310
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5bc0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
je 0x7261
movq -0x10(%rbp), %rdi
leaq 0x8f4a(%rip), %rsi      # 0x10102
callq 0x3220
movq %rax, -0xf8(%rbp)
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x5be0
movq (%rax), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x3830
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x3200
movq %rax, -0xe8(%rbp)
jmp 0x7201
movq -0xe8(%rbp), %rdi
movl $0x3b, %esi
callq 0x32d0
movq %rax, -0x100(%rbp)
jmp 0x721b
movq -0x100(%rbp), %rdi
movq 0xfd97(%rip), %rsi      # 0x16fc0
callq 0x3270
jmp 0x7230
leaq -0x50(%rbp), %rdi
callq 0x3150
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7187
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3150
jmp 0x72fd
leaq -0x68(%rbp), %rdi
callq 0x7e20
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x7e40
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x7ea0
movq %rax, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x7e70
testb $0x1, %al
jne 0x72ad
jmp 0x72d5
leaq -0x68(%rbp), %rdi
callq 0x7ed0
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x7ef0
movq %rax, -0x80(%rbp)
jmp 0x7286
movq -0x10(%rbp), %rdi
leaq 0x8e29(%rip), %rsi      # 0x10109
callq 0x3220
movq %rax, %rdi
movq 0xfcd1(%rip), %rsi      # 0x16fc0
callq 0x3270
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3410
nopw %cs:(%rax,%rax)