// File: /workspace/github_c_makefile_star2_O0/open-mesh-mirror[P]batmand/posix/posix.c
// Function: restore_defaults
void restore_defaults(void) {

	struct list_head *if_pos, *if_pos_tmp;
	struct batman_if *batman_if;

	stop = 1;

	if ( routing_class > 0 )
		add_del_interface_rules(RULE_DEL);

	del_gw_interface();

	list_for_each_safe( if_pos, if_pos_tmp, &if_list ) {

		batman_if = list_entry( if_pos, struct batman_if, list );

		deactivate_interface(batman_if);

		list_del( (struct list_head *)&if_list, if_pos, &if_list );
		debugFree( if_pos, 1214 );

	}

	/* delete rule for hna networks */
	add_del_rule(0, 0, BATMAN_RT_TABLE_NETWORKS, BATMAN_RT_PRIO_UNREACH - 1, 0, RULE_TYPE_DST, RULE_DEL);

	/* delete unreachable routing table entry */
	add_del_route(0, 0, 0, 0, 0, "unknown", BATMAN_RT_TABLE_UNREACH, ROUTE_TYPE_UNREACHABLE, ROUTE_DEL);

	if ( ( routing_class != 0 ) && ( curr_gateway != NULL ) )
		del_default_route();

	if ( vis_if.sock )
		close( vis_if.sock );

	if ( unix_if.unix_sock )
		close( unix_if.unix_sock );

	if ( unix_if.listen_thread_id != 0 ) {
		pthread_join( unix_if.listen_thread_id, NULL );
		unix_if.listen_thread_id = 0;
	}

	if ( debug_level == 0 )
		closelog();

	if (policy_routing_script != NULL) {
		close(policy_routing_pipe);
		waitpid(policy_routing_script_pid, NULL, 0);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xb761(%rip), %rax      # 0x1b720
movb $0x1, (%rax)
leaq 0xb391(%rip), %rax      # 0x1b35a
movzbl (%rax), %eax
cmpl $0x0, %eax
jle 0xffdb
movl $0x1, %edi
callq 0xb2f0
callq 0xff40
leaq 0xb3c9(%rip), %rax      # 0x1b3b0
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0xb3b0(%rip), %rax      # 0x1b3b0
cmpq %rax, -0x8(%rbp)
je 0x1004d
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xe930
movq -0x8(%rbp), %rsi
leaq 0xb38e(%rip), %rdx      # 0x1b3b0
movq %rdx, %rdi
callq 0x6ed0
movq -0x8(%rbp), %rdi
movl $0x4be, %esi            # imm = 0x4BE
callq 0x7720
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0xfff9
xorl %esi, %esi
movl $0x41, %edx
movl $0x1a2b, %ecx           # imm = 0x1A2B
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
movl %esi, %edi
movl $0x1, (%rsp)
callq 0xacd0
xorl %r8d, %r8d
leaq 0x5d05(%rip), %r9       # 0x15d81
movl %r8d, %edi
movl %r8d, %esi
movl %r8d, %edx
movl %r8d, %ecx
movl $0x43, (%rsp)
movl $0x2, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0xa420
leaq 0xb2af(%rip), %rax      # 0x1b35a
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x100c5
leaq 0xb2a6(%rip), %rax      # 0x1b360
cmpq $0x0, (%rax)
je 0x100c5
callq 0xfb30
leaq 0xb334(%rip), %rax      # 0x1b400
cmpl $0x0, (%rax)
je 0x100df
leaq 0xb328(%rip), %rax      # 0x1b400
movl (%rax), %edi
callq 0x2210
leaq 0xb3c2(%rip), %rax      # 0x1b4a8
cmpl $0x0, (%rax)
je 0x100f9
leaq 0xb3b6(%rip), %rax      # 0x1b4a8
movl (%rax), %edi
callq 0x2210
leaq 0xb3a8(%rip), %rax      # 0x1b4a8
cmpq $0x0, 0x8(%rax)
je 0x1012a
leaq 0xb39a(%rip), %rax      # 0x1b4a8
movq 0x8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2490
leaq 0xb386(%rip), %rax      # 0x1b4a8
movq $0x0, 0x8(%rax)
leaq 0xb227(%rip), %rax      # 0x1b358
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1013e
callq 0x2060
leaq 0xb233(%rip), %rax      # 0x1b378
cmpq $0x0, (%rax)
je 0x1016d
leaq 0xb22e(%rip), %rax      # 0x1b380
movl (%rax), %edi
callq 0x2210
leaq 0xb2c0(%rip), %rax      # 0x1b420
movl (%rax), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x23c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)