// File: /workspace/github_c_makefile_star2_O1/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 0xb0fc
movl %eax, 0x24(%rsp)
leaq 0xe81(%rip), %rsi       # 0x4373
leaq 0xe84(%rip), %rdx       # 0x437d
movl $0x80, %edi
callq 0x6518
movq %rax, 0x13e26(%rip)     # 0x17330
testq %rax, %rax
je 0x41d0
leaq 0xc66e(%rip), %rsi      # 0xfb88
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x6860
leaq 0xc668(%rip), %rsi      # 0xfb92
movl $0x1, %edi
callq 0x6860
leaq 0xc665(%rip), %rsi      # 0xfba0
movl $0x2, %edi
callq 0x6860
leaq 0xc663(%rip), %rsi      # 0xfbaf
movl $0x3, %edi
callq 0x6860
leaq 0xc65e(%rip), %rsi      # 0xfbbb
movl $0x4, %edi
callq 0x6860
leaq 0xc65b(%rip), %rsi      # 0xfbc9
movl $0x5, %edi
callq 0x6860
leaq 0xc656(%rip), %rsi      # 0xfbd5
movl $0x6, %edi
callq 0x6860
leaq 0xc650(%rip), %rsi      # 0xfbe0
movl $0x7, %edi
callq 0x6860
leaq 0xc657(%rip), %rsi      # 0xfbf8
movl $0x8, %edi
callq 0x6860
movq 0x13d5e(%rip), %rbx     # 0x17310
leaq 0x13d57(%rip), %r12     # 0x17310
cmpq %r12, %rbx
je 0x3602
movl $0x32, %r14d
movw $0x5, 0x56(%rbx)
cmpb $0x0, 0x1c(%rbx)
movl $0x2, %eax
cmovel %r14d, %eax
movb %al, 0x58(%rbx)
movzbl 0x13cd8(%rip), %eax     # 0x172b9
cmovnel %ebp, %eax
movb %al, 0x59(%rbx)
movl $0xd2100001, 0x5a(%rbx) # imm = 0xD2100001
movb $-0x1, 0x66(%rbx)
movq %rbx, %rdi
callq 0x533c
movq (%rbx), %rbx
cmpq %r12, %rbx
jne 0x35c4
leaq 0xc608(%rip), %rbx      # 0xfc11
movq %rbx, %rdi
callq 0x9370
movl %eax, 0x3c(%rsp)
leaq 0xc5f9(%rip), %r14      # 0xfc15
movq %r14, %rdi
callq 0x9370
movl %eax, 0x40(%rsp)
movq %rbx, %rdi
callq 0x949b
movl %eax, 0x44(%rsp)
movq %r14, %rdi
callq 0x949b
movl %eax, 0x48(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x92b0
xorl %edi, %edi
movq %r14, %rsi
callq 0x92b0
xorl %edi, %edi
movq %rbx, %rsi
callq 0x941f
xorl %edi, %edi
movq %r14, %rsi
callq 0x941f
callq 0x94fb
movl %eax, 0x38(%rsp)
movl $0x1, %r13d
movl $0x1, %edi
callq 0x94ed
callq 0xb8e7
testb %al, %al
jne 0x40da
leaq 0xd0(%rsp), %rbx
movl 0x24(%rsp), %eax
movl %eax, 0x20(%rsp)
movl $0x4, %edi
leaq 0xca0a(%rip), %rsi      # 0x100b4
xorl %eax, %eax
callq 0xd5b0
callq 0xb0fc
movl %eax, %r15d
movq 0x13c78(%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 0x1e(%rsp), %rdx
movq %rsp, %rcx
leaq 0x8(%rsp), %r9
callq 0xb9d8
testb %al, %al
jle 0x3e50
callq 0xb0fc
movl %eax, %r15d
movl (%rsp), %edi
leaq 0x50(%rsp), %rsi
movl $0x10, %edx
callq 0xb8b8
movq 0x8(%rsp), %rax
movl 0x34(%rax), %edi
leaq 0x90(%rsp), %rsi
movl $0x10, %edx
callq 0xb8b8
movswl 0x1e(%rsp), %eax
cmpl $0x12, %eax
jl 0x3e50
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 0x3e48
cmpl $0x200, %edx            # imm = 0x200
jg 0x3e48
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 0xb8b8
movl 0xc(%rbx), %edi
leaq 0x80(%rsp), %rsi
movl $0x10, %edx
callq 0xb8b8
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 0xc43c(%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 0x13b0c(%rip), %r12     # 0x17310
pushq %r11
pushq %r10
leaq 0xa8(%rsp), %r10
pushq %r10
callq 0xd5b0
addq $0x30, %rsp
movzbl 0x11(%rbx), %ecx
movq %rcx, 0x30(%rsp)
testw %cx, %cx
leaq 0xe2(%rsp,%r14), %rax
movl $0x0, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x68(%rsp)
movq 0x13acc(%rip), %rax     # 0x17310
cmpq %r12, %rax
je 0x38ae
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 0x385d
testb %r10b, %r10b
sete %bpl
testb %cl, %cl
sete %dil
testb %r9b, %r9b
sete %cl
testb %dl, %dl
sete %r14b
jmp 0x38b9
movb $0x1, %bpl
movb $0x1, %cl
movb $0x1, %r14b
movb $0x1, %dil
movzbl 0x3(%rbx), %edx
testl %edx, %edx
je 0x38e0
movl %edi, %r13d
movl $0x4, %edi
leaq 0xc3c1(%rip), %rsi      # 0xfc91
xorl %eax, %eax
movl %ecx, %r12d
callq 0xd5b0
movl %r13d, %edi
movl %r12d, %ecx
movzbl (%rbx), %edx
cmpl $0x5, %edx
jne 0x3c38
testb %bpl, %bpl
movl $0x1, %r13d
je 0x3c6a
testb %dil, %dil
leaq 0x13a0b(%rip), %r12     # 0x17310
je 0x3c8e
testb %cl, %cl
je 0x3cab
cmpb $0x0, 0x10(%rbx)
je 0x3d87
testb %r14b, %r14b
movq 0x10(%rsp), %r15
je 0x3da5
movl (%rsp), %esi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x41e4
movb %al, 0x7(%rsp)
movl 0x8(%rbx), %edi
callq 0x43bb
movq %rax, %r8
movl (%rsp), %edi
movq %rax, %rbp
cmpl %edi, 0x8(%rbx)
movq %rax, 0x28(%rsp)
je 0x3967
callq 0x43bb
movq 0x28(%rsp), %r8
movq %rax, %rbp
movl 0x8(%rbx), %eax
cmpl (%rsp), %eax
je 0x397a
cmpq $0x0, 0x8(%rbp)
je 0x3e2e
movq 0x8(%rsp), %r12
cmpq %rbp, %r8
je 0x39ae
leaq 0x48(%rbp), %rax
movq 0x48(%rbp), %rcx
cmpq %rax, %rcx
je 0x39db
movl (%rbp), %edx
xorl %r14d, %r14d
cmpl %edx, 0x8(%rcx)
jne 0x39a4
cmpq %r12, 0x30(%rcx)
cmoveq %rcx, %r14
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x3997
jmp 0x39de
movq %r8, %rax
addq $0x48, %rax
movq 0x48(%r8), %rcx
cmpq %rax, %rcx
je 0x39fe
movl (%rbp), %edx
xorl %r14d, %r14d
cmpl %edx, 0x8(%rcx)
jne 0x39d1
cmpq %r12, 0x30(%rcx)
cmoveq %rcx, %r14
movq (%rcx), %rcx
cmpq %rax, %rcx
jne 0x39c4
jmp 0x3a01
xorl %r14d, %r14d
testq %r14, %r14
jne 0x3a23
movl (%rbp), %edx
movq %rbp, %rdi
movq %rbp, %rsi
movq %r12, %rcx
callq 0x42ac
movq 0x28(%rsp), %r8
movq %rax, %r14
jmp 0x3a23
xorl %r14d, %r14d
testq %r14, %r14
jne 0x3a1f
movl (%rbp), %edx
movq %r8, %rdi
movq %rbp, %rsi
movq %r12, %rcx
callq 0x42ac
movq 0x28(%rsp), %r8
movq %rax, %r14
movl %r15d, 0x1c(%r14)
movl %r15d, 0x30(%r8)
movq 0x20(%rbp), %rax
movzbl 0x1c(%r12), %ecx
movzbl (%rax,%rcx), %eax
movzbl 0xc(%r14), %esi
cmpb %sil, %al
cmovael %esi, %eax
movzbl %al, %edi
xorl %ecx, %ecx
cmpb 0x13848(%rip), %dil     # 0x17294
jb 0x3a64
cmpb 0x13840(%rip), %sil     # 0x17295
jb 0x3a64
movl %edi, %eax
shll $0x8, %eax
subl %edi, %eax
xorl %edx, %edx
divl %esi
movl %eax, %ecx
movq 0x30(%rsp), %rax
leal (%rax,%rax,4), %eax
movl %eax, 0x30(%rsp)
movb %cl, 0x28(%rbp)
movzbl 0x1381d(%rip), %eax     # 0x17297
movl %edi, 0x4c(%rsp)
movl %eax, %edi
imull %eax, %edi
imull %eax, %edi
subl %esi, %eax
movl %eax, %edx
imull %eax, %edx
imull %eax, %edx
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
cltd
idivl %edi
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 0xc0(%rsp), %r15
movq %r15, %rsi
movl $0x10, %edx
callq 0xb8b8
movl (%rbp), %edi
leaq 0xb0(%rsp), %r12
movq %r12, %rsi
movl $0x10, %edx
callq 0xb8b8
movzbl 0xc(%r14), %r9d
movzbl 0x28(%rbp), %r10d
movl 0x2c(%rbp), %r11d
movzbl 0x10(%rbx), %r14d
subq $0x8, %rsp
movl $0x4, %edi
leaq 0xc43c(%rip), %rsi      # 0xff5d
movq %r15, %rdx
movq %r12, %rcx
movl 0x54(%rsp), %r8d
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
callq 0xd5b0
movq 0x48(%rsp), %r8
addq $0x20, %rsp
movb 0x10(%rbx), %r14b
movzwl 0x30(%rsp), %r15d
testb %r14b, %r14b
movb 0x7(%rsp), %bpl
je 0x3ba3
testb %bpl, %bpl
je 0x3b76
movzwl 0x42(%r8), %eax
cmpw 0x4(%rbx), %ax
jne 0x3ba3
movzbl 0x44(%r8), %eax
addl $-0x3, %eax
movzbl 0x2(%rbx), %ecx
cmpl %ecx, %eax
jg 0x3ba3
movl (%rsp), %edx
movq 0x8(%rsp), %rcx
movzbl %bpl, %eax
movq %r8, %rdi
movq %rbx, %rsi
movq 0x68(%rsp), %r8
movl %r15d, %r9d
pushq 0x10(%rsp)
pushq %rax
callq 0x451d
movq 0x38(%rsp), %r8
addq $0x10, %rsp
movl (%rsp), %edx
cmpl %edx, 0x8(%rbx)
leaq 0x13760(%rip), %r12     # 0x17310
je 0x3dc2
testb %r14b, %r14b
je 0x3dfe
testb %bpl, %bpl
jne 0x3e0c
movq 0x70(%rsp), %rax
leal (%rax,%rax,4), %eax
movq 0x78(%rsp), %r14
addl %eax, %r14d
addl $0x12, %r14d
movl $0x4, %edi
leaq 0xc31f(%rip), %rsi      # 0xff07
xorl %eax, %eax
movq %r12, %rbp
movq %r8, %r12
callq 0xd5b0
movl (%rsp), %edx
movq 0x8(%rsp), %r9
subq $0x8, %rsp
movq %r12, %rdi
movq %rbp, %r12
movq %rbx, %rsi
xorl %ecx, %ecx
movl %r15d, %r8d
movq 0x18(%rsp), %r15
pushq %r15
callq 0x5565
addq $0x10, %rsp
movswl %r14w, %ecx
addl $0x12, %ecx
movswl 0x1e(%rsp), %eax
cmpl %eax, %ecx
jle 0x3744
jmp 0x3e48
movl $0x4, %edi
leaq 0xc071(%rip), %rsi      # 0xfcb5
xorl %eax, %eax
callq 0xd5b0
leaq 0x136be(%rip), %r12     # 0x17310
leaq 0xd0(%rsp), %rbx
movq 0x10(%rsp), %r15
movl $0x1, %r13d
jmp 0x3e50
movl $0x4, %edi
leaq 0xc06f(%rip), %rsi      # 0xfce5
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0xd5b0
leaq 0x13687(%rip), %r12     # 0x17310
jmp 0x3e1f
movl $0x4, %edi
leaq 0xc081(%rip), %rsi      # 0xfd1b
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0xd5b0
jmp 0x3e1f
movl (%rsp), %edi
callq 0x43bb
testb %r15b, %r15b
je 0x3d76
movq %rax, %r14
movq 0x8(%rsp), %rax
movl 0x34(%rax), %ecx
cmpl 0x8(%rbx), %ecx
jne 0x3d76
movzwl 0x4(%rbx), %ecx
movzwl 0x5a(%rax), %edx
subl %edx, %ecx
cmpl $-0x2, %ecx
jne 0x3d76
movq 0x20(%r14), %rcx
movzbl 0x1c(%rax), %eax
movzbl (%rcx,%rax), %edx
movl $0x4, %edi
leaq 0xc06a(%rip), %rsi      # 0xfd65
xorl %eax, %eax
callq 0xd5b0
movq 0x8(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x13586(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0x6140
movq 0x8(%rsp), %rax
movzbl 0x1c(%rax), %eax
movzbl 0x13565(%rip), %edi     # 0x17298
imull %eax, %edi
shll $0x3, %edi
addq 0x18(%r14), %rdi
callq 0x6309
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 0xc01f(%rip), %rsi      # 0xfd8e
xorl %eax, %eax
callq 0xd5b0
movl $0x4, %edi
leaq 0xc017(%rip), %rsi      # 0xfd99
jmp 0x3e18
movl (%rsp), %esi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x41e4
movl $0x4, %edi
leaq 0xc033(%rip), %rsi      # 0xfdd6
jmp 0x3e18
movl $0x4, %edi
leaq 0xc053(%rip), %rsi      # 0xfe04
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0xd5b0
jmp 0x3e48
movq 0x8(%rsp), %r9
subq $0x8, %rsp
movq %r8, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
movl %r15d, %r8d
movq 0x18(%rsp), %r15
pushq %r15
callq 0x5565
addq $0x10, %rsp
movl $0x4, %edi
leaq 0xc073(%rip), %rsi      # 0xfe68
xorl %eax, %eax
callq 0xd5b0
jmp 0x3e48
movl $0x4, %edi
leaq 0xc0a3(%rip), %rsi      # 0xfead
jmp 0x3e18
movl $0x4, %edi
leaq 0xc0c7(%rip), %rsi      # 0xfedf
xorl %eax, %eax
callq 0xd5b0
leaq 0xd0(%rsp), %rbx
movq 0x10(%rsp), %r15
jmp 0x3e50
movl $0x4, %edi
leaq 0xc005(%rip), %rsi      # 0xfe3f
xorl %eax, %eax
callq 0xd5b0
leaq 0x134c8(%rip), %r12     # 0x17310
leaq 0xd0(%rsp), %rbx
movl %r15d, %edi
callq 0x585b
movl %r15d, %eax
movl 0x24(%rsp), %ecx
subl %ecx, %eax
addl $0xfffffc18, %eax       # imm = 0xFFFFFC18
testl %eax, %eax
jle 0x40c5
movl %r15d, %edi
callq 0x47ce
callq 0x4beb
callq 0xb054
movq 0x134c9(%rip), %rax     # 0x17350
cmpw $0x0, 0x8(%rax)
jle 0x3e98
callq 0x5bf0
callq 0x68c9
cmpb $0x0, 0x1341b(%rip)     # 0x172ba
je 0x3eb0
cmpq $0x0, 0x13417(%rip)     # 0x172c0
jne 0x3eb0
callq 0x2d46
cmpl $0x0, 0x134a9(%rip)     # 0x17360
je 0x40be
movl %r15d, %eax
subl 0x20(%rsp), %eax
addl $0xffffd8f0, %eax       # imm = 0xFFFFD8F0
testl %eax, %eax
jle 0x40be
movq 0x13418(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x3efb
movl $0x44e, %esi            # imm = 0x44E
callq 0x5f5b
movq $0x0, 0x133fe(%rip) # 0x172f0
movw $0x0, 0x133fd(%rip)     # 0x172f8
movw $0x7, 0x133f4(%rip)     # 0x172f8
movl $0x7, %edi
movl $0x68, %esi
callq 0x5d3e
movq %rax, 0x133d6(%rip)     # 0x172f0
movq 0x133ef(%rip), %rcx     # 0x17310
movl 0x34(%rcx), %ecx
movl %ecx, (%rax)
movq 0x133c3(%rip), %rax     # 0x172f0
movb $0x17, 0x4(%rax)
movb 0x13382(%rip), %cl      # 0x172b9
movb %cl, 0x5(%rax)
movb $-0x1, 0x6(%rax)
movq 0x133eb(%rip), %rdi     # 0x17330
xorl %esi, %esi
callq 0x6416
testq %rax, %rax
je 0x3fd7
movq %rax, %rbx
movq 0x8(%rbx), %rax
movq (%rax), %r14
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x3fc0
movl (%r14), %ecx
cmpl 0x8(%rax), %ecx
jne 0x3fc0
cmpb $0x0, 0x19(%rax)
je 0x3fc0
movzwl 0x1337b(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x13371(%rip)      # 0x172f8
movq 0x13362(%rip), %rdi     # 0x172f0
movzwl %ax, %esi
movl $0x69, %edx
callq 0x5e6d
movq %rax, 0x1334e(%rip)     # 0x172f0
movzwl 0x1334f(%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 0x13369(%rip), %rdi     # 0x17330
movq %rbx, %rsi
callq 0x6416
movq %rax, %rbx
testq %rax, %rax
jne 0x3f58
cmpb $0x2, 0x13306(%rip)     # 0x172e4
setb %al
movq (%r12), %rbx
cmpq %r12, %rbx
sete %cl
orb %al, %cl
jne 0x403f
movq 0x132fa(%rip), %rdi     # 0x172f0
movl (%rdi), %eax
cmpl 0x34(%rbx), %eax
je 0x4037
movzwl 0x132f4(%rip), %eax     # 0x172f8
addl $0x6, %eax
movw %ax, 0x132ea(%rip)      # 0x172f8
movzwl %ax, %esi
movl $0x6a, %edx
callq 0x5e6d
movq %rax, 0x132ce(%rip)     # 0x172f0
movzwl 0x132cf(%rip), %ecx     # 0x172f8
movl 0x34(%rbx), %edx
movl %edx, -0x4(%rax,%rcx)
movw $0x2, -0x6(%rax,%rcx)
movq (%rbx), %rbx
cmpq %r12, %rbx
jne 0x3fef
movq 0x132aa(%rip), %rdi     # 0x172f0
leaq 0x132ab(%rip), %rsi     # 0x172f8
callq 0x6fd1
movq %rax, 0x13297(%rip)     # 0x172f0
cmpw $0x7, 0x13297(%rip)     # 0x172f8
jne 0x4084
movq %rax, %rdi
movl $0x453, %esi            # imm = 0x453
callq 0x5f5b
movq $0x0, 0x13275(%rip) # 0x172f0
movw $0x0, 0x13274(%rip)     # 0x172f8
movq 0x13265(%rip), %rdi     # 0x172f0
movl %r15d, 0x20(%rsp)
testq %rdi, %rdi
leaq 0xd0(%rsp), %rbx
je 0x40be
movzwl 0x13254(%rip), %esi     # 0x172f8
movl 0x132b6(%rip), %ecx     # 0x17360
leaq 0x132b3(%rip), %rdx     # 0x17364
xorl %r8d, %r8d
callq 0xbb60
movl %r15d, 0x20(%rsp)
callq 0x6c9e
jmp 0x40c8
movl %ecx, %r15d
callq 0xb8e7
movl %r15d, 0x24(%rsp)
testb %al, %al
je 0x369e
cmpb $0x0, 0x131d7(%rip)     # 0x172b8
je 0x40ef
leaq 0xbef4(%rip), %rdi      # 0xffde
callq 0x20c0
callq 0xb0fc
movl 0x13196(%rip), %ecx     # 0x17290
leal (%rcx,%rcx,4), %ecx
movswl 0x13186(%rip), %edi     # 0x1728a
addl %eax, %edi
addl %ecx, %edi
callq 0x47ce
movq 0x1321c(%rip), %rdi     # 0x17330
callq 0x63ed
movq 0x13218(%rip), %r14     # 0x17338
leaq 0x13211(%rip), %rbx     # 0x17338
cmpq %rbx, %r14
je 0x4160
movq (%r14), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5bcf
movq 0x10(%r14), %rdi
movl $0x451, %esi            # imm = 0x451
callq 0x5f5b
movq %r14, %rdi
movl $0x452, %esi            # imm = 0x452
callq 0x5f5b
movq %r15, %r14
cmpq %rbx, %r15
jne 0x412c
movq 0x13189(%rip), %rdi     # 0x172f0
testq %rdi, %rdi
je 0x4176
movl $0x454, %esi            # imm = 0x454
callq 0x5f5b
movl $0xff, %ebp
movl 0x38(%rsp), %edi
andl %ebp, %edi
callq 0x94ed
movl 0x3c(%rsp), %edi
andl %ebp, %edi
leaq 0xba7e(%rip), %rbx      # 0xfc11
movq %rbx, %rsi
callq 0x92b0
movl 0x40(%rsp), %edi
andl %ebp, %edi
leaq 0xba6d(%rip), %r14      # 0xfc15
movq %r14, %rsi
callq 0x92b0
movl 0x44(%rsp), %edi
andl %ebp, %edi
movq %rbx, %rsi
callq 0x941f
movl 0x48(%rsp), %edi
andl %ebp, %edi
movq %r14, %rsi
callq 0x941f
xorl %eax, %eax
jmp 0x41d2
movb $-0x1, %al
addq $0x8a8, %rsp            # imm = 0x8A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq