// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0xc(%rsp), %rbx
movl %edi, (%rbx)
pushq $0x4
popq %rdi
callq 0x63a8
leaq 0x131d8(%rip), %r14     # 0x17330
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x61eb
movq %rax, %rbx
testq %rax, %rax
jne 0x4262
movl 0xc(%rsp), %edi
leaq 0x10(%rsp), %rbx
pushq $0x10
popq %rdx
movq %rbx, %rsi
callq 0xb04f
leaq 0xae9e(%rip), %rsi      # 0xf028
pushq $0x4
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xcb1c
pushq $0x58
popq %rdi
movl $0x191, %esi            # imm = 0x191
callq 0x58c9
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
andq $0x0, 0x40(%rax)
addq $0x48, %rax
movq %rax, 0x48(%rbx)
movq %rax, 0x50(%rbx)
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movups %xmm0, 0x8(%rbx)
leaq 0x13109(%rip), %r15     # 0x172e4
movzbl (%r15), %eax
leaq 0x130b2(%rip), %r12     # 0x17298
movzbl (%r12), %edi
imull %eax, %edi
shll $0x3, %edi
movl $0x194, %esi            # imm = 0x194
callq 0x58c9
movq %rax, 0x18(%rbx)
movzbl (%r15), %ecx
movzbl (%r12), %edx
imull %ecx, %edx
shll $0x3, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
movzbl (%r15), %edi
movl $0x195, %esi            # imm = 0x195
callq 0x58c9
movq %rax, 0x20(%rbx)
movzbl (%r15), %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x6102
movq (%r14), %rdi
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %esi
shll $0x2, %eax
cmpl %esi, %eax
jle 0x4262
addl %esi, %esi
callq 0x6320
testq %rax, %rax
je 0x4279
movq %rax, (%r14)
pushq $0x4
popq %rdi
callq 0x63c4
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xadc6(%rip), %rsi      # 0xf046
xorl %edi, %edi
xorl %eax, %eax
callq 0xcb1c
xorl %edi, %edi
callq 0xb4f2