// File: /workspace/github_c_makefile_star2_O1/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)
movl $0x4, %edi
callq 0x6880
leaq 0x12f52(%rip), %r14     # 0x17330
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x668e
movq %rax, %rbx
testq %rax, %rax
jne 0x44ed
movl 0xc(%rsp), %edi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
movl $0x10, %edx
callq 0xb8b8
leaq 0xbc16(%rip), %rsi      # 0x10028
movl $0x4, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xd5b0
movl $0x58, %edi
movl $0x191, %esi            # imm = 0x191
callq 0x5d3e
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
addq $0x48, %rax
movq %rax, 0x48(%rbx)
movq %rax, 0x50(%rbx)
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movups %xmm0, 0x8(%rbx)
leaq 0x12e7e(%rip), %r15     # 0x172e4
movzbl (%r15), %eax
leaq 0x12e27(%rip), %r12     # 0x17298
movzbl (%r12), %edi
imull %eax, %edi
shll $0x3, %edi
movl $0x194, %esi            # imm = 0x194
callq 0x5d3e
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 0x5d3e
movq %rax, 0x20(%rbx)
movzbl (%r15), %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x65a4
movq (%r14), %rdi
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %esi
shll $0x2, %eax
cmpl %esi, %eax
jle 0x44ed
addl %esi, %esi
callq 0x67df
testq %rax, %rax
je 0x4506
movq %rax, (%r14)
movl $0x4, %edi
callq 0x689c
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xbb39(%rip), %rsi      # 0x10046
xorl %edi, %edi
xorl %eax, %eax
callq 0xd5b0
xorl %edi, %edi
callq 0xbd8c