// File: gauravtewari[P]netlist/netlist.cpp
// Function: circuit::add_input_edge(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int circuit::add_input_edge(string &str){
	if(str.empty())
		return -1;

	/* Add the input edge to edge map */
	edge_map[str]=num_nets;
	
	/* Create a new struct net node for this edge */
	struct net temp;
	temp.id = num_nets;
	temp.weight = 0;
	temp.type = INPUT_NET;
	temp.gates = list<u32>();
	net_list.push_back(temp);
	
	/* Add an input gate in the gate_list with an entry in the nets for above input net */
	struct gate gtemp;
	gtemp.id = num_gates;
	gtemp.type = get_gate_type("INPUT");
	gtemp.fan_out = 0;
	gtemp.fan_in = 0;
	gtemp.nets.push_back(temp.id);
	gate_list.push_back(gtemp);
	
	/* Update the bookkeeping data structures */
	num_nets++;
	num_gates++;
	gate_type[gtemp.type]++;
	net_type[temp.type]++;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x23a0
testb $0x1, %al
jne 0x555d
jmp 0x5569
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5799
movq -0xc8(%rbp), %rdi
movl 0x4(%rdi), %eax
movl %eax, -0xdc(%rbp)
addq $0xc0, %rdi
movq -0x18(%rbp), %rsi
callq 0x6a30
movl -0xdc(%rbp), %ecx
movl %ecx, (%rax)
leaq -0x40(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x6940
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x6b10
movq -0xd8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6b30
movq -0xd8(%rbp), %rdi
callq 0x42c0
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
addq $0xa8, %rdi
callq 0x6b60
jmp 0x5613
leaq -0x98(%rbp), %rdi
callq 0x6bd0
jmp 0x5621
movq -0xc8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x98(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x23d0
movq -0xe8(%rbp), %rdx
leaq 0x5a3e(%rip), %rsi      # 0xb08f
leaq -0xb8(%rbp), %rdi
callq 0x34f0
jmp 0x565f
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5c30
movl %eax, -0xec(%rbp)
jmp 0x567a
movl -0xec(%rbp), %eax
movl %eax, -0x94(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x2170
leaq -0xb9(%rbp), %rdi
callq 0x2280
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x6900
jmp 0x56c4
movq -0xc8(%rbp), %rdi
addq $0x90, %rdi
leaq -0x98(%rbp), %rsi
callq 0x6c40
jmp 0x56e0
movq -0xc8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl -0x94(%rbp), %ecx
movl 0x8(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x38(%rbp), %ecx
movl 0x2c(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x2c(%rax,%rcx,4)
movl $0x0, -0x4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4740
leaq -0x40(%rbp), %rdi
callq 0x42a0
jmp 0x5799
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x578e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5768
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x2170
leaq -0xb9(%rbp), %rdi
callq 0x2280
jmp 0x5782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4740
leaq -0x40(%rbp), %rdi
callq 0x42a0
jmp 0x57a5
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x23c0
nop