// File: /workspace/github_c_makefile_star2_O0/open-mesh-mirror[P]batmand/originator.c
// Function: get_orig_node
struct orig_node *get_orig_node( uint32_t addr ) {

	struct orig_node *orig_node;
	struct hashtable_t *swaphash;
	char orig_str[ADDR_STR_LEN];
	prof_start( PROF_get_orig_node );


	orig_node = ((struct orig_node *)hash_find( orig_hash, &addr ));

	if ( orig_node != NULL ) {

		prof_stop( PROF_get_orig_node );
		return orig_node;

	}


	addr_to_string( addr, orig_str, ADDR_STR_LEN );
	debug_output( 4, "Creating new originator: %s \n", orig_str );

	orig_node = debugMalloc( sizeof(struct orig_node), 401 );
	memset(orig_node, 0, sizeof(struct orig_node));
	INIT_LIST_HEAD_FIRST( orig_node->neigh_list );

	orig_node->orig = addr;
	orig_node->router = NULL;
	orig_node->batman_if = NULL;

	orig_node->bcast_own = debugMalloc( found_ifs * sizeof(TYPE_OF_WORD) * num_words, 404 );
	memset( orig_node->bcast_own, 0, found_ifs * sizeof(TYPE_OF_WORD) * num_words );

	orig_node->bcast_own_sum = debugMalloc( found_ifs * sizeof(uint8_t), 405 );
	memset( orig_node->bcast_own_sum, 0, found_ifs * sizeof(uint8_t) );

	hash_add( orig_hash, orig_node );

	if ( orig_hash->elements * 4 > orig_hash->size ) {

		swaphash = hash_resize( orig_hash, orig_hash->size * 2 );

		if ( swaphash == NULL ) {

			debug_output( 0, "Couldn't resize hash table \n" );
			restore_and_exit(0);

		}

		orig_hash = swaphash;

	}

	prof_stop( PROF_get_orig_node );
	return orig_node;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl $0x4, %edi
callq 0x8760
leaq 0x16764(%rip), %rax     # 0x1b3d0
movq (%rax), %rdi
leaq -0xc(%rbp), %rsi
callq 0x83f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4c9a
movl $0x4, %edi
callq 0x8790
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4e5c
movl -0xc(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x10, %edx
callq 0xfa90
leaq -0x30(%rbp), %rdx
movl $0x4, %edi
leaq 0x1036e(%rip), %rsi     # 0x15029
movb $0x0, %al
callq 0x123f0
movl $0x58, %edi
movl $0x191, %esi            # imm = 0x191
callq 0x7220
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x21e0
movq -0x18(%rbp), %rcx
addq $0x48, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rcx
addq $0x48, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
leaq 0x16657(%rip), %rax     # 0x1b384
movzbl (%rax), %eax
shlq $0x3, %rax
leaq 0x16575(%rip), %rcx     # 0x1b2b0
movzbl (%rcx), %ecx
imulq %rcx, %rax
movl %eax, %edi
movl $0x194, %esi            # imm = 0x194
callq 0x7220
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x1661c(%rip), %rax     # 0x1b384
movzbl (%rax), %eax
movl %eax, %edx
shlq $0x3, %rdx
leaq 0x16538(%rip), %rax     # 0x1b2b0
movzbl (%rax), %eax
imulq %rax, %rdx
xorl %esi, %esi
callq 0x21e0
leaq 0x165f7(%rip), %rax     # 0x1b384
movzbl (%rax), %eax
shlq $0x0, %rax
movl %eax, %edi
movl $0x195, %esi            # imm = 0x195
callq 0x7220
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x165ca(%rip), %rax     # 0x1b384
movzbl (%rax), %eax
movl %eax, %edx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x21e0
leaq 0x165ff(%rip), %rax     # 0x1b3d0
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x8290
leaq 0x165ec(%rip), %rax     # 0x1b3d0
movq (%rax), %rax
movl 0x8(%rax), %eax
shll $0x2, %eax
leaq 0x165dc(%rip), %rcx     # 0x1b3d0
movq (%rcx), %rcx
cmpl 0xc(%rcx), %eax
jle 0x4e4a
leaq 0x165cd(%rip), %rax     # 0x1b3d0
movq (%rax), %rdi
leaq 0x165c3(%rip), %rax     # 0x1b3d0
movq (%rax), %rax
movl 0xc(%rax), %esi
shll %esi
callq 0x8620
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4e3c
xorl %edi, %edi
leaq 0x10219(%rip), %rsi     # 0x15047
movb $0x0, %al
callq 0x123f0
xorl %edi, %edi
callq 0x10180
movq -0x20(%rbp), %rcx
leaq 0x16589(%rip), %rax     # 0x1b3d0
movq %rcx, (%rax)
movl $0x4, %edi
callq 0x8790
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)