// File: /workspace/github_c_makefile_star2_O2/open-mesh-mirror[P]batmand/batman.c
// Function: batman
int8_t batman(void)
{
	struct list_head *list_pos, *forw_pos_tmp;
	struct orig_node *orig_neigh_node, *orig_node;
	struct batman_if *batman_if, *if_incoming;
	struct forw_node *forw_node;
	struct bat_packet *bat_packet;
	uint32_t neigh, debug_timeout, vis_timeout, select_timeout, curr_time;
	unsigned char in[2001], *hna_recv_buff;
	char orig_str[ADDR_STR_LEN], neigh_str[ADDR_STR_LEN], ifaddr_str[ADDR_STR_LEN], prev_sender_str[ADDR_STR_LEN];
	int16_t hna_buff_len, packet_len, curr_packet_len;
	uint8_t forward_old, if_rp_filter_all_old, if_rp_filter_default_old, if_send_redirects_all_old, if_send_redirects_default_old;
	uint8_t is_my_addr, is_my_orig, is_my_oldorig, is_broadcast, is_duplicate, is_bidirectional, has_directlink_flag;
	int8_t res;


	debug_timeout = vis_timeout = get_time_msec();

	if ( NULL == ( orig_hash = hash_new( 128, compare_orig, choose_orig ) ) )
		return(-1);

	/* for profiling the functions */
	prof_init(PROF_choose_gw, "choose_gw");
	prof_init(PROF_update_routes, "update_routes");
	prof_init(PROF_update_gw_list, "update_gw_list");
	prof_init(PROF_is_duplicate, "isDuplicate");
	prof_init(PROF_get_orig_node, "get_orig_node");
	prof_init(PROF_update_originator, "update_orig");
	prof_init(PROF_purge_originator, "purge_orig");
	prof_init(PROF_schedule_forward_packet, "schedule_forward_packet");
	prof_init(PROF_send_outstanding_packets, "send_outstanding_packets");

	list_for_each(list_pos, &if_list) {
		batman_if = list_entry(list_pos, struct batman_if, list);

		batman_if->out.version = COMPAT_VERSION;
		batman_if->out.flags = 0x00;
		batman_if->out.ttl = (batman_if->if_num > 0 ? 2 : TTL);
		batman_if->out.gwflags = (batman_if->if_num > 0 ? 0 : gateway_class);
		batman_if->out.seqno = 1;
		batman_if->out.gwport = htons(GW_PORT);
		batman_if->out.tq = TQ_MAX_VALUE;

		schedule_own_packet(batman_if);
	}

	if_rp_filter_all_old = get_rp_filter("all");
	if_rp_filter_default_old = get_rp_filter("default");

	if_send_redirects_all_old = get_send_redirects("all");
	if_send_redirects_default_old = get_send_redirects("default");

	set_rp_filter(0, "all");
	set_rp_filter(0, "default");

	set_send_redirects(0, "all");
	set_send_redirects(0, "default");

	forward_old = get_forwarding();
	set_forwarding(1);

	while (!is_aborted()) {

		debug_output( 4, " \n" );

		/* harden select_timeout against sudden time change (e.g. ntpdate) */
		curr_time = get_time_msec();
		select_timeout = ((int)(((struct forw_node *)forw_list.next)->send_time - curr_time) > 0 ?
					((struct forw_node *)forw_list.next)->send_time - curr_time : 10);

		res = receive_packet(in, sizeof(in), &packet_len, &neigh, select_timeout, &if_incoming);

		/* on receive error the interface is deactivated in receive_packet() */
		if (res < 1)
			goto send_packets;

		curr_time = get_time_msec();
		curr_packet_len = 0;
		bat_packet = (struct bat_packet *)in;

		addr_to_string(neigh, neigh_str, sizeof(neigh_str));
		addr_to_string(if_incoming->addr.sin_addr.s_addr, ifaddr_str, sizeof(ifaddr_str));

		while ((curr_packet_len + (int)sizeof(struct bat_packet) <= packet_len) &&
			(curr_packet_len + (int)sizeof(struct bat_packet) + bat_packet->hna_len * 5 <= packet_len) &&
			(curr_packet_len + (int)sizeof(struct bat_packet) + bat_packet->hna_len * 5 <= MAX_AGGREGATION_BYTES)) {

			bat_packet = (struct bat_packet *)(in + curr_packet_len);
			curr_packet_len += sizeof(struct bat_packet) + bat_packet->hna_len * 5;

			/* network to host order for our 16bit seqno */
			bat_packet->seqno = ntohs(bat_packet->seqno);

			addr_to_string(bat_packet->orig, orig_str, sizeof(orig_str));
			addr_to_string(bat_packet->prev_sender, prev_sender_str, sizeof(prev_sender_str));

			is_my_addr = is_my_orig = is_my_oldorig = is_broadcast = 0;

			has_directlink_flag = (bat_packet->flags & DIRECTLINK ? 1 : 0);

			debug_output(4, "Received BATMAN packet via NB: %s, IF: %s %s (from OG: %s, via old OG: %s, seqno %d, tq %d, TTL %d, V %d, IDF %d) \n", neigh_str, if_incoming->dev, ifaddr_str, orig_str, prev_sender_str, bat_packet->seqno, bat_packet->tq, bat_packet->ttl, bat_packet->version, has_directlink_flag);

			hna_buff_len = bat_packet->hna_len * 5;
			hna_recv_buff = (hna_buff_len > 4 ? (unsigned char *)(bat_packet + 1) : NULL);

			list_for_each(list_pos, &if_list) {

				batman_if = list_entry(list_pos, struct batman_if, list);

				if (neigh == batman_if->addr.sin_addr.s_addr)
					is_my_addr = 1;

				if (bat_packet->orig == batman_if->addr.sin_addr.s_addr)
					is_my_orig = 1;

				if (neigh == batman_if->broad.sin_addr.s_addr)
					is_broadcast = 1;

				if (bat_packet->prev_sender == batman_if->addr.sin_addr.s_addr)
					is_my_oldorig = 1;

			}


			if (bat_packet->gwflags != 0)
				debug_output(4, "Is an internet gateway (class %i) \n", bat_packet->gwflags);

			if (bat_packet->version != COMPAT_VERSION) {
				debug_output(4, "Drop packet: incompatible batman version (%i) \n", bat_packet->version);
				goto send_packets;
			}

			if (is_my_addr) {
				debug_output(4, "Drop packet: received my own broadcast (sender: %s) \n", neigh_str);
				goto send_packets;
			}

			if (is_broadcast) {
				debug_output(4, "Drop packet: ignoring all packets with broadcast source IP (sender: %s) \n", neigh_str);
				goto send_packets;
			}

			if (is_my_orig) {
				orig_neigh_node = get_orig_node(neigh);

				if ((has_directlink_flag) && (if_incoming->addr.sin_addr.s_addr == bat_packet->orig) && (bat_packet->seqno - if_incoming->out.seqno + 2 == 0)) {

					debug_output(4, "count own bcast (is_my_orig): old = %i, ", orig_neigh_node->bcast_own_sum[if_incoming->if_num]);

					bit_mark((TYPE_OF_WORD *)&(orig_neigh_node->bcast_own[if_incoming->if_num * num_words]), 0);
					orig_neigh_node->bcast_own_sum[if_incoming->if_num] = bit_packet_count((TYPE_OF_WORD *)&(orig_neigh_node->bcast_own[if_incoming->if_num * num_words]));

					debug_output(4, "new = %i \n", orig_neigh_node->bcast_own_sum[if_incoming->if_num]);

				}

				debug_output(4, "Drop packet: originator packet from myself (via neighbour) \n");
				goto send_packets;
			}

			if (bat_packet->tq == 0) {
				count_real_packets(bat_packet, neigh, if_incoming);

				debug_output(4, "Drop packet: originator packet with tq is 0 \n");
				goto send_packets;
			}

			if (is_my_oldorig) {
				debug_output(4, "Drop packet: ignoring all rebroadcast echos (sender: %s) \n", neigh_str);
				goto send_packets;
			}

			is_duplicate = count_real_packets(bat_packet, neigh, if_incoming);

			orig_node = get_orig_node(bat_packet->orig);

			/* if sender is a direct neighbor the sender ip equals originator ip */
			orig_neigh_node = (bat_packet->orig == neigh ? orig_node : get_orig_node(neigh));

			/* drop packet if sender is not a direct neighbor and if we no route towards it */
			if ((bat_packet->orig != neigh) && (orig_neigh_node->router == NULL)) {
				debug_output(4, "Drop packet: OGM via unknown neighbor! \n");
				goto send_packets;
			}

			is_bidirectional = isBidirectionalNeigh(orig_node, orig_neigh_node, bat_packet, curr_time, if_incoming);

			/* update ranking if it is not a duplicate or has the same seqno and similar ttl as the non-duplicate */
			if ((is_bidirectional) && ((!is_duplicate) ||
			     ((orig_node->last_real_seqno == bat_packet->seqno) &&
			     (orig_node->last_ttl - 3 <= bat_packet->ttl))))
				update_orig(orig_node, bat_packet, neigh, if_incoming, hna_recv_buff, hna_buff_len, is_duplicate, curr_time);

			/* is single hop (direct) neighbour */
			if (bat_packet->orig == neigh) {

				/* mark direct link on incoming interface */
				schedule_forward_packet(orig_node, bat_packet, neigh, 1, hna_buff_len, if_incoming, curr_time);

				debug_output(4, "Forward packet: rebroadcast neighbour packet with direct link flag \n");
				goto send_packets;
			}

			/* multihop originator */
			if (!is_bidirectional) {
				debug_output(4, "Drop packet: not received via bidirectional link\n");
				goto send_packets;
			}

			if (is_duplicate) {
				debug_output(4, "Drop packet: duplicate packet received\n");
				goto send_packets;
			}

			debug_output(4, "Forward packet: rebroadcast originator packet \n");

			schedule_forward_packet(orig_node, bat_packet, neigh, 0, hna_buff_len, if_incoming, curr_time);

		}


send_packets:
		send_outstanding_packets(curr_time);

		if ((int)(curr_time - (debug_timeout + 1000)) > 0) {

			debug_timeout = curr_time;

			purge_orig( curr_time );

			debug_orig();

			check_inactive_interfaces();

			if ( debug_clients.clients_num[4] > 0 ) {

				checkIntegrity();
				prof_print();

			}

			if ( ( routing_class != 0 ) && ( curr_gateway == NULL ) )
				choose_gw();

			if ((vis_if.sock) && ((int)(curr_time - (vis_timeout + 10000)) > 0)) {

				vis_timeout = curr_time;
				send_vis_packet();

			}

			hna_local_task_exec();
		}

	}

	if (debug_level > 0)
		printf("Deleting all BATMAN routes\n");

	purge_orig(get_time_msec() + (5 * purge_timeout) + originator_interval);

	hash_destroy(orig_hash);

	list_for_each_safe(list_pos, forw_pos_tmp, &forw_list) {

		forw_node = list_entry(list_pos, struct forw_node, list);

		list_del((struct list_head *)&forw_list, list_pos, &forw_list);

		debugFree(forw_node->pack_buff, 1105);
		debugFree(forw_node, 1106);
	}

	if (vis_packet != NULL)
		debugFree(vis_packet, 1108);

	set_forwarding( forward_old );

	set_rp_filter( if_rp_filter_all_old, "all" );
	set_rp_filter( if_rp_filter_default_old, "default" );

	set_send_redirects( if_send_redirects_all_old, "all" );
	set_send_redirects( if_send_redirects_default_old, "default" );

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8a8, %rsp            # imm = 0x8A8
callq 0xa9e4
movl %eax, 0x1c(%rsp)
leaq 0xd4a(%rip), %rsi       # 0x40f4
leaq 0xd4d(%rip), %rdx       # 0x40fe
movl $0x80, %edi
callq 0x6095
movq %rax, 0x13f6e(%rip)     # 0x17330
testq %rax, %rax
je 0x3f59
leaq 0xb7b6(%rip), %rsi      # 0xeb88
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x6388
leaq 0xb7b0(%rip), %rsi      # 0xeb92
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0x6388
leaq 0xb7ab(%rip), %rsi      # 0xeba0
pushq $0x2
popq %rbx
movl %ebx, %edi
callq 0x6388
leaq 0xb7a9(%rip), %rsi      # 0xebaf
pushq $0x3
popq %rdi
callq 0x6388
leaq 0xb7a6(%rip), %rsi      # 0xebbb
pushq $0x4
popq %rdi
callq 0x6388
leaq 0xb7a5(%rip), %rsi      # 0xebc9
pushq $0x5
popq %rdi
callq 0x6388
leaq 0xb7a2(%rip), %rsi      # 0xebd5
pushq $0x6
popq %rdi
callq 0x6388
leaq 0xb79e(%rip), %rsi      # 0xebe0
pushq $0x7
popq %rdi
callq 0x6388
leaq 0xb7a7(%rip), %rsi      # 0xebf8
pushq $0x8
popq %rdi
callq 0x6388
leaq 0x13eb0(%rip), %r12     # 0x17310
pushq $0x32
popq %r13
movq %r12, %r15
movq (%r15), %r15
cmpq %r12, %r15
je 0x34aa
movw $0x5, 0x56(%r15)
cmpb $0x0, 0x1c(%r15)
movl %ebx, %eax
cmovel %r13d, %eax
movb %al, 0x58(%r15)
movzbl 0x13e2d(%rip), %eax     # 0x172b9
cmovnel %ebp, %eax
movb %al, 0x59(%r15)
movl $0xd2100001, 0x5a(%r15) # imm = 0xD2100001
movb $-0x1, 0x66(%r15)
movq %r15, %rdi
callq 0x4f74
jmp 0x3467
leaq 0xb760(%rip), %rbx      # 0xec11
movq %rbx, %rdi
callq 0x8d7a
movl %eax, 0x44(%rsp)
leaq 0xb751(%rip), %r15      # 0xec15
movq %r15, %rdi
callq 0x8d7a
movl %eax, 0x48(%rsp)
movq %rbx, %rdi
callq 0x8ea1
movl %eax, 0x4c(%rsp)
movq %r15, %rdi
callq 0x8ea1
movl %eax, 0x50(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x8cbc
xorl %edi, %edi
movq %r15, %rsi
callq 0x8cbc
xorl %edi, %edi
movq %rbx, %rsi
callq 0x8e27
xorl %edi, %edi
movq %r15, %rsi
callq 0x8e27
callq 0x8eff
movl %eax, 0x40(%rsp)
movl %r14d, %edi
callq 0x8ef1
leaq 0xd0(%rsp), %r15
movl 0x1c(%rsp), %eax
movl %eax, %r12d
movl %r12d, 0x54(%rsp)
callq 0xb07c
testb %al, %al
jne 0x3e68
pushq $0x4
popq %rdi
leaq 0xbb68(%rip), %rsi      # 0xf0b4
xorl %eax, %eax
callq 0xcb1c
callq 0xa9e4
movl %eax, %r12d
movq 0x13dd6(%rip), %rax     # 0x17338
movl 0x8(%rax), %r8d
subl %r12d, %r8d
testl %r8d, %r8d
pushq $0xa
popq %rax
cmovlel %eax, %r8d
movq %r15, %rdi
movl $0x7d1, %esi            # imm = 0x7D1
leaq 0x2e(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x10(%rsp), %r9
callq 0xb163
testb %al, %al
jle 0x3c1f
callq 0xa9e4
movl %eax, %r12d
movl 0x8(%rsp), %edi
leaq 0x60(%rsp), %rsi
pushq $0x10
popq %rbx
movl %ebx, %edx
callq 0xb04f
movq 0x10(%rsp), %rax
movl 0x34(%rax), %edi
leaq 0x90(%rsp), %rsi
movl %ebx, %edx
callq 0xb04f
xorl %ebp, %ebp
movq %r12, 0x30(%rsp)
movswl %bp, %eax
addl $0x12, %eax
movswl 0x2e(%rsp), %ecx
cmpl %ecx, %eax
jg 0x3c17
movzbl 0x11(%r15), %edx
leal (%rdx,%rdx,4), %edx
addl %eax, %edx
cmpl %ecx, %edx
jg 0x3c17
cmpl $0x200, %edx            # imm = 0x200
jg 0x3c17
movswq %bp, %rax
movq %rax, 0x20(%rsp)
leaq (%rsp,%rax), %r15
addq $0xd0, %r15
movzbl 0x11(%r15), %eax
movl %eax, 0x58(%rsp)
rolw $0x8, 0x4(%r15)
addl $0x12, %ebp
movq %rbp, 0x78(%rsp)
movl 0x8(%r15), %edi
leaq 0xa0(%rsp), %rsi
pushq $0x10
popq %rbx
movl %ebx, %edx
callq 0xb04f
movl 0xc(%r15), %edi
leaq 0x80(%rsp), %rsi
movl %ebx, %edx
callq 0xb04f
movzbl 0x1(%r15), %r13d
shrl $0x6, %r13d
andl $0x1, %r13d
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rcx
movzwl 0x4(%r15), %r10d
movzbl 0x10(%r15), %r11d
movzbl 0x2(%r15), %r12d
movzbl (%r15), %ebp
xorl %ebx, %ebx
pushq $0x4
popq %rdi
leaq 0xb593(%rip), %rsi      # 0xec1d
leaq 0x60(%rsp), %rdx
leaq 0x90(%rsp), %r8
leaq 0xa0(%rsp), %r9
xorl %eax, %eax
movq %r13, 0x38(%rsp)
pushq %r13
pushq %rbp
pushq %r12
pushq %r11
pushq %r10
leaq 0xa8(%rsp), %r10
pushq %r10
callq 0xcb1c
addq $0x30, %rsp
movzbl 0x11(%r15), %eax
leal (%rax,%rax,4), %ecx
movl %ecx, 0x5c(%rsp)
movq 0x20(%rsp), %rcx
leaq (%rsp,%rcx), %r8
addq $0xe2, %r8
movl 0x8(%rsp), %ecx
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r12d, %r12d
leaq 0x13c1f(%rip), %rdi     # 0x17310
movq %rdi, %rdx
movq (%rdx), %rdx
cmpq %rdi, %rdx
je 0x372d
movl 0x34(%rdx), %esi
cmpl %esi, %ecx
movzbl %bl, %ebx
cmovel %r14d, %ebx
cmpl %esi, 0x8(%r15)
movzbl %r13b, %r13d
cmovel %r14d, %r13d
cmpl 0x44(%rdx), %ecx
movzbl %r12b, %r12d
cmovel %r14d, %r12d
cmpl %esi, 0xc(%r15)
movzbl %bpl, %ebp
cmovel %r14d, %ebp
jmp 0x36f4
testb %al, %al
movl $0x0, %eax
cmoveq %rax, %r8
movzbl 0x3(%r15), %edx
testl %edx, %edx
movq %r8, 0x70(%rsp)
je 0x3757
pushq $0x4
popq %rdi
leaq 0xb541(%rip), %rsi      # 0xec91
xorl %eax, %eax
callq 0xcb1c
movzbl (%r15), %edx
cmpl $0x5, %edx
jne 0x3a58
testb %bl, %bl
jne 0x3a6b
testb %r12b, %r12b
jne 0x3a77
testb %r13b, %r13b
movq 0x30(%rsp), %r12
jne 0x3a9f
cmpb $0x0, 0x10(%r15)
je 0x3b7b
testb %bpl, %bpl
jne 0x3b98
movl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x3f6d
movl %eax, %ebx
movl 0x8(%r15), %edi
callq 0x4137
movl 0x8(%rsp), %edi
cmpl %edi, 0x8(%r15)
movq %rax, 0x20(%rsp)
movb %bl, 0xf(%rsp)
jne 0x37d3
movq %rax, %r8
movq 0x10(%rsp), %r13
movq %rax, %rbp
jmp 0x3825
callq 0x4137
movq %rax, %rbp
movl 0x8(%r15), %eax
cmpl 0x8(%rsp), %eax
je 0x37f0
cmpq $0x0, 0x8(%rbp)
je 0x3c06
movq 0x10(%rsp), %r13
movq 0x20(%rsp), %r8
cmpq %rbp, %r8
je 0x3825
movq %rbp, %rax
addq $0x48, %rax
movq %rax, %rcx
xorl %ebx, %ebx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x386f
movl 0x8(%rcx), %edx
cmpl (%rbp), %edx
jne 0x380b
cmpq %r13, 0x30(%rcx)
cmoveq %rcx, %rbx
jmp 0x380b
movq %r8, %rax
addq $0x48, %rax
movq %rax, %rcx
xorl %ebx, %ebx
movq (%rcx), %rcx
cmpq %rax, %rcx
je 0x384b
movl 0x8(%rcx), %edx
cmpl (%rbp), %edx
jne 0x3831
cmpq %r13, 0x30(%rcx)
cmoveq %rcx, %rbx
jmp 0x3831
testq %rbx, %rbx
jne 0x3869
movl (%rbp), %edx
movq %r8, %rdi
movq %rbp, %rsi
movq %r13, %rcx
callq 0x4034
movq 0x20(%rsp), %r8
movq %rax, %rbx
movl %r12d, 0x1c(%rbx)
jmp 0x388d
testq %rbx, %rbx
jne 0x388d
movl (%rbp), %edx
movq %rbp, %rdi
movq %rbp, %rsi
movq %r13, %rcx
callq 0x4034
movq 0x20(%rsp), %r8
movq %rax, %rbx
movl %r12d, 0x30(%r8)
movq 0x20(%rbp), %rax
movzbl 0x1c(%r13), %ecx
movzbl (%rax,%rcx), %eax
movzbl 0xc(%rbx), %esi
cmpb %sil, %al
movl %esi, %edx
cmovbl %eax, %edx
xorl %ecx, %ecx
movzbl %dl, %edi
cmpb 0x139df(%rip), %dl      # 0x17294
jb 0x38cd
cmpb 0x139d7(%rip), %sil     # 0x17295
jb 0x38cd
imull $0xff, %edi, %eax
xorl %edx, %edx
divw %si
movl %eax, %ecx
movb %cl, 0x28(%rbp)
movzbl 0x139c0(%rip), %eax     # 0x17297
movzwl %si, %edx
movl %eax, %esi
imull %eax, %esi
imull %eax, %esi
subl %edx, %eax
movl %eax, %edx
imull %eax, %edx
imull %eax, %edx
imull $0xff, %edx, %eax
cltd
idivl %esi
movl $0xff, %edx
subl %eax, %edx
movl %edx, 0x2c(%rbp)
movzbl 0x10(%r15), %esi
movzbl %cl, %eax
imull %esi, %eax
imull %edx, %eax
cltd
movl $0xfe01, %ecx           # imm = 0xFE01
idivl %ecx
movb %al, 0x10(%r15)
movl %edi, 0x38(%rsp)
movl (%r8), %edi
leaq 0xb0(%rsp), %rsi
pushq $0x10
popq %r12
movl %r12d, %edx
callq 0xb04f
movl (%rbp), %edi
leaq 0xc0(%rsp), %r13
movq %r13, %rsi
movl %r12d, %edx
callq 0xb04f
movzbl 0xc(%rbx), %r9d
movzbl 0x28(%rbp), %r10d
movl 0x2c(%rbp), %r11d
movzbl 0x10(%r15), %ebx
subq $0x8, %rsp
pushq $0x4
popq %rdi
leaq 0xb5f2(%rip), %rsi      # 0xef5d
leaq 0xb8(%rsp), %rdx
movq %r13, %rcx
movl 0x40(%rsp), %r8d
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq %r10
callq 0xcb1c
addq $0x20, %rsp
cmpb $0x0, 0x10(%r15)
movzwl 0x5c(%rsp), %ebx
je 0x3bb0
movb 0xf(%rsp), %r13b
testb %r13b, %r13b
movq 0x30(%rsp), %r12
movq 0x20(%rsp), %r8
je 0x39cc
movzwl 0x42(%r8), %eax
cmpw 0x4(%r15), %ax
jne 0x39f8
movzbl 0x44(%r8), %eax
addl $-0x3, %eax
movzbl 0x2(%r15), %ecx
cmpl %ecx, %eax
jg 0x39f8
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %rcx
movzbl %r13b, %eax
movq %r8, %rdi
movq %r15, %rsi
movq 0x70(%rsp), %r8
movl %ebx, %r9d
pushq %r12
pushq %rax
callq 0x4290
movq 0x30(%rsp), %r8
addq $0x10, %rsp
movl 0x8(%r15), %edx
cmpl 0x8(%rsp), %edx
movq 0x78(%rsp), %rbp
je 0x3bc4
testb %r13b, %r13b
jne 0x3bee
movzwl 0x58(%rsp), %eax
leal (%rax,%rax,4), %eax
addl %eax, %ebp
pushq $0x4
popq %rdi
leaq 0xb4df(%rip), %rsi      # 0xef07
xorl %eax, %eax
movq %r8, %r13
callq 0xcb1c
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %r9
subq $0x8, %rsp
movq %r13, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
movl %ebx, %r8d
pushq %r12
callq 0x517f
popq %rax
popq %rcx
jmp 0x35d0
pushq $0x4
popq %rdi
leaq 0xb253(%rip), %rsi      # 0xecb5
xorl %eax, %eax
callq 0xcb1c
jmp 0x3a8d
pushq $0x4
popq %rdi
leaq 0xb270(%rip), %rsi      # 0xece5
jmp 0x3a81
pushq $0x4
popq %rdi
leaq 0xb29a(%rip), %rsi      # 0xed1b
leaq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0xcb1c
leaq 0xd0(%rsp), %r15
movq 0x30(%rsp), %r12
jmp 0x3c1f
movl 0x8(%rsp), %edi
callq 0x4137
cmpb $0x0, 0x38(%rsp)
je 0x3b6c
movq %rax, %rbx
movq 0x10(%rsp), %rax
movl 0x34(%rax), %ecx
cmpl 0x8(%r15), %ecx
jne 0x3b6c
movzwl 0x4(%r15), %ecx
movzwl 0x5a(%rax), %edx
subl %edx, %ecx
cmpl $-0x2, %ecx
jne 0x3b6c
movq 0x20(%rbx), %rcx
movzbl 0x1c(%rax), %eax
movzbl (%rcx,%rax), %edx
pushq $0x4
popq %rbp
movl %ebp, %edi
leaq 0xb271(%rip), %rsi      # 0xed65
xorl %eax, %eax
callq 0xcb1c
movq 0x10(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x1378d(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0x5d0a
movq 0x10(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x1376c(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%rbx), %rdi
callq 0x5ea9
movq 0x20(%rbx), %rcx
movq 0x10(%rsp), %rdx
movzbl 0x1c(%rdx), %edx
movb %al, (%rcx,%rdx)
movq 0x20(%rbx), %rax
movq 0x10(%rsp), %rcx
movzbl 0x1c(%rcx), %ecx
movzbl (%rax,%rcx), %edx
movl %ebp, %edi
leaq 0xb229(%rip), %rsi      # 0xed8e
xorl %eax, %eax
callq 0xcb1c
pushq $0x4
popq %rdi
leaq 0xb223(%rip), %rsi      # 0xed99
jmp 0x3c10
movl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x3f6d
pushq $0x4
popq %rdi
leaq 0xb240(%rip), %rsi      # 0xedd6
jmp 0x3c10
pushq $0x4
popq %rdi
leaq 0xb262(%rip), %rsi      # 0xee04
leaq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0xcb1c
jmp 0x3c17
movl 0x8(%r15), %edx
cmpl 0x8(%rsp), %edx
movq 0x30(%rsp), %r12
movq 0x20(%rsp), %r8
jne 0x3bfa
movq 0x10(%rsp), %r9
subq $0x8, %rsp
movq %r8, %rdi
movq %r15, %rsi
movl %r14d, %ecx
movl %ebx, %r8d
pushq %r12
callq 0x517f
popq %rax
popq %rcx
pushq $0x4
popq %rdi
leaq 0xb27c(%rip), %rsi      # 0xee68
jmp 0x3c10
pushq $0x4
popq %rdi
leaq 0xb2e7(%rip), %rsi      # 0xeedf
jmp 0x3c10
pushq $0x4
popq %rdi
leaq 0xb2a9(%rip), %rsi      # 0xeead
jmp 0x3c10
pushq $0x4
popq %rdi
leaq 0xb22f(%rip), %rsi      # 0xee3f
xorl %eax, %eax
callq 0xcb1c
leaq 0xd0(%rsp), %r15
movl %r12d, %edi
callq 0x5469
movl %r12d, %eax
subl 0x54(%rsp), %eax
addl $0xfffffc18, %eax       # imm = 0xFFFFFC18
testl %eax, %eax
jle 0x3535
movl %r12d, %edi
callq 0x451c
callq 0x48de
callq 0xa94b
movq 0x136fc(%rip), %rax     # 0x17350
cmpw $0x0, 0x8(%rax)
jle 0x3c65
callq 0x5784
callq 0x63f1
cmpb $0x0, 0x1364e(%rip)     # 0x172ba
je 0x3c7d
cmpq $0x0, 0x1364a(%rip)     # 0x172c0
jne 0x3c7d
callq 0x2bd6
cmpl $0x0, 0x136dc(%rip)     # 0x17360
je 0x3e5e
movl %r12d, %eax
subl 0x1c(%rsp), %eax
addl $0xffffd8f0, %eax       # imm = 0xFFFFD8F0
testl %eax, %eax
jle 0x3e5e
movq %r12, %r13
movq %r15, %r12
movq 0x13645(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x3cc2
movl $0x44e, %esi            # imm = 0x44E
callq 0x5b1a
andq $0x0, 0x1362e(%rip)     # 0x172f0
movw $0x7, 0x1362d(%rip)     # 0x172f8
pushq $0x7
popq %rdi
pushq $0x68
popq %rsi
callq 0x58c9
movq %rax, 0x13613(%rip)     # 0x172f0
movq 0x1362c(%rip), %rcx     # 0x17310
movl 0x34(%rcx), %ecx
movl %ecx, (%rax)
movq 0x13600(%rip), %rax     # 0x172f0
movb $0x17, 0x4(%rax)
movb 0x135bf(%rip), %cl      # 0x172b9
movb %cl, 0x5(%rax)
movb $-0x1, 0x6(%rax)
xorl %ebx, %ebx
movq 0x13626(%rip), %rdi     # 0x17330
movq %rbx, %rsi
callq 0x5f8c
testq %rax, %rax
je 0x3d82
movq %rax, %rbx
movq 0x8(%rax), %rax
movq (%rax), %r15
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x3d03
movl (%r15), %ecx
cmpl 0x8(%rax), %ecx
jne 0x3d03
cmpb $0x0, 0x19(%rax)
je 0x3d03
movzwl 0x135b9(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x135af(%rip)      # 0x172f8
movq 0x135a0(%rip), %rdi     # 0x172f0
movzwl %ax, %esi
pushq $0x69
popq %rdx
callq 0x5a06
movq %rax, 0x1358e(%rip)     # 0x172f0
movzwl 0x1358f(%rip), %ecx     # 0x172f8
movl (%r15), %edx
movl %edx, -0x4(%rax,%rcx)
movq 0x8(%r15), %rdx
movb 0x19(%rdx), %dl
movb %dl, -0x5(%rax,%rcx)
movb $0x1, -0x6(%rax,%rcx)
jmp 0x3d03
cmpb $0x2, 0x1355b(%rip)     # 0x172e4
movq %r12, %r15
leaq 0x1357d(%rip), %rsi     # 0x17310
movq %r13, %r12
jb 0x3df2
movq %rsi, %rbx
movq (%rbx), %rbx
cmpq %rsi, %rbx
je 0x3df2
movq 0x13546(%rip), %rdi     # 0x172f0
movl (%rdi), %eax
cmpl 0x34(%rbx), %eax
je 0x3d9b
movzwl 0x13540(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x13536(%rip)      # 0x172f8
movzwl %ax, %esi
pushq $0x6a
popq %rdx
callq 0x5a06
leaq 0x1353c(%rip), %rsi     # 0x17310
movq %rax, 0x13515(%rip)     # 0x172f0
movzwl 0x13516(%rip), %ecx     # 0x172f8
movl 0x34(%rbx), %edx
movl %edx, -0x4(%rax,%rcx)
movw $0x2, -0x6(%rax,%rcx)
jmp 0x3d9b
movq 0x134f7(%rip), %rdi     # 0x172f0
leaq 0x134f8(%rip), %rsi     # 0x172f8
callq 0x6acc
movq %rax, 0x134e4(%rip)     # 0x172f0
movzwl 0x134e5(%rip), %esi     # 0x172f8
cmpl $0x7, %esi
jne 0x3e37
movq %rax, %rdi
movl $0x453, %esi            # imm = 0x453
callq 0x5b1a
andq $0x0, 0x134c3(%rip)     # 0x172f0
andw $0x0, 0x134c3(%rip)     # 0x172f8
jmp 0x3e59
movl %r12d, 0x1c(%rsp)
testq %rax, %rax
je 0x3e5e
movl 0x13519(%rip), %ecx     # 0x17360
movq %rax, %rdi
leaq 0x13513(%rip), %rdx     # 0x17364
xorl %r8d, %r8d
callq 0xb2dd
movl %r12d, 0x1c(%rsp)
callq 0x67aa
jmp 0x3530
cmpb $0x0, 0x13449(%rip)     # 0x172b8
je 0x3e7d
leaq 0xb166(%rip), %rdi      # 0xefde
callq 0x20c0
callq 0xa9e4
imull $0x5, 0x13407(%rip), %ecx # 0x17290
movswl 0x133fa(%rip), %edi     # 0x1728a
addl %eax, %edi
addl %ecx, %edi
callq 0x451c
movq 0x13490(%rip), %rdi     # 0x17330
callq 0x5f63
movq 0x1348c(%rip), %r14     # 0x17338
leaq 0x13485(%rip), %rbx     # 0x17338
cmpq %rbx, %r14
je 0x3ee9
movq (%r14), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5763
movq 0x10(%r14), %rdi
movl $0x451, %esi            # imm = 0x451
callq 0x5b1a
movq %r14, %rdi
movl $0x452, %esi            # imm = 0x452
callq 0x5b1a
movq %r15, %r14
jmp 0x3eb3
movq 0x13400(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x3eff
movl $0x454, %esi            # imm = 0x454
callq 0x5b1a
movl $0xff, %ebp
movl 0x40(%rsp), %edi
andl %ebp, %edi
callq 0x8ef1
movl 0x44(%rsp), %edi
andl %ebp, %edi
leaq 0xacf5(%rip), %rbx      # 0xec11
movq %rbx, %rsi
callq 0x8cbc
movl 0x48(%rsp), %edi
andl %ebp, %edi
leaq 0xace4(%rip), %r14      # 0xec15
movq %r14, %rsi
callq 0x8cbc
movl 0x4c(%rsp), %edi
andl %ebp, %edi
movq %rbx, %rsi
callq 0x8e27
movl 0x50(%rsp), %edi
andl %ebp, %edi
movq %r14, %rsi
callq 0x8e27
xorl %eax, %eax
jmp 0x3f5b
movb $-0x1, %al
addq $0x8a8, %rsp            # imm = 0x8A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq