// File: /workspace/github_c_makefile_star2_O3/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 0x6bbc
leaq 0x12f45(%rip), %r14     # 0x17330
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x69d3
movq %rax, %rbx
testq %rax, %rax
jne 0x44fe
movl 0xc(%rsp), %edi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
movl $0x10, %edx
callq 0xbbac
leaq 0xbc09(%rip), %rsi      # 0x10028
movl $0x4, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xd88c
movl $0x58, %edi
movl $0x191, %esi            # imm = 0x191
callq 0x5d52
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movq $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 0x12e6d(%rip), %r15     # 0x172e4
movzbl (%r15), %eax
leaq 0x12e16(%rip), %r12     # 0x17298
movzbl (%r12), %edi
imull %eax, %edi
shll $0x3, %edi
movl $0x194, %esi            # imm = 0x194
callq 0x5d52
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 0x5d52
movq %rax, 0x20(%rbx)
movzbl (%r15), %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x21c0
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x68f0
movq (%r14), %rdi
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %esi
shll $0x2, %eax
cmpl %esi, %eax
jle 0x44fe
addl %esi, %esi
callq 0x6b1a
testq %rax, %rax
je 0x4517
movq %rax, (%r14)
movl $0x4, %edi
callq 0x6bd8
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xbb28(%rip), %rsi      # 0x10046
xorl %edi, %edi
xorl %eax, %eax
callq 0xd88c
xorl %edi, %edi
callq 0xc084