LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/profile.c
// Function: prof_print
void prof_print(void) {

	int32_t index;

	debug_output( 5, " \nProfile data:\n" );

	for ( index = 0; index < PROF_COUNT; index++ ) {

		debug_output( 5, "   %30s: cpu time = %10.3f, calls = %10"PRId64", avg time per call = %4.10f \n", prof_container[index].name, (float)prof_container[index].total_time/CLOCKS_PER_SEC, prof_container[index].calls, ( prof_container[index].calls == 0 ? 0.0 : ( ( (float)prof_container[index].total_time/CLOCKS_PER_SEC ) / (float)prof_container[index].calls ) ) );

	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xa19b(%rip), %rsi      # 0x10a70
movl $0x5, %edi
xorl %eax, %eax
callq 0xd5b0
movl $0x18, %r14d
leaq 0x10c12(%rip), %r15     # 0x17500
leaq 0xa18c(%rip), %rbx      # 0x10a81
xorps %xmm0, %xmm0
cvtsi2ssq -0x10(%r14,%r15), %xmm0
divss 0xa165(%rip), %xmm0     # 0x10a6c
movq (%r14,%r15), %rcx
movq %rcx, %rdx
shrq %rdx
movl %ecx, %eax
andl $0x1, %eax
orq %rdx, %rax
testq %rcx, %rcx
js 0x6928
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
jmp 0x6934
xorps %xmm2, %xmm2
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
xorps %xmm1, %xmm1
je 0x6944
movaps %xmm0, %xmm1
divss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movq -0x8(%r14,%r15), %rdx
movl $0x5, %edi
movq %rbx, %rsi
movb $0x2, %al
callq 0xd5b0
addq $0x20, %r14
cmpq $0x138, %r14            # imm = 0x138
jne 0x68f5
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/ring_buffer.c
// Function: ring_buffer_avg
uint8_t ring_buffer_avg(uint8_t tq_recv[])
{
	uint8_t *ptr;
	uint16_t count = 0, i = 0;
	uint32_t sum = 0;

	ptr = tq_recv;

	while (i < global_win_size) {

		if (*ptr != 0) {
			count++;
			sum += *ptr;
		}

		i++;
		ptr++;

	}

	if (count == 0)
		return 0;

	return (uint8_t)(sum / count);
}

// Assembly:
leaq 0x10902(%rip), %rax     # 0x17296
movzbl (%rax), %ecx
testq %rcx, %rcx
je 0x69bc
xorl %esi, %esi
xorl %eax, %eax
xorl %edx, %edx
movzbl (%rdi,%rsi), %r8d
addl %r8d, %eax
cmpl $0x1, %r8d
sbbw $-0x1, %dx
incq %rsi
cmpw %si, %cx
jne 0x69a2
jmp 0x69c0
xorl %edx, %edx
xorl %eax, %eax
testw %dx, %dx
je 0x69cd
movzwl %dx, %ecx
xorl %edx, %edx
divl %ecx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_init
void hna_init(void)
{
	/* hna local */
	INIT_LIST_HEAD_FIRST(hna_list);
	INIT_LIST_HEAD_FIRST(hna_chg_list);

	pthread_mutex_init(&hna_chg_list_mutex, NULL);

	/* hna global */
	hna_global_hash = hash_new(128, compare_hna, choose_hna);

	if (hna_global_hash == NULL) {
		printf("Error - Could not create hna_global_hash (out of memory?)\n");
		exit(EXIT_FAILURE);
	}
}

// Assembly:
pushq %rax
leaq 0x10c58(%rip), %rax     # 0x17630
movq %rax, 0x10c51(%rip)     # 0x17630
movq %rax, 0x10c52(%rip)     # 0x17638
leaq 0x10c53(%rip), %rax     # 0x17640
movq %rax, 0x10c4c(%rip)     # 0x17640
movq %rax, 0x10c4d(%rip)     # 0x17648
leaq 0x10c4e(%rip), %rdi     # 0x17650
xorl %esi, %esi
callq 0x24a0
leaq 0x35(%rip), %rsi        # 0x6a45
leaq 0x43(%rip), %rdx        # 0x6a5a
movl $0x80, %edi
callq 0x6518
movq %rax, 0x10c50(%rip)     # 0x17678
testq %rax, %rax
je 0x6a2f
popq %rax
retq
leaq 0xa33d(%rip), %rdi      # 0x10d73
callq 0x20c0
movl $0x1, %edi
callq 0x2440
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: choose_hna
static int choose_hna(void *data, int32_t size)
{
	unsigned char *key= data;
	uint32_t hash = 0;
	size_t i;

	for (i = 0; i < 5; i++) {
		hash += key[i];
		hash += (hash << 10);
		hash ^= (hash >> 6);
	}

	hash += (hash << 3);
	hash ^= (hash >> 11);
	hash += (hash << 15);

	return (hash % size);
}

// Assembly:
xorl %eax, %eax
xorl %ecx, %ecx
movzbl (%rdi,%rax), %edx
addl %ecx, %edx
movl %edx, %r8d
shll $0xa, %r8d
addl %edx, %r8d
movl %r8d, %ecx
shrl $0x6, %ecx
xorl %r8d, %ecx
incq %rax
cmpq $0x5, %rax
jne 0x6a5e
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xf, %eax
addl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_local_task_add_ip
void hna_local_task_add_ip(uint32_t ip_addr, uint16_t netmask, uint8_t route_action)
{
	struct hna_task *hna_task;

	hna_task = debugMalloc(sizeof(struct hna_task), 701);
	memset(hna_task, 0, sizeof(struct hna_task));
	INIT_LIST_HEAD(&hna_task->list);

	hna_task->addr = ip_addr;
	hna_task->netmask = netmask;
	hna_task->route_action = route_action;

	if (pthread_mutex_lock(&hna_chg_list_mutex) != 0)
		debug_output(0, "Error - could not lock hna_chg_list mutex in %s(): %s \n", __func__, strerror(errno));

	list_add_tail(&hna_task->list, &hna_chg_list);

	if (pthread_mutex_unlock(&hna_chg_list_mutex) != 0)
		debug_output(0, "Error - could not unlock hna_chg_list mutex in %s(): %s \n", __func__, strerror(errno));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movl $0x10, %edi
movl $0x2bd, %esi            # imm = 0x2BD
callq 0x5d3e
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, (%rax)
movl %r15d, 0x8(%rax)
movb %r14b, 0xc(%rax)
movb %bpl, 0xd(%rax)
leaq 0x10b7b(%rip), %rdi     # 0x17650
callq 0x24c0
testl %eax, %eax
je 0x6b04
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x9fef(%rip), %rsi      # 0x10ae0
leaq 0xa020(%rip), %rdx      # 0x10b18
xorl %edi, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0xd5b0
leaq 0x10b35(%rip), %rsi     # 0x17640
movq %rbx, %rdi
callq 0x5bb9
leaq 0x10b36(%rip), %rdi     # 0x17650
callq 0x22d0
testl %eax, %eax
je 0x6b53
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x9ff8(%rip), %rsi      # 0x10b2e
leaq 0x9fdb(%rip), %rdx      # 0x10b18
xorl %edi, %edi
movq %rax, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd5b0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_local_task_add_str
void hna_local_task_add_str(char *hna_string, uint8_t route_action, uint8_t runtime)
{
	struct in_addr tmp_ip_holder;
	uint16_t netmask;
	char *slash_ptr;

	if ((slash_ptr = strchr(hna_string, '/')) == NULL) {

		if (runtime) {
			debug_output(3, "Invalid announced network (netmask is missing): %s\n", hna_string);
			return;
		}

		printf("Invalid announced network (netmask is missing): %s\n", hna_string);
		exit(EXIT_FAILURE);
	}

	*slash_ptr = '\0';

	if (inet_pton(AF_INET, hna_string, &tmp_ip_holder) < 1) {

		*slash_ptr = '/';

		if (runtime) {
			debug_output(3, "Invalid announced network (IP is invalid): %s\n", hna_string);
			return;
		}

		printf("Invalid announced network (IP is invalid): %s\n", hna_string);
		exit(EXIT_FAILURE);
	}

	errno = 0;
	netmask = strtol(slash_ptr + 1, NULL, 10);

	if ((errno == ERANGE) || (errno != 0 && netmask == 0)) {

		*slash_ptr = '/';

		if (runtime)
			return;

		perror("strtol");
		exit(EXIT_FAILURE);
	}

	if (netmask < 1 || netmask > 32) {

		*slash_ptr = '/';

		if (runtime) {
			debug_output(3, "Invalid announced network (netmask is invalid): %s\n", hna_string);
			return;
		}

		printf("Invalid announced network (netmask is invalid): %s\n", hna_string);
		exit(EXIT_FAILURE);
	}

	*slash_ptr = '/';

	tmp_ip_holder.s_addr = (tmp_ip_holder.s_addr & htonl(0xFFFFFFFF << (32 - netmask)));
	hna_local_task_add_ip(tmp_ip_holder.s_addr, netmask, route_action);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x2180
testq %rax, %rax
je 0x6bdf
movq %rax, %r15
movb $0x0, (%rax)
leaq 0xc(%rsp), %rdx
movl $0x2, %edi
movq %rbx, %rsi
callq 0x22a0
testl %eax, %eax
jle 0x6c0a
callq 0x2070
movq %rax, %r12
movl $0x0, (%rax)
movq %r15, %rdi
incq %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x2280
movl (%r12), %edx
cmpl $0x22, %edx
je 0x6bd1
movzwl %ax, %ecx
testl %edx, %edx
je 0x6c36
testl %ecx, %ecx
jne 0x6c36
movb $0x2f, (%r15)
testb %r14b, %r14b
jne 0x6c29
callq 0x2aa2
testb %r14b, %r14b
je 0x6c71
leaq 0x9f79(%rip), %rsi      # 0x10b68
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd5b0
movb $0x2f, (%r15)
testb %r14b, %r14b
je 0x6c7a
leaq 0x9f82(%rip), %rsi      # 0x10b9c
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xd5b0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leal -0x21(%rcx), %edx
movb $0x2f, (%r15)
cmpl $-0x21, %edx
ja 0x6c50
testb %r14b, %r14b
je 0x6c95
leaq 0x9f84(%rip), %rsi      # 0x10bd2
jmp 0x6c1a
negb %cl
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
shll %cl, %edi
bswapl %edi
andl 0xc(%rsp), %edi
movl %edi, 0xc(%rsp)
movzwl %ax, %esi
movzbl %bpl, %edx
callq 0x6a98
jmp 0x6c29
leaq 0x9ef0(%rip), %rdi      # 0x10b68
jmp 0x6c81
leaq 0x9f1b(%rip), %rdi      # 0x10b9c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2190
movl $0x1, %edi
callq 0x2440
leaq 0x9f36(%rip), %rdi      # 0x10bd2
jmp 0x6c81
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_local_update_routes
void hna_local_update_routes(struct hna_local_entry *hna_local_entry, int8_t route_action)
{
	/* add / delete throw routing entries for own hna */
	add_del_route(hna_local_entry->addr, hna_local_entry->netmask, 0, 0, 0, "unknown", BATMAN_RT_TABLE_NETWORKS, ROUTE_TYPE_THROW, route_action);
	add_del_route(hna_local_entry->addr, hna_local_entry->netmask, 0, 0, 0, "unknown", BATMAN_RT_TABLE_HOSTS, ROUTE_TYPE_THROW, route_action);
	add_del_route(hna_local_entry->addr, hna_local_entry->netmask, 0, 0, 0, "unknown", BATMAN_RT_TABLE_UNREACH, ROUTE_TYPE_THROW, route_action);
	add_del_route(hna_local_entry->addr, hna_local_entry->netmask, 0, 0, 0, "unknown", BATMAN_RT_TABLE_TUNNEL, ROUTE_TYPE_THROW, route_action);

	/* do not NAT HNA networks automatically */
	hna_local_update_nat(hna_local_entry->addr, hna_local_entry->netmask, route_action);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0x8(%rdi), %edi
movzbl 0xc(%r14), %esi
subq $0x8, %rsp
movl $0x1, %r12d
leaq 0x9dae(%rip), %r15      # 0x10cdd
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rbx
pushq %r12
pushq $0x41
callq 0x79b0
addq $0x20, %rsp
movl 0x8(%r14), %edi
movzbl 0xc(%r14), %esi
subq $0x8, %rsp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rbx
pushq %r12
pushq $0x42
callq 0x79b0
addq $0x20, %rsp
movl 0x8(%r14), %edi
movzbl 0xc(%r14), %esi
subq $0x8, %rsp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rbx
pushq %r12
pushq $0x43
callq 0x79b0
addq $0x20, %rsp
movl 0x8(%r14), %edi
movzbl 0xc(%r14), %esi
subq $0x8, %rsp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rbx
pushq %r12
pushq $0x44
callq 0x79b0
addq $0x20, %rsp
movl 0x8(%r14), %edi
movzbl 0xc(%r14), %esi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8e00
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_local_update_vis_packet
unsigned char *hna_local_update_vis_packet(unsigned char *vis_packet, uint16_t *vis_packet_size)
{
	struct hna_local_entry *hna_local_entry;
	struct vis_data *vis_data;

	if (num_hna_local < 1)
		return vis_packet;

	list_for_each_entry(hna_local_entry, &hna_list, list) {
		*vis_packet_size += sizeof(struct vis_data);

		vis_packet = debugRealloc(vis_packet, *vis_packet_size, 107);
		vis_data = (struct vis_data *)(vis_packet + *vis_packet_size - sizeof(struct vis_data));

		memcpy(&vis_data->ip, (unsigned char *)&hna_local_entry->addr, 4);

		vis_data->data = hna_local_entry->netmask;
		vis_data->type = DATA_TYPE_HNA;
	}

	return vis_packet;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rax
cmpb $0x0, 0x10648(%rip)     # 0x17628
sete %cl
leaq 0x10646(%rip), %r14     # 0x17630
movq (%r14), %r15
cmpq %r14, %r15
sete %dl
orb %cl, %dl
jne 0x7033
movq %rsi, %rbx
movzwl (%rbx), %ecx
addl $0x6, %ecx
movw %cx, (%rbx)
movzwl %cx, %esi
movq %rax, %rdi
movl $0x6b, %edx
callq 0x5e6d
movzwl (%rbx), %ecx
movl 0x8(%r15), %edx
movl %edx, -0x4(%rax,%rcx)
movb 0xc(%r15), %dl
movb %dl, -0x5(%rax,%rcx)
movb $0x3, -0x6(%rax,%rcx)
movq (%r15), %r15
cmpq %r14, %r15
jne 0x6ffa
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_global_add
void hna_global_add(struct orig_node *orig_node, unsigned char *new_hna, int16_t new_hna_len)
{
	struct hna_element *e, *buff;
	int i, num_elements;
	char hna_str[ADDR_STR_LEN];

	if ((new_hna == NULL) || (new_hna_len == 0)) {
		orig_node->hna_buff = NULL;
		orig_node->hna_buff_len = 0;
		return;
	}

	orig_node->hna_buff = debugMalloc(new_hna_len, 705);
	orig_node->hna_buff_len = new_hna_len;
	memcpy(orig_node->hna_buff, new_hna, new_hna_len);

	/* add new routes */
	num_elements = orig_node->hna_buff_len / sizeof(struct hna_element);
	buff = (struct hna_element *)orig_node->hna_buff;

	debug_output(4, "HNA information received (%i HNA network%s): \n", num_elements, (num_elements > 1 ? "s": ""));

	for (i = 0; i < num_elements; i++) {
		e = &buff[i];
		addr_to_string(e->addr, hna_str, sizeof(hna_str));

		if ((e->netmask > 0 ) && (e->netmask < 33))
			debug_output(4, "hna: %s/%i\n", hna_str, e->netmask);
		else
			debug_output(4, "hna: %s/%i -> ignoring (invalid netmask) \n", hna_str, e->netmask);

		if ((e->netmask > 0) && (e->netmask <= 32))
			_hna_global_add(orig_node, e);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rdi, %rbx
testq %rsi, %rsi
setne %al
testw %bp, %bp
setne %cl
testb %cl, %al
jne 0x706f
movq $0x0, 0x38(%rbx)
movw $0x0, 0x40(%rbx)
jmp 0x714a
movq %rsi, %r14
movswl %bp, %edi
movl $0x2c1, %esi            # imm = 0x2C1
callq 0x5d3e
movq %rax, 0x38(%rbx)
movw %bp, 0x40(%rbx)
movswq %bp, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2290
movswq 0x40(%rbx), %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
movq %rdx, %r14
shrq $0x2, %r14
movq 0x38(%rbx), %r15
cmpl $0x2, %r14d
leaq 0xc014(%rip), %rax      # 0x130d2
leaq 0x8309(%rip), %rcx      # 0xf3ce
cmovgeq %rax, %rcx
leaq 0x9c15(%rip), %rsi      # 0x10ce5
movl $0x4, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0xd5b0
testl %r14d, %r14d
jle 0x714a
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq %rsp, %r12
leaq 0x9c1f(%rip), %r13      # 0x10d14
leaq 0x9c24(%rip), %rbp      # 0x10d20
movl (%r15), %edi
movq %r12, %rsi
movl $0x10, %edx
callq 0xb8b8
movzbl 0x4(%r15), %ecx
leal -0x1(%rcx), %eax
cmpb $0x20, %al
movq %rbp, %rsi
cmovbq %r13, %rsi
movl $0x4, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0xd5b0
movb 0x4(%r15), %al
decb %al
cmpb $0x1f, %al
ja 0x7141
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7159
addq $0x5, %r15
decq %r14
jne 0x70fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_global_del
void hna_global_del(struct orig_node *orig_node)
{
	struct hna_element *e, *buff;
	int i, num_elements;

	if ((orig_node->hna_buff == NULL) || (orig_node->hna_buff_len == 0))
		return;

	/* delete routes */
	num_elements = orig_node->hna_buff_len / sizeof(struct hna_element);
	buff = (struct hna_element *)orig_node->hna_buff;

	for (i = 0; i < num_elements; i++) {
		e = &buff[i];

		/* not found / deleted, need to add this new route */
		if ((e->netmask > 0) && (e->netmask <= 32))
			_hna_global_del(orig_node, e);
	}

	debugFree(orig_node->hna_buff, 1709);
	orig_node->hna_buff = NULL;
	orig_node->hna_buff_len = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x38(%rdi), %r14
testq %r14, %r14
je 0x765d
movq %rdi, %rbx
movswq 0x40(%rdi), %rax
testq %rax, %rax
je 0x765d
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
movq %rdx, %r15
shrq $0x2, %r15
testl %r15d, %r15d
jle 0x7641
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movb 0x4(%r14), %al
decb %al
cmpb $0x1f, %al
ja 0x7638
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7663
addq $0x5, %r14
decq %r15
jne 0x7623
movq 0x38(%rbx), %rdi
movl $0x6ad, %esi            # imm = 0x6AD
callq 0x5f5b
movq $0x0, 0x38(%rbx)
movw $0x0, 0x40(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_free
void hna_free(void)
{
	struct list_head *list_pos, *list_pos_tmp;
	struct hna_local_entry *hna_local_entry;

	/* hna local */
	list_for_each_safe(list_pos, list_pos_tmp, &hna_list) {
		hna_local_entry = list_entry(list_pos, struct hna_local_entry, list);
		hna_local_update_routes(hna_local_entry, ROUTE_DEL);

		debugFree(hna_local_entry, 1705);
	}

	if (hna_buff_local != NULL)
		debugFree(hna_buff_local, 1706);

	num_hna_local = 0;
	hna_buff_local = NULL;

	/* hna global */
	if (hna_global_hash != NULL)
		hash_delete(hna_global_hash, _hna_global_hash_del);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xfd53(%rip), %rbx      # 0x17630
leaq 0xfd4c(%rip), %r14      # 0x17630
cmpq %r14, %rbx
je 0x790e
movq (%rbx), %r15
movq %rbx, %rdi
movl $0x1, %esi
callq 0x6f09
movq %rbx, %rdi
movl $0x6a9, %esi            # imm = 0x6A9
callq 0x5f5b
movq %r15, %rbx
cmpq %r14, %r15
jne 0x78e9
movq 0xfd0b(%rip), %rdi      # 0x17620
testq %rdi, %rdi
je 0x7924
movl $0x6aa, %esi            # imm = 0x6AA
callq 0x5f5b
movb $0x0, 0xfcfd(%rip)      # 0x17628
movq $0x0, 0xfcea(%rip) # 0x17620
movq 0xfd3b(%rip), %rdi      # 0x17678
testq %rdi, %rdi
je 0x7953
leaq 0x10(%rip), %rsi        # 0x7959
popq %rbx
popq %r14
popq %r15
jmp 0x6376
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/hna.c
// Function: hna_global_hash_del
static void _hna_global_hash_del(void *data)
{
	struct hna_global_entry *hna_global_entry = data;
	struct hna_orig_ptr *hna_orig_ptr = NULL;
	struct list_head *list_pos, *list_pos_tmp;

	list_for_each_safe(list_pos, list_pos_tmp, &hna_global_entry->orig_list) {

		hna_orig_ptr = list_entry(list_pos, struct hna_orig_ptr, list);

		list_del((struct list_head *)&hna_global_entry->orig_list, list_pos, &hna_global_entry->orig_list);
		debugFree(hna_orig_ptr, 1710);
	}

	debugFree(hna_global_entry, 1711);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq 0x10(%rdi), %r15
cmpq %r14, %r15
je 0x7997
movq (%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5bcf
movq %r15, %rdi
movl $0x6ae, %esi            # imm = 0x6AE
callq 0x5f5b
movq %r12, %r15
cmpq %r14, %r12
jne 0x7971
movq %rbx, %rdi
movl $0x6af, %esi            # imm = 0x6AF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5f5b
nop
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: run_cmd
static int run_cmd(const char *cmd) {
	int error, pipes[2], stderr = -1, ret = 0;
	char error_log[256];

	if (pipe(pipes) < 0) {
		debug_output(3, "Warning - could not create a pipe to '%s': %s\n", cmd, strerror(errno));
		return -1;
	}

	memset(error_log, 0, 256);

	/* save stderr */
	stderr = dup(STDERR_FILENO);

	/* connect the commands output with the pipe for later logging */
	dup2(pipes[1], STDERR_FILENO);
	close(pipes[1]);

	error = system(cmd);

	/* copy stderr back */
	dup2(stderr, STDERR_FILENO);
	close(stderr);

	if ((error < 0) || (WEXITSTATUS(error) != 0)) {
		ret = read(pipes[0], error_log, sizeof(error_log));
		debug_output(3, "Warning - command '%s' returned an error\n", cmd);

		if (ret > 0)
			debug_output(3, "          %s\n", error_log);

		ret = -1;
	}

	close(pipes[0]);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2210
testl %eax, %eax
js 0x8cac
leaq 0x10(%rsp), %rdi
xorl %ebp, %ebp
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x21c0
movl $0x2, %edi
callq 0x21b0
movl %eax, %r14d
movl 0xc(%rsp), %edi
movl $0x2, %esi
callq 0x2170
movl 0xc(%rsp), %edi
callq 0x21f0
movq %rbx, %rdi
callq 0x2160
movl %eax, %r15d
movl %r14d, %edi
movl $0x2, %esi
callq 0x2170
movl %r14d, %edi
callq 0x21f0
testl $0x8000ff00, %r15d      # imm = 0x8000FF00
je 0x8ca1
movl 0x8(%rsp), %edi
leaq 0x10(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2230
movq %rax, %r14
leaq 0x8b85(%rip), %rsi      # 0x117f5
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xd5b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %r14d, %r14d
jle 0x8ca1
leaq 0x8b8f(%rip), %rsi      # 0x1181f
leaq 0x10(%rsp), %rdx
movl $0x3, %edi
xorl %eax, %eax
callq 0xd5b0
movl 0x8(%rsp), %edi
callq 0x21f0
jmp 0x8cd6
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x8b07(%rip), %rsi      # 0x117c6
movl $0x3, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xd5b0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: add_nat_rule
void add_nat_rule(char *dev) {
	char cmd[150];

	sprintf(cmd, IPTABLES_ADD_MASQ, dev);
	exec_iptables_rule(cmd, ROUTE_ADD);

	sprintf(cmd, IPTABLES_ADD_MSS, dev);
	exec_iptables_rule(cmd, ROUTE_ADD);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x86b4(%rip), %rsi      # 0x113ae
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2430
movq %r14, %rdi
xorl %esi, %esi
callq 0x8d3d
leaq 0x86c6(%rip), %rsi      # 0x113e1
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2430
movq %r14, %rdi
xorl %esi, %esi
callq 0x8d3d
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: exec_iptables_rule
static void exec_iptables_rule(const char *cmd, int8_t route_action) {
	if (disable_client_nat)
		return;

	if (nat_tool_avail == -1) {
		debug_output(3, "Warning - could not %sactivate NAT: iptables binary not found!\n", (route_action == ROUTE_ADD ? "" : "de"));
		debug_output(3, "          You may need to run this command: %s\n", cmd);
		return;
	}

	run_cmd(cmd);
}

// Assembly:
pushq %rbx
leaq 0xe5c3(%rip), %rax      # 0x17308
cmpb $0x0, (%rax)
je 0x8d4c
popq %rbx
retq
movq %rdi, %rbx
leaq 0xe546(%rip), %rax      # 0x1729c
cmpl $-0x1, (%rax)
je 0x8d64
movq %rbx, %rdi
popq %rbx
jmp 0x8bd1
testb %sil, %sil
leaq 0x6660(%rip), %rax      # 0xf3ce
leaq 0x6e51(%rip), %rdx      # 0xfbc6
cmoveq %rax, %rdx
leaq 0x8aad(%rip), %rsi      # 0x1182d
movl $0x3, %edi
xorl %eax, %eax
callq 0xd5b0
leaq 0x8ada(%rip), %rsi      # 0x1186d
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
jmp 0xd5b0
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: del_nat_rule
void del_nat_rule(char *dev) {
	char cmd[150];

	sprintf(cmd, IPTABLES_DEL_MASQ, dev);
	exec_iptables_rule(cmd, ROUTE_DEL);

	sprintf(cmd, IPTABLES_ADD_MSS, dev);
	exec_iptables_rule(cmd, ROUTE_DEL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x868f(%rip), %rsi      # 0x11446
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2430
movq %r14, %rdi
movl $0x1, %esi
callq 0x8d3d
leaq 0x8606(%rip), %rsi      # 0x113e1
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2430
movq %r14, %rdi
movl $0x1, %esi
callq 0x8d3d
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: hna_local_update_nat
void hna_local_update_nat(uint32_t hna_ip, uint8_t netmask, int8_t route_action) {
	char cmd[100], ip_addr[16];

	inet_ntop(AF_INET, &hna_ip, ip_addr, sizeof(ip_addr));

	if (route_action == ROUTE_DEL)
		sprintf(cmd, IPTABLES_DEL_ACC, ip_addr, netmask);
	else
		sprintf(cmd, IPTABLES_ADD_ACC, ip_addr, netmask);

	exec_iptables_rule(cmd, route_action);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
movl %esi, %ebp
leaq 0xc(%rsp), %rsi
movl %edi, (%rsi)
leaq 0x10(%rsp), %r14
movl $0x2, %edi
movq %r14, %rdx
movl $0x10, %ecx
callq 0x2030
cmpb $0x1, %bl
leaq 0x8640(%rip), %rax      # 0x11479
leaq 0x866b(%rip), %rsi      # 0x114ab
cmoveq %rax, %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2430
movq %r15, %rdi
movl %ebx, %esi
callq 0x8d3d
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: probe_tun
int8_t probe_tun(uint8_t print_to_stderr) {

	int32_t fd;

	if ( ( fd = open( "/dev/net/tun", O_RDWR ) ) < 0 ) {

		if (print_to_stderr)
			fprintf( stderr, "Error - could not open '/dev/net/tun' ! Is the tun kernel module loaded ?\n" );
		else
			debug_output( 0, "Error - could not open '/dev/net/tun' ! Is the tun kernel module loaded ?\n" );

		return 0;

	}

	close( fd );

	return 1;

}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x8663(%rip), %rdi      # 0x114dd
movl $0x2, %esi
xorl %eax, %eax
callq 0x23a0
testl %eax, %eax
js 0x8e95
movl %eax, %edi
callq 0x21f0
movb $0x1, %bl
jmp 0x8eab
testb %bl, %bl
jne 0x8eaf
leaq 0x864a(%rip), %rsi      # 0x114ea
xorl %ebx, %ebx
xorl %edi, %edi
xorl %eax, %eax
callq 0xd5b0
movl %ebx, %eax
popq %rbx
retq
callq 0x2ab7
xorl %ebx, %ebx
jmp 0x8eab
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: del_dev_tun
int8_t del_dev_tun( int32_t fd ) {

	if ( ioctl( fd, TUNSETPERSIST, 0 ) < 0 ) {

		debug_output( 0, "Error - can't delete tun device: %s\n", strerror(errno) );
		return -1;

	}

	close( fd );

	return 1;

}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x400454cb, %esi       # imm = 0x400454CB
xorl %edx, %edx
xorl %eax, %eax
callq 0x21d0
testl %eax, %eax
js 0x8ed8
movl %ebx, %edi
callq 0x21f0
movb $0x1, %al
jmp 0x8ef9
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x864a(%rip), %rsi      # 0x11535
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0xd5b0
movb $-0x1, %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/tun.c
// Function: set_tun_addr
int8_t set_tun_addr( int32_t fd, uint32_t tun_addr, char *tun_dev ) {

	struct sockaddr_in addr;
	struct ifreq ifr_tun;


	memset( &ifr_tun, 0, sizeof(ifr_tun) );
	memset( &addr, 0, sizeof(addr) );

	addr.sin_addr.s_addr = tun_addr;
	addr.sin_family = AF_INET;
	memcpy( &ifr_tun.ifr_addr, &addr, sizeof(struct sockaddr) );

	strncpy( ifr_tun.ifr_name, tun_dev, IFNAMSIZ - 1 );

	if ( ioctl( fd, SIOCSIFADDR, &ifr_tun) < 0 ) {

		debug_output( 0, "Error - can't set tun address (SIOCSIFADDR): %s\n", strerror(errno) );
		return -1;

	}

	return 1;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rax
movl %edi, %ebx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
xorl %ecx, %ecx
movq %rcx, 0x20(%r14)
movl $0x2, 0x10(%r14)
movl %esi, 0x14(%r14)
movq %rcx, 0x18(%r14)
movl $0xf, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2090
movl $0x8916, %esi           # imm = 0x8916
movl %ebx, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jns 0x92a6
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x84fd(%rip), %rsi      # 0x11795
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0xd5b0
movb $-0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: set_rp_filter
void set_rp_filter(int32_t state, const char* dev)
{
	char filename[100], *colon_ptr;

	/* if given interface is an alias use parent interface */
	if ((colon_ptr = strchr(dev, ':')) != NULL)
		*colon_ptr = '\0';

	sprintf(filename, "/proc/sys/net/ipv4/conf/%s/rp_filter", dev);
	set_integer_file(filename, state);

	if (colon_ptr != NULL)
		*colon_ptr = ':';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movl %edi, %ebx
movq %rsi, %rdi
movl $0x3a, %esi
callq 0x2180
testq %rax, %rax
je 0x92ff
movq %rax, %r15
movb $0x0, (%rax)
leaq 0x85cf(%rip), %rsi      # 0x118ae
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r12, %rdi
movl %ebx, %esi
callq 0x932c
movb $0x3a, (%r15)
jmp 0x9320
leaq 0x85a8(%rip), %rsi      # 0x118ae
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r15, %rdi
movl %ebx, %esi
callq 0x932c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: get_rp_filter
int32_t get_rp_filter(const char *dev)
{
	int32_t state = 0;
	char filename[100], *colon_ptr;

	/* if given interface is an alias use parent interface */
	if ((colon_ptr = strchr(dev, ':')) != NULL)
		*colon_ptr = '\0';

	sprintf(filename, "/proc/sys/net/ipv4/conf/%s/rp_filter", dev);
	state = get_integer_file(filename);

	if (colon_ptr != NULL)
		*colon_ptr = ':';

	return state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %r14
movl $0x3a, %esi
callq 0x2180
movq %rax, %rbx
testq %rax, %rax
je 0x9391
movb $0x0, (%rbx)
leaq 0x8516(%rip), %rsi      # 0x118ae
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r15, %rdi
callq 0x93c2
testq %rbx, %rbx
je 0x93b8
movb $0x3a, (%rbx)
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: get_integer_file
static int get_integer_file(const char* filename)
{
	FILE *f;
	int32_t integer = 0;
	int n;

	if((f = fopen(filename, "r")) == NULL)
		return 0;

	n = fscanf(f, "%"SCNd32, &integer);
	fclose(f);

	if (n == 0 || n == EOF)
		integer = 0;

	return integer;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x0, 0x4(%rsp)
leaq 0x84fd(%rip), %rsi      # 0x118d1
callq 0x23d0
testq %rax, %rax
je 0x9416
movq %rax, %rbx
leaq 0x8533(%rip), %rsi      # 0x1191b
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x20b0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2120
incl %ebp
cmpl $0x1, %ebp
ja 0x9410
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
jmp 0x9418
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: set_send_redirects
void set_send_redirects(int32_t state, const char* dev)
{
	char filename[100], *colon_ptr;

	/* if given interface is an alias use parent interface */
	if ((colon_ptr = strchr(dev, ':')) != NULL)
		*colon_ptr = '\0';

	sprintf(filename, "/proc/sys/net/ipv4/conf/%s/send_redirects", dev);
	set_integer_file(filename, state);

	if (colon_ptr != NULL)
		*colon_ptr = ':';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movl %edi, %ebx
movq %rsi, %rdi
movl $0x3a, %esi
callq 0x2180
testq %rax, %rax
je 0x946e
movq %rax, %r15
movb $0x0, (%rax)
leaq 0x8485(%rip), %rsi      # 0x118d3
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r12, %rdi
movl %ebx, %esi
callq 0x932c
movb $0x3a, (%r15)
jmp 0x948f
leaq 0x845e(%rip), %rsi      # 0x118d3
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r15, %rdi
movl %ebx, %esi
callq 0x932c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: get_send_redirects
int32_t get_send_redirects(const char *dev)
{
	int32_t state = 0;
	char filename[100], *colon_ptr;

	/* if given interface is an alias use parent interface */
	if ((colon_ptr = strchr(dev, ':')) != NULL)
		*colon_ptr = '\0';

	sprintf(filename, "/proc/sys/net/ipv4/conf/%s/send_redirects", dev);
	state = get_integer_file(filename);

	if (colon_ptr != NULL)
		*colon_ptr = ':';

	return state;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %r14
movl $0x3a, %esi
callq 0x2180
movq %rax, %rbx
testq %rax, %rax
je 0x94bc
movb $0x0, (%rbx)
leaq 0x8410(%rip), %rsi      # 0x118d3
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2430
movq %r15, %rdi
callq 0x93c2
testq %rbx, %rbx
je 0x94e3
movb $0x3a, (%rbx)
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: bind_to_iface
int8_t bind_to_iface(int32_t sock, const char *dev)
{
	char *colon_ptr;

	/* if given interface is an alias bind to parent interface */
	if ((colon_ptr = strchr(dev, ':')) != NULL)
		*colon_ptr = '\0';

	if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev) + 1) < 0) {

		if (colon_ptr != NULL)
			*colon_ptr = ':';

		return -1;

	}

	if (colon_ptr != NULL)
		*colon_ptr = ':';

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movq %rsi, %rdi
movl $0x3a, %esi
callq 0x2180
movq %rax, %rbx
testq %rax, %rax
je 0x9528
movb $0x0, (%rbx)
movq %r14, %rdi
callq 0x2130
leal 0x1(%rax), %r8d
movl %ebp, %edi
movl $0x1, %esi
movl $0x19, %edx
movq %r14, %rcx
callq 0x20d0
testq %rbx, %rbx
je 0x9550
movb $0x3a, (%rbx)
sarl $0x1f, %eax
orb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/linux/kernel.c
// Function: is_wifi_interface
int is_wifi_interface(char *dev, int fd)
{
	struct ifreq int_req;
	char *colon_ptr;

	memset(&int_req, 0, sizeof (struct ifreq));
	strncpy(int_req.ifr_name, dev, IFNAMSIZ - 1);

	if ((colon_ptr = strchr(int_req.ifr_name, ':')) != NULL)
		*colon_ptr = '\0';

	if (ioctl(fd, SIOCGIWNAME, &int_req) >= 0)
		return 1;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %rsi
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq $0x0, 0x20(%r14)
movl $0xf, %edx
movq %r14, %rdi
callq 0x2090
movq %r14, %rdi
movl $0x3a, %esi
callq 0x2180
testq %rax, %rax
je 0x959f
movb $0x0, (%rax)
movq %rsp, %rdx
movl $0x8b01, %esi           # imm = 0x8B01
movl %ebx, %edi
xorl %eax, %eax
callq 0x21d0
notl %eax
shrl $0x1f, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: init_interface
void init_interface(struct batman_if *batman_if)
{
	if (strlen( batman_if->dev ) > IFNAMSIZ - 1) {
		printf("Error - interface name too long: %s\n", batman_if->dev);
		restore_defaults();
		exit(EXIT_FAILURE);
	}

	if (is_interface_up(batman_if->dev))
		activate_interface(batman_if);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2130
cmpq $0x10, %rax
jae 0xa988
movq %r14, %rdi
callq 0xabd4
testl %eax, %eax
je 0xa980
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xac6d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x75d9(%rip), %rdi      # 0x11f68
movq %r14, %rsi
xorl %eax, %eax
callq 0x2190
callq 0xbc2c
movl $0x1, %edi
callq 0x2440
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: init_interface_gw
void init_interface_gw (void) {

	int32_t sock_opts;
	struct batman_if *batman_if = (struct batman_if *)if_list.next;

	batman_if->addr.sin_port = htons(GW_PORT);

	batman_if->udp_tunnel_sock = socket(PF_INET, SOCK_DGRAM, 0);

	if (batman_if->udp_tunnel_sock < 0) {

		debug_output( 0, "Error - can't create tunnel socket: %s\n", strerror(errno) );
		restore_defaults();
		exit(EXIT_FAILURE);

	}

	if ( bind( batman_if->udp_tunnel_sock, (struct sockaddr *)&batman_if->addr, sizeof(struct sockaddr_in) ) < 0 ) {

		debug_output( 0, "Error - can't bind tunnel socket: %s\n", strerror(errno) );
		restore_defaults();
		exit(EXIT_FAILURE);

	}

	/* make udp socket non blocking */
	sock_opts = fcntl( batman_if->udp_tunnel_sock, F_GETFL, 0 );
	fcntl( batman_if->udp_tunnel_sock, F_SETFL, sock_opts | O_NONBLOCK );

	batman_if->addr.sin_port = htons(PORT);

	pthread_create( &batman_if->listen_thread_id, NULL, &gw_listen, batman_if );
}

// Assembly:
pushq %rbx
leaq 0xc960(%rip), %rax      # 0x17310
movq (%rax), %rbx
movw $0xd210, 0x32(%rbx)     # imm = 0xD210
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x24e0
movl %eax, 0x18(%rbx)
testl %eax, %eax
js 0xaa28
leaq 0x30(%rbx), %rsi
movl %eax, %edi
movl $0x10, %edx
callq 0x2370
testl %eax, %eax
js 0xaa3d
movl 0x18(%rbx), %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20e0
movl 0x18(%rbx), %edi
orl $0x800, %eax            # imm = 0x800
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x20e0
movw $0xd110, 0x32(%rbx)     # imm = 0xD110
leaq 0x28(%rbx), %rdi
leaq 0x2090(%rip), %rdx      # 0xcaad
xorl %esi, %esi
movq %rbx, %rcx
popq %rbx
jmp 0x2380
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x7552(%rip), %rsi      # 0x11f8d
jmp 0xaa50
callq 0x2070
movl (%rax), %edi
callq 0x2480
leaq 0x7565(%rip), %rsi      # 0x11fb5
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0xd5b0
callq 0xbc2c
movl $0x1, %edi
callq 0x2440
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: interface_listen_sockets
void interface_listen_sockets(void)
{
	struct list_head *list_pos;
	struct batman_if *batman_if;

	FD_ZERO(&receive_wait_set);
	receive_max_sock = 0;

	list_for_each(list_pos, &if_list) {
		batman_if = list_entry(list_pos, struct batman_if, list);

		if (batman_if->if_active) {
			if (batman_if->udp_recv_sock > receive_max_sock)
				receive_max_sock = batman_if->udp_recv_sock;

			FD_SET(batman_if->udp_recv_sock, &receive_wait_set);
		}
	}
}

// Assembly:
xorps %xmm0, %xmm0
leaq 0xc913(%rip), %rax      # 0x17388
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0xc84d(%rip), %rdx      # 0x172e8
movl $0x0, (%rdx)
leaq 0xc868(%rip), %rsi      # 0x17310
movq (%rsi), %rdi
cmpq %rsi, %rdi
je 0xaaf9
xorl %r8d, %r8d
cmpb $0x0, 0x1d(%rdi)
je 0xaaf1
movl 0x14(%rdi), %ecx
cmpl %r8d, %ecx
jle 0xaac6
movl %ecx, (%rdx)
movl %ecx, %r8d
movl 0x14(%rdi), %ecx
leal 0x3f(%rcx), %r9d
testl %ecx, %ecx
cmovnsl %ecx, %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
subl %r10d, %ecx
movl $0x1, %r10d
shlq %cl, %r10
sarl $0x6, %r9d
movslq %r9d, %rcx
orq %r10, (%rax,%rcx,8)
movq (%rdi), %rdi
cmpq %rsi, %rdi
jne 0xaab3
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: deactivate_interface
void deactivate_interface(struct batman_if *batman_if)
{
	if (batman_if->udp_recv_sock != 0)
		close(batman_if->udp_recv_sock);

	if (batman_if->udp_send_sock != 0)
		close(batman_if->udp_send_sock);

	batman_if->udp_recv_sock = 0;
	batman_if->udp_send_sock = 0;

	if ((batman_if->netaddr > 0) && (batman_if->netmask > 0)) {

		add_del_rule(batman_if->netaddr, batman_if->netmask, BATMAN_RT_TABLE_HOSTS, BATMAN_RT_PRIO_DEFAULT + batman_if->if_num, 0, RULE_TYPE_DST, RULE_DEL);
		add_del_rule(batman_if->netaddr, batman_if->netmask, BATMAN_RT_TABLE_UNREACH, BATMAN_RT_PRIO_UNREACH + batman_if->if_num, 0, RULE_TYPE_DST, RULE_DEL);

	}

	batman_if->if_active = 0;
	active_ifs--;

	if (batman_if->if_rp_filter_old > -1)
		set_rp_filter(batman_if->if_rp_filter_old, batman_if->dev);

	if (batman_if->if_send_redirects_old > -1)
		set_send_redirects(batman_if->if_send_redirects_old, batman_if->dev);

	batman_if->if_rp_filter_old = -1;
	batman_if->if_send_redirects_old = -1;

	interface_listen_sockets();
	debug_output(3, "Interface deactivated: %s\n", batman_if->dev);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %edi
testl %edi, %edi
je 0xab0c
callq 0x21f0
movl 0x10(%rbx), %edi
testl %edi, %edi
je 0xab18
callq 0x21f0
movq $0x0, 0x10(%rbx)
movl 0x50(%rbx), %edi
testl %edi, %edi
je 0xab7d
movb 0x54(%rbx), %al
testb %al, %al
je 0xab7d
movzbl 0x1c(%rbx), %ecx
addl $0x19c8, %ecx           # imm = 0x19C8
movl $0x1, %ebp
movl %ebp, (%rsp)
movzbl %al, %esi
movl $0x42, %edx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x7f9f
movl 0x50(%rbx), %edi
movzbl 0x54(%rbx), %esi
movzbl 0x1c(%rbx), %ecx
addl $0x1a2c, %ecx           # imm = 0x1A2C
movl %ebp, (%rsp)
movl $0x43, %edx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x7f9f
movb $0x0, 0x1d(%rbx)
leaq 0xc75d(%rip), %rax      # 0x172e5
decb (%rax)
movsbl 0x24(%rbx), %edi
testl %edi, %edi
js 0xab9b
movq 0x8(%rbx), %rsi
callq 0x92b0
movsbl 0x25(%rbx), %edi
testl %edi, %edi
js 0xabac
movq 0x8(%rbx), %rsi
callq 0x941f
movw $0xffff, 0x24(%rbx)     # imm = 0xFFFF
callq 0xaa6b
movq 0x8(%rbx), %rdx
leaq 0x738b(%rip), %rsi      # 0x11f4d
movl $0x3, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xd5b0
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: is_interface_up
static int is_interface_up(char *dev)
{
	struct ifreq int_req;
	int sock;

	if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
		return 0;

	memset(&int_req, 0, sizeof (struct ifreq));
	strncpy(int_req.ifr_name, dev, IFNAMSIZ - 1);

	if (ioctl(sock, SIOCGIFFLAGS, &int_req) < 0)
		goto failure;

	if (!(int_req.ifr_flags & IFF_UP))
		goto failure;

	if (ioctl(sock, SIOCGIFADDR, &int_req) < 0)
		goto failure;

	close(sock);
	return 1;

failure:
	close(sock);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x24e0
testl %eax, %eax
js 0xac60
movl %eax, %ebx
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq $0x0, 0x20(%r15)
movl $0xf, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2090
movl $0x8913, %esi           # imm = 0x8913
movl %ebx, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21d0
testl %eax, %eax
js 0xac57
testb $0x1, 0x10(%rsp)
je 0xac57
movq %rsp, %rdx
movl $0x8915, %esi           # imm = 0x8915
movl %ebx, %edi
xorl %eax, %eax
callq 0x21d0
movl $0x1, %ebp
testl %eax, %eax
jns 0xac59
xorl %ebp, %ebp
movl %ebx, %edi
callq 0x21f0
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: check_inactive_interfaces
void check_inactive_interfaces(void)
{
	struct list_head *list_pos;
	struct batman_if *batman_if;

	/* all available interfaces are active */
	if (found_ifs == active_ifs)
		return;

	list_for_each(list_pos, &if_list) {
		batman_if = list_entry(list_pos, struct batman_if, list);

		if ((!batman_if->if_active) && (is_interface_up(batman_if->dev)))
			activate_interface(batman_if);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc285(%rip), %rax      # 0x172e4
movb (%rax), %al
leaq 0xc27d(%rip), %rcx      # 0x172e5
cmpb (%rcx), %al
sete %al
leaq 0xc29c(%rip), %r14      # 0x17310
movq (%r14), %rbx
cmpq %r14, %rbx
sete %cl
orb %al, %cl
jne 0xb0a4
cmpb $0x0, 0x1d(%rbx)
jne 0xb09c
movq 0x8(%rbx), %rdi
callq 0xabd4
testl %eax, %eax
je 0xb09c
movq %rbx, %rdi
callq 0xac6d
movq (%rbx), %rbx
cmpq %r14, %rbx
jne 0xb081
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/init.c
// Function: check_active_interfaces
void check_active_interfaces(void)
{
	struct list_head *list_pos;
	struct batman_if *batman_if;

	/* all available interfaces are deactive */
	if (active_ifs == 0)
		return;

	list_for_each(list_pos, &if_list) {
		batman_if = list_entry(list_pos, struct batman_if, list);

		if ((batman_if->if_active) && (!is_interface_up(batman_if->dev)))
			deactivate_interface(batman_if);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc22e(%rip), %rax      # 0x172e5
cmpb $0x0, (%rax)
sete %al
leaq 0xc24c(%rip), %r14      # 0x17310
movq (%r14), %rbx
cmpq %r14, %rbx
sete %cl
orb %al, %cl
jne 0xb0f4
cmpb $0x0, 0x1d(%rbx)
je 0xb0ec
movq 0x8(%rbx), %rdi
callq 0xabd4
testl %eax, %eax
jne 0xb0ec
movq %rbx, %rdi
callq 0xaafa
movq (%rbx), %rbx
cmpq %r14, %rbx
jne 0xb0d1
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/posix.c
// Function: get_time_msec
uint32_t get_time_msec(void)
{
	uint32_t time;

	pthread_mutex_lock(&batman_clock_mutex);
	update_internal_clock();
	time = (uint32_t)(((float)(batman_clock_ticks) * 1000) / system_tick);
	pthread_mutex_unlock(&batman_clock_mutex);

	return time;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc589(%rip), %rbx      # 0x17690
movq %rbx, %rdi
callq 0x24c0
callq 0xc01e
movq %rax, %rcx
subq 0xc5a2(%rip), %rcx      # 0x176c0
leaq 0xc1db(%rip), %rdx      # 0x17300
addq (%rdx), %rcx
movq %rcx, (%rdx)
movq %rax, 0xc58e(%rip)      # 0x176c0
js 0xb13b
cvtsi2ss %rcx, %xmm0
jmp 0xb150
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
mulss 0x71ac(%rip), %xmm0     # 0x12304
divss 0xc558(%rip), %xmm0     # 0x176b8
cvttss2si %xmm0, %r14
movq %rbx, %rdi
callq 0x22d0
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/posix.c
// Function: get_time_msec64
uint64_t get_time_msec64(void)
{
	uint64_t time;

	pthread_mutex_lock(&batman_clock_mutex);
	update_internal_clock();
	time = (uint64_t)(((float)(batman_clock_ticks) * 1000) / system_tick);
	pthread_mutex_unlock(&batman_clock_mutex);

	return time;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xc50d(%rip), %rbx      # 0x17690
movq %rbx, %rdi
callq 0x24c0
callq 0xc01e
movq %rax, %rcx
subq 0xc526(%rip), %rcx      # 0x176c0
leaq 0xc15f(%rip), %rdx      # 0x17300
addq (%rdx), %rcx
movq %rcx, (%rdx)
movq %rax, 0xc512(%rip)      # 0x176c0
js 0xb1b7
cvtsi2ss %rcx, %xmm0
jmp 0xb1cc
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
mulss 0x7130(%rip), %xmm0     # 0x12304
divss 0xc4dc(%rip), %xmm0     # 0x176b8
cvttss2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subss 0x7118(%rip), %xmm0     # 0x12308
cvttss2si %xmm0, %r14
andq %rcx, %r14
orq %rax, %r14
movq %rbx, %rdi
callq 0x22d0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/open-mesh-mirror[P]batmand/posix/posix.c
// Function: sym_print
static void sym_print( char x, char y, const char *z ) {

	char i = 0, Z;

	do{

		BAT_LOGO_PRINT( 25 + (int)x + (int)i, (int)y, z[(int)i] );

		switch ( z[(int)i] ) {

			case 92:
				Z = 47;   /* "\" --> "/" */
				break;

			case 47:
				Z = 92;   /* "/" --> "\" */
				break;

			case 41:
				Z = 40;   /* ")" --> "(" */
				break;

			default:
				Z = z[(int)i];
				break;

		}

		BAT_LOGO_PRINT( 24 - (int)x - (int)i, (int)y, Z );
		i++;

	} while( z[(int)i - 1] );

	return;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
incl %ebp
xorl %r12d, %r12d
leaq 0x6d01(%rip), %r15      # 0x12539
movsbl %r12b, %r12d
leal (%r12,%r14), %edx
addl $0x19, %edx
movsbq %r12b, %r13
movsbl (%rbx,%r13), %ecx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2190
movzbl (%rbx,%r13), %eax
cmpl $0x29, %eax
je 0xb87a
cmpl $0x5c, %eax
je 0xb873
cmpl $0x2f, %eax
jne 0xb881
movl $0x5c, %ecx
jmp 0xb884
movl $0x2f, %ecx
jmp 0xb884
movl $0x28, %ecx
jmp 0xb884
movsbl %al, %ecx
movl $0x18, %edx
subl %r14d, %edx
subl %r12d, %edx
movq %r15, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2190
incb %r12b
movsbq %r12b, %rax
cmpb $0x0, -0x1(%rbx,%rax)
jne 0xb838
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq