// File: /workspace/github_c_makefile_star2_O3/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 0xb3f0
movl %eax, 0x2c(%rsp)
leaq 0xe8d(%rip), %rsi       # 0x4380
leaq 0xe90(%rip), %rdx       # 0x438a
movl $0x80, %edi
callq 0x6864
movq %rax, 0x13e25(%rip)     # 0x17330
testq %rax, %rax
je 0x3785
leaq 0xc66d(%rip), %rsi      # 0xfb88
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x6b9c
leaq 0xc667(%rip), %rsi      # 0xfb92
movl $0x1, %edi
callq 0x6b9c
leaq 0xc664(%rip), %rsi      # 0xfba0
movl $0x2, %edi
callq 0x6b9c
leaq 0xc662(%rip), %rsi      # 0xfbaf
movl $0x3, %edi
callq 0x6b9c
leaq 0xc65d(%rip), %rsi      # 0xfbbb
movl $0x4, %edi
callq 0x6b9c
leaq 0xc65a(%rip), %rsi      # 0xfbc9
movl $0x5, %edi
callq 0x6b9c
leaq 0xc655(%rip), %rsi      # 0xfbd5
movl $0x6, %edi
callq 0x6b9c
leaq 0xc64f(%rip), %rsi      # 0xfbe0
movl $0x7, %edi
callq 0x6b9c
leaq 0xc656(%rip), %rsi      # 0xfbf8
movl $0x8, %edi
callq 0x6b9c
movq 0x13d5d(%rip), %rbx     # 0x17310
leaq 0x13d56(%rip), %r12     # 0x17310
cmpq %r12, %rbx
je 0x3603
movl $0x32, %r14d
movw $0x5, 0x56(%rbx)
cmpb $0x0, 0x1c(%rbx)
movl $0x2, %eax
cmovel %r14d, %eax
movb %al, 0x58(%rbx)
movzbl 0x13cd7(%rip), %eax     # 0x172b9
cmovnel %ebp, %eax
movb %al, 0x59(%rbx)
movl $0xd2100001, 0x5a(%rbx) # imm = 0xD2100001
movb $-0x1, 0x66(%rbx)
movq %rbx, %rdi
callq 0x5338
movq (%rbx), %rbx
cmpq %r12, %rbx
jne 0x35c5
leaq 0xc607(%rip), %rbx      # 0xfc11
movq %rbx, %rdi
callq 0x96c4
movl %eax, 0x40(%rsp)
leaq 0xc5f8(%rip), %r14      # 0xfc15
movq %r14, %rdi
callq 0x96c4
movl %eax, 0x44(%rsp)
movq %rbx, %rdi
callq 0x97f2
movl %eax, 0x48(%rsp)
movq %r14, %rdi
callq 0x97f2
movl %eax, 0x4c(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x9604
xorl %edi, %edi
movq %r14, %rsi
callq 0x9604
xorl %edi, %edi
movq %rbx, %rsi
callq 0x9776
xorl %edi, %edi
movq %r14, %rsi
callq 0x9776
callq 0x9852
movl %eax, 0x3c(%rsp)
movl $0x1, %r13d
movl $0x1, %edi
callq 0x9844
callq 0xbbdb
testb %al, %al
je 0x3799
cmpb $0x0, 0x13c22(%rip)     # 0x172b8
je 0x36a4
leaq 0xc93f(%rip), %rdi      # 0xffde
callq 0x20c0
callq 0xb3f0
movl 0x13be1(%rip), %ecx     # 0x17290
leal (%rcx,%rcx,4), %ecx
movswl 0x13bd1(%rip), %edi     # 0x1728a
addl %eax, %edi
addl %ecx, %edi
callq 0x47e2
movq 0x13c67(%rip), %rdi     # 0x17330
callq 0x6718
movq 0x13c63(%rip), %r14     # 0x17338
leaq 0x13c5c(%rip), %rbx     # 0x17338
cmpq %rbx, %r14
je 0x3715
movq (%r14), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5be3
movq 0x10(%r14), %rdi
movl $0x451, %esi            # imm = 0x451
callq 0x628b
movq %r14, %rdi
movl $0x452, %esi            # imm = 0x452
callq 0x628b
movq %r15, %r14
cmpq %rbx, %r15
jne 0x36e1
movq 0x13bd4(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x372b
movl $0x454, %esi            # imm = 0x454
callq 0x628b
movl $0xff, %ebp
movl 0x3c(%rsp), %edi
andl %ebp, %edi
callq 0x9844
movl 0x40(%rsp), %edi
andl %ebp, %edi
leaq 0xc4c9(%rip), %rbx      # 0xfc11
movq %rbx, %rsi
callq 0x9604
movl 0x44(%rsp), %edi
andl %ebp, %edi
leaq 0xc4b8(%rip), %r14      # 0xfc15
movq %r14, %rsi
callq 0x9604
movl 0x48(%rsp), %edi
andl %ebp, %edi
movq %rbx, %rsi
callq 0x9776
movl 0x4c(%rsp), %edi
andl %ebp, %edi
movq %r14, %rsi
callq 0x9776
xorl %eax, %eax
jmp 0x3787
movb $-0x1, %al
addq $0x8a8, %rsp            # imm = 0x8A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd0(%rsp), %rbx
movl 0x2c(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl $0x4, %edi
leaq 0xc8ff(%rip), %rsi      # 0x100b4
xorl %eax, %eax
callq 0xd88c
callq 0xb3f0
movl %eax, %r15d
movq 0x13b6d(%rip), %rax     # 0x17338
movl 0x8(%rax), %r8d
subl %r15d, %r8d
testl %r8d, %r8d
movl $0xa, %eax
cmovlel %eax, %r8d
movq %rbx, %rdi
movl $0x7d1, %esi            # imm = 0x7D1
leaq 0x1a(%rsp), %rdx
movq %rsp, %rcx
leaq 0x8(%rsp), %r9
callq 0xbccc
testb %al, %al
jle 0x3f4b
callq 0xb3f0
movl %eax, %r15d
movl (%rsp), %edi
leaq 0x50(%rsp), %rsi
movl $0x10, %edx
callq 0xbbac
movq 0x8(%rsp), %rax
movl 0x34(%rax), %edi
leaq 0x90(%rsp), %rsi
movl $0x10, %edx
callq 0xbbac
movswl 0x1a(%rsp), %eax
cmpl $0x12, %eax
jl 0x3f4b
movl $0x12, %ecx
xorl %r14d, %r14d
movq %r15, 0x10(%rsp)
movzbl 0x11(%rbx), %edx
leal (%rdx,%rdx,4), %edx
addl %ecx, %edx
cmpl %eax, %edx
jg 0x3f43
cmpl $0x200, %edx            # imm = 0x200
jg 0x3f43
movq %r14, 0x78(%rsp)
movswq %r14w, %r14
leaq (%rsp,%r14), %rbx
addq $0xd0, %rbx
movzbl 0x11(%rbx), %eax
movq %rax, 0x70(%rsp)
rolw $0x8, 0x4(%rbx)
movl 0x8(%rbx), %edi
leaq 0xa0(%rsp), %rsi
movl $0x10, %edx
callq 0xbbac
movl 0xc(%rbx), %edi
leaq 0x80(%rsp), %rsi
movl $0x10, %edx
callq 0xbbac
movzbl 0x1(%rbx), %r15d
shrl $0x6, %r15d
andl $0x1, %r15d
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
movzwl 0x4(%rbx), %r10d
movzbl 0x10(%rbx), %r11d
movzbl 0x2(%rbx), %r12d
movzbl (%rbx), %ebp
movl $0x4, %edi
leaq 0xc331(%rip), %rsi      # 0xfc1d
leaq 0x50(%rsp), %rdx
leaq 0x90(%rsp), %r8
leaq 0xa0(%rsp), %r9
xorl %eax, %eax
pushq %r15
pushq %rbp
pushq %r12
leaq 0x13a01(%rip), %r12     # 0x17310
pushq %r11
pushq %r10
leaq 0xa8(%rsp), %r10
pushq %r10
callq 0xd88c
addq $0x30, %rsp
movzbl 0x11(%rbx), %eax
movq %rax, 0x30(%rsp)
testw %ax, %ax
leaq 0xe2(%rsp,%r14), %rax
movl $0x0, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x68(%rsp)
movq 0x139c1(%rip), %rax     # 0x17310
cmpq %r12, %rax
je 0x39b9
movl (%rsp), %esi
movl 0x8(%rbx), %edi
movl 0xc(%rbx), %r8d
xorl %ecx, %ecx
xorl %edx, %edx
xorl %r9d, %r9d
xorl %r10d, %r10d
movl 0x34(%rax), %r11d
cmpl %r11d, %esi
movzbl %r10b, %r10d
cmovel %r13d, %r10d
cmpl %r11d, %edi
movzbl %r9b, %r9d
cmovel %r13d, %r9d
cmpl 0x44(%rax), %esi
movzbl %cl, %ecx
cmovel %r13d, %ecx
cmpl %r11d, %r8d
movzbl %dl, %edx
cmovel %r13d, %edx
movq (%rax), %rax
cmpq %r12, %rax
jne 0x3968
testb %r10b, %r10b
sete %bpl
testb %cl, %cl
sete %dil
testb %r9b, %r9b
sete %cl
testb %dl, %dl
sete %r14b
jmp 0x39c4
movb $0x1, %bpl
movb $0x1, %cl
movb $0x1, %r14b
movb $0x1, %dil
movzbl 0x3(%rbx), %edx
testl %edx, %edx
je 0x39eb
movl %edi, %r13d
movl $0x4, %edi
leaq 0xc2b6(%rip), %rsi      # 0xfc91
xorl %eax, %eax
movl %ecx, %r12d
callq 0xd88c
movl %r13d, %edi
movl %r12d, %ecx
movzbl (%rbx), %edx
cmpl $0x5, %edx
jne 0x3d4d
testb %bpl, %bpl
movl $0x1, %r13d
je 0x3d7f
testb %dil, %dil
leaq 0x13900(%rip), %r12     # 0x17310
je 0x3da3
testb %cl, %cl
je 0x3db4
cmpb $0x0, 0x10(%rbx)
je 0x3e8d
testb %r14b, %r14b
je 0x3eb2
movl (%rsp), %esi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x41e8
movb %al, 0x7(%rsp)
movl 0x8(%rbx), %edi
callq 0x43c8
movq %rax, %r15
movl (%rsp), %edi
cmpl %edi, 0x8(%rbx)
movq %rax, 0x20(%rsp)
jne 0x3a6a
movq %rax, %r8
movq 0x8(%rsp), %r14
movq %rax, %rbp
jmp 0x3ae1
callq 0x43c8
movq %rax, %rbp
movl 0x8(%rbx), %eax
cmpl (%rsp), %eax
je 0x3a85
cmpq $0x0, 0x8(%rbp)
je 0x41d7
movq 0x8(%rsp), %r14
cmpq %rbp, %r15
je 0x3adc
movq %rbp, %rax
addq $0x48, %rax
movq 0x48(%rbp), %rcx
movl (%rbp), %edx
cmpq %rax, %rcx
movq 0x10(%rsp), %r15
je 0x3ac4
xorl %r12d, %r12d
cmpl %edx, 0x8(%rcx)
jne 0x3ab7
cmpq %r14, 0x30(%rcx)
cmoveq %rcx, %r12
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x3aaa
testq %r12, %r12
jne 0x3ad5
movq %rbp, %rdi
movq %rbp, %rsi
movq %r14, %rcx
callq 0x42bc
movq %rax, %r12
movq 0x20(%rsp), %r8
jmp 0x3b2e
movq 0x20(%rsp), %r8
addq $0x48, %r15
movq 0x48(%r8), %rax
movl (%rbp), %edx
cmpq %r15, %rax
je 0x3b0e
xorl %r12d, %r12d
cmpl %edx, 0x8(%rax)
jne 0x3b01
cmpq %r14, 0x30(%rax)
cmoveq %rax, %r12
movq (%rax), %rax
cmpq %r15, %rax
jne 0x3af4
testq %r12, %r12
jne 0x3b24
movq %r8, %rdi
movq %rbp, %rsi
movq %r14, %rcx
callq 0x42bc
movq 0x20(%rsp), %r8
movq %rax, %r12
movq 0x10(%rsp), %r15
movl %r15d, 0x1c(%r12)
movl %r15d, 0x30(%r8)
movq 0x20(%rbp), %rax
movzbl 0x1c(%r14), %ecx
movzbl (%rax,%rcx), %eax
movzbl 0xc(%r12), %esi
cmpb %sil, %al
movl %esi, %edx
cmovbl %eax, %edx
xorl %ecx, %ecx
movzbl %dl, %r9d
cmpb 0x1373b(%rip), %dl      # 0x17294
jb 0x3b7b
cmpb 0x13733(%rip), %sil     # 0x17295
movq 0x30(%rsp), %rdi
jb 0x3b80
movl %r9d, %eax
shll $0x8, %eax
subl %r9d, %eax
xorl %edx, %edx
divw %si
movl %eax, %ecx
jmp 0x3b80
movq 0x30(%rsp), %rdi
leal (%rdi,%rdi,4), %eax
movl %eax, 0x30(%rsp)
movb %cl, 0x28(%rbp)
movzbl 0x13706(%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
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
cltd
idivl %esi
movl $0xff, %edx
subl %eax, %edx
movl %edx, 0x2c(%rbp)
movzbl 0x10(%rbx), %eax
movzbl %cl, %ecx
imull %eax, %ecx
imull %edx, %ecx
movslq %ecx, %rax
imulq $-0x7efe7dfd, %rax, %rcx # imm = 0x81018203
shrq $0x20, %rcx
addl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
shrl $0xf, %eax
addl %ecx, %eax
movb %al, 0x10(%rbx)
movl (%r8), %edi
leaq 0xb0(%rsp), %rsi
movl $0x10, %edx
movl %r9d, %r15d
callq 0xbbac
movl (%rbp), %edi
leaq 0xc0(%rsp), %r14
movq %r14, %rsi
movl $0x10, %edx
callq 0xbbac
movzbl 0xc(%r12), %r9d
movzbl 0x28(%rbp), %r10d
movl 0x2c(%rbp), %r11d
movzbl 0x10(%rbx), %r12d
subq $0x8, %rsp
movl $0x4, %edi
leaq 0xc325(%rip), %rsi      # 0xff5d
leaq 0xb8(%rsp), %rdx
movq %r14, %rcx
movl %r15d, %r8d
xorl %eax, %eax
pushq %r12
pushq %r11
pushq %r10
callq 0xd88c
addq $0x20, %rsp
cmpb $0x0, 0x10(%rbx)
movzwl 0x30(%rsp), %ebp
je 0x3ed9
movb 0x7(%rsp), %sil
testb %sil, %sil
leaq 0x1369b(%rip), %r12     # 0x17310
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %r8
je 0x3c9c
movzwl 0x42(%r8), %eax
cmpw 0x4(%rbx), %ax
jne 0x3ccc
movzbl 0x44(%r8), %eax
addl $-0x3, %eax
movzbl 0x2(%rbx), %ecx
cmpl %ecx, %eax
jg 0x3ccc
movl (%rsp), %edx
movq 0x8(%rsp), %rcx
movzbl %sil, %eax
movq %r8, %rdi
movq %rbx, %rsi
movq 0x68(%rsp), %r8
movl %ebp, %r9d
pushq %r15
pushq %rax
callq 0x452e
movb 0x17(%rsp), %sil
movq 0x30(%rsp), %r8
addq $0x10, %rsp
movl 0x8(%rbx), %edx
cmpl (%rsp), %edx
movq 0x78(%rsp), %r14
je 0x3ef2
testb %sil, %sil
jne 0x3f22
movq 0x70(%rsp), %rax
leal (%rax,%rax,4), %eax
addl %eax, %r14d
addl $0x12, %r14d
movl $0x4, %edi
leaq 0xc206(%rip), %rsi      # 0xff07
xorl %eax, %eax
movq %r8, %r12
callq 0xd88c
movl (%rsp), %edx
movq 0x8(%rsp), %r9
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x135ef(%rip), %r12     # 0x17310
movq %rbx, %rsi
xorl %ecx, %ecx
movl %ebp, %r8d
pushq %r15
callq 0x555d
addq $0x10, %rsp
movswl %r14w, %ecx
addl $0x12, %ecx
movswl 0x1a(%rsp), %eax
cmpl %eax, %ecx
jle 0x384f
jmp 0x3f43
movl $0x4, %edi
leaq 0xbf5c(%rip), %rsi      # 0xfcb5
xorl %eax, %eax
callq 0xd88c
leaq 0x135a9(%rip), %r12     # 0x17310
leaq 0xd0(%rsp), %rbx
movq 0x10(%rsp), %r15
movl $0x1, %r13d
jmp 0x3f4b
movl $0x4, %edi
leaq 0xbf5a(%rip), %rsi      # 0xfce5
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0xd88c
leaq 0x13572(%rip), %r12     # 0x17310
jmp 0x3eca
movl $0x4, %edi
leaq 0xbf6c(%rip), %rsi      # 0xfd1b
jmp 0x3ebe
movl (%rsp), %edi
callq 0x43c8
testb %r15b, %r15b
je 0x3e7f
movq %rax, %r14
movq 0x8(%rsp), %rax
movl 0x34(%rax), %ecx
cmpl 0x8(%rbx), %ecx
jne 0x3e7f
movzwl 0x4(%rbx), %ecx
movzwl 0x5a(%rax), %edx
subl %edx, %ecx
cmpl $-0x2, %ecx
jne 0x3e7f
movq 0x20(%r14), %rcx
movzbl 0x1c(%rax), %eax
movzbl (%rcx,%rax), %edx
movl $0x4, %edi
leaq 0xbf61(%rip), %rsi      # 0xfd65
xorl %eax, %eax
callq 0xd88c
movq 0x8(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x1347d(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0x6470
movq 0x8(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x1345c(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%r14), %rdi
callq 0x6630
movq 0x20(%r14), %rcx
movq 0x8(%rsp), %rdx
movzbl 0x1c(%rdx), %edx
movb %al, (%rcx,%rdx)
movq 0x20(%r14), %rax
movq 0x8(%rsp), %rcx
movzbl 0x1c(%rcx), %ecx
movzbl (%rax,%rcx), %edx
movl $0x4, %edi
leaq 0xbf16(%rip), %rsi      # 0xfd8e
xorl %eax, %eax
callq 0xd88c
movl $0x4, %edi
leaq 0xbf0e(%rip), %rsi      # 0xfd99
jmp 0x3ea9
movl (%rsp), %esi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x41e8
movl $0x4, %edi
leaq 0xbf2d(%rip), %rsi      # 0xfdd6
xorl %eax, %eax
callq 0xd88c
jmp 0x3eca
movl $0x4, %edi
leaq 0xbf46(%rip), %rsi      # 0xfe04
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0xd88c
leaq 0xd0(%rsp), %rbx
movq 0x10(%rsp), %r15
jmp 0x3f4b
movl 0x8(%rbx), %edx
cmpl (%rsp), %edx
leaq 0x1342a(%rip), %r12     # 0x17310
movq 0x10(%rsp), %r15
movq 0x20(%rsp), %r8
jne 0x3f30
movq 0x8(%rsp), %r9
subq $0x8, %rsp
movq %r8, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
movl %ebp, %r8d
pushq %r15
callq 0x555d
addq $0x10, %rsp
movl $0x4, %edi
leaq 0xbf48(%rip), %rsi      # 0xfe68
jmp 0x3f3c
movl $0x4, %edi
leaq 0xbfb1(%rip), %rsi      # 0xfedf
jmp 0x3f3c
movl $0x4, %edi
leaq 0xbf71(%rip), %rsi      # 0xfead
xorl %eax, %eax
callq 0xd88c
leaq 0xd0(%rsp), %rbx
movl %r15d, %edi
callq 0x585b
movl %r15d, %eax
movl 0x2c(%rsp), %ecx
subl %ecx, %eax
addl $0xfffffc18, %eax       # imm = 0xFFFFFC18
testl %eax, %eax
jle 0x4187
movl %r15d, %edi
callq 0x47e2
callq 0x4c03
callq 0xb345
movq 0x133ce(%rip), %rax     # 0x17350
cmpw $0x0, 0x8(%rax)
jle 0x3f93
callq 0x5c04
callq 0x6c05
cmpb $0x0, 0x13320(%rip)     # 0x172ba
je 0x3fab
cmpq $0x0, 0x1331c(%rip)     # 0x172c0
jne 0x3fab
callq 0x2d46
cmpl $0x0, 0x133ae(%rip)     # 0x17360
je 0x41bb
movl %r15d, %eax
subl 0x1c(%rsp), %eax
addl $0xffffd8f0, %eax       # imm = 0xFFFFD8F0
testl %eax, %eax
jle 0x41bb
movq 0x1331d(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x3fed
movl $0x44e, %esi            # imm = 0x44E
callq 0x628b
movq $0x0, 0x13303(%rip) # 0x172f0
movw $0x7, 0x13302(%rip)     # 0x172f8
movl $0x7, %edi
movl $0x68, %esi
callq 0x5d52
movq %rax, 0x132e4(%rip)     # 0x172f0
movq 0x132fd(%rip), %rcx     # 0x17310
movl 0x34(%rcx), %ecx
movl %ecx, (%rax)
movq 0x132d1(%rip), %rax     # 0x172f0
movb $0x17, 0x4(%rax)
movb 0x13290(%rip), %cl      # 0x172b9
movb %cl, 0x5(%rax)
movb $-0x1, 0x6(%rax)
movq 0x132f9(%rip), %rdi     # 0x17330
xorl %esi, %esi
callq 0x6741
testq %rax, %rax
je 0x40c9
movq %rax, %rbx
movq 0x8(%rbx), %rax
movq (%rax), %r14
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x40b2
movl (%r14), %ecx
cmpl 0x8(%rax), %ecx
jne 0x40b2
cmpb $0x0, 0x19(%rax)
je 0x40b2
movzwl 0x13289(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x1327f(%rip)      # 0x172f8
movq 0x13270(%rip), %rdi     # 0x172f0
movzwl %ax, %esi
movl $0x69, %edx
callq 0x61a0
movq %rax, 0x1325c(%rip)     # 0x172f0
movzwl 0x1325d(%rip), %ecx     # 0x172f8
movl (%r14), %edx
movl %edx, -0x4(%rax,%rcx)
movq 0x8(%r14), %rdx
movb 0x19(%rdx), %dl
movb %dl, -0x5(%rax,%rcx)
movb $0x1, -0x6(%rax,%rcx)
movq 0x13277(%rip), %rdi     # 0x17330
movq %rbx, %rsi
callq 0x6741
movq %rax, %rbx
testq %rax, %rax
jne 0x404a
cmpb $0x2, 0x13214(%rip)     # 0x172e4
setb %al
movq (%r12), %rbx
cmpq %r12, %rbx
sete %cl
orb %al, %cl
movq 0x1320a(%rip), %rdi     # 0x172f0
jne 0x4138
movl (%rdi), %eax
cmpl 0x34(%rbx), %eax
je 0x4130
movzwl 0x13202(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x131f8(%rip)      # 0x172f8
movzwl %ax, %esi
movl $0x6a, %edx
callq 0x61a0
movq %rax, 0x131dc(%rip)     # 0x172f0
movzwl 0x131dd(%rip), %ecx     # 0x172f8
movl 0x34(%rbx), %edx
movl %edx, -0x4(%rax,%rcx)
movw $0x2, -0x6(%rax,%rcx)
movq 0x131c0(%rip), %rdi     # 0x172f0
movq (%rbx), %rbx
cmpq %r12, %rbx
jne 0x40e8
leaq 0x131b9(%rip), %rsi     # 0x172f8
callq 0x731b
movq %rax, 0x131a5(%rip)     # 0x172f0
movzwl 0x131a6(%rip), %esi     # 0x172f8
cmpl $0x7, %esi
jne 0x418c
movq %rax, %rdi
movl $0x453, %esi            # imm = 0x453
callq 0x628b
movq $0x0, 0x13181(%rip) # 0x172f0
movw $0x0, 0x13180(%rip)     # 0x172f8
movl %r15d, 0x1c(%rsp)
leaq 0xd0(%rsp), %rbx
jmp 0x41bb
movl %ecx, %r15d
jmp 0x41c0
movl %r15d, 0x1c(%rsp)
testq %rax, %rax
leaq 0xd0(%rsp), %rbx
je 0x41bb
movl 0x131bc(%rip), %ecx     # 0x17360
movq %rax, %rdi
leaq 0x131b6(%rip), %rdx     # 0x17364
xorl %r8d, %r8d
callq 0xbe54
movl %r15d, 0x1c(%rsp)
callq 0x6fd8
callq 0xbbdb
movl %r15d, 0x2c(%rsp)
testb %al, %al
je 0x37a9
jmp 0x368f
movl $0x4, %edi
leaq 0xbc5c(%rip), %rsi      # 0xfe3f
jmp 0x3ea9