// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0x2190
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x8d2d
cmpb $0x0, -0xa(%rbp)
je 0x8d11
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xcf07(%rip), %rsi      # 0x15c0c
movb $0x0, %al
callq 0x123f0
jmp 0x8e8f
movq -0x8(%rbp), %rsi
leaq 0xcef0(%rip), %rdi      # 0x15c0c
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2470
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rsi
movl $0x2, %edi
leaq -0x10(%rbp), %rdx
callq 0x22d0
cmpl $0x1, %eax
jge 0x8d90
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
cmpb $0x0, -0xa(%rbp)
je 0x8d74
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xced8(%rip), %rsi      # 0x15c40
movb $0x0, %al
callq 0x123f0
jmp 0x8e8f
movq -0x8(%rbp), %rsi
leaq 0xcec1(%rip), %rdi      # 0x15c40
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2470
callq 0x2070
movl $0x0, (%rax)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x22b0
movw %ax, -0x12(%rbp)
callq 0x2070
cmpl $0x22, (%rax)
je 0x8dd2
callq 0x2070
cmpl $0x0, (%rax)
je 0x8dfa
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x8dfa
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
cmpb $0x0, -0xa(%rbp)
je 0x8de4
jmp 0x8e8f
leaq 0xce84(%rip), %rdi      # 0x15c6f
callq 0x2410
movl $0x1, %edi
callq 0x2470
movzwl -0x12(%rbp), %eax
cmpl $0x1, %eax
jl 0x8e0c
movzwl -0x12(%rbp), %eax
cmpl $0x20, %eax
jle 0x8e4e
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
cmpb $0x0, -0xa(%rbp)
je 0x8e32
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xce4d(%rip), %rsi      # 0x15c76
movb $0x0, %al
callq 0x123f0
jmp 0x8e8f
movq -0x8(%rbp), %rsi
leaq 0xce39(%rip), %rdi      # 0x15c76
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2470
movq -0x20(%rbp), %rax
movb $0x2f, (%rax)
movl -0x10(%rbp), %eax
movl %eax, -0x24(%rbp)
movzwl -0x12(%rbp), %eax
movl $0x20, %ecx
subl %eax, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
shll %cl, %edi
callq 0x21d0
movl %eax, %ecx
movl -0x24(%rbp), %eax
andl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edi
movw -0x12(%rbp), %ax
movzwl %ax, %esi
movzbl -0x9(%rbp), %edx
callq 0x8bd0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)