// File: /workspace/github_c_makefile_star2_O3/S01den[P]Lost_CavernRL/ennemy.c
// Function: iaCore
void iaCore(Ennemy ennemies[], Player *player, Map map[LONGUEUR][LARGEUR], int *nbrEnnmies, char messagePrint[], int *colorPrint, Armor *armor, WINDOW *win_msg, int *source)
{
// this is a ratio-based IA
// do enemies who can teleport themselves and enemies who can infect the player
	int degats = 0;
	int i = 0;
	int action = 0;

	for(i = 0; i < *nbrEnnmies; i++)
	{
		if(map[ennemies[i].x][ennemies[i].y].effect == 2) // if the enemy is in a radioactive zone
		{
			ennemies[i].life--;
		}
		else if(map[ennemies[i].x][ennemies[i].y].effect == 1 || map[ennemies[i].x][ennemies[i].y].effect == 3) // if the enemy is in a fire zone
		{
			ennemies[i].life-=4;
			ennemies[i].effect = 1;
		}

		if(ennemies[i].effect == 1)
		{
			ennemies[i].life -= 5;
			if(rand()%10 == 0)
			{
				ennemies[i].effect = 0;
			}
		}

		if(map[ennemies[i].x][ennemies[i].y].trap == 1)
		{
			ennemies[i].life -= 5;
			map[ennemies[i].x][ennemies[i].y].trap = 0;
			map[ennemies[i].x][ennemies[i].y].content = FLOOR;
		}
		else if(map[ennemies[i].x][ennemies[i].y].trap == 2)
		{
			ennemies[i].effect = 2;
			map[ennemies[i].x][ennemies[i].y].trap = 0;
			map[ennemies[i].x][ennemies[i].y].content = FLOOR;
			if(rand()%5 == 0)
			{
				ennemies[i].effect = 0;
			}
		}
		else if(map[ennemies[i].x][ennemies[i].y].trap == 3)
		{
			map[ennemies[i].x][ennemies[i].y].trap = 0;
			map[ennemies[i].x][ennemies[i].y].content = FLOOR;
			map[ennemies[i].x][ennemies[i].y+1].effect = 1;
			map[ennemies[i].x][ennemies[i].y-1].effect = 1;
			map[ennemies[i].x+1][ennemies[i].y].effect = 1;
			map[ennemies[i].x-1][ennemies[i].y].effect = 1;	
		}
		
		if(ennemies[i].life > 0 && ennemies[i].effect != 2)
		{
			switch(ennemies[i].type)
			{
				case 1: // droid
					if(ennemies[i].boss == 3)
					{
						action = rand()%100+1;
						if(action <= 10)
						{
							snprintf(messagePrint,100,"YOU CAN'T WIN THIS GAME!");
							player->life -= rand()%5+1;
							player->state = rand()%3+1;
							popUpArchitect();
						}
						else if(action > 10 && action <= 30)
						{
							map[player->x+1][player->y].content = WALL;
							map[player->x+1][player->y].resistance = 10;
							map[player->x-1][player->y].content = WALL;
							map[player->x-1][player->y].resistance = 10;
							map[player->x][player->y+1].content = WALL;
							map[player->x][player->y+1].resistance = 10;
							map[player->x][player->y-1].content = WALL;
							map[player->x][player->y-1].resistance = 10;
						}
						else if(action > 30 && action <= 40)
						{
							int n = 0;
							for(n = 0; n < LARGEUR; n++)
							{
								map[ennemies[i].x+1][n].content = WALL;
								map[ennemies[i].x+1][n].resistance = 5;
								map[ennemies[i].x+2][n].effect = 1;
							}
						}
						else if(action > 40 && action <= 60)
						{
							int n = 0;
							for(n = 0; n < LONGUEUR; n++)
							{
								map[n][player->y-1].effect = 1;
								map[n][player->y+1].effect = 1;
							}				
						}
						else if(action > 60 && action <= 70)
						{
							int n = 0;
							int m = 0;
							int col = rand()%LARGEUR;
							for(m = col; m < LARGEUR; m++)
							{
								for(n = 0; n < LONGUEUR; n++)
								{
									if(player->x == n && player->y == m)
									{
										player->life -= 10;
									}
									else
									{
										map[n][m].content = WALL;
										map[n][m].resistance = 5;
									}
								}	
							}
						}
						else if(action > 70 && action <= 95)
						{
							moveRand(ennemies,map,i);
						}
						else
						{
							map[rand()%LONGUEUR][rand()%LARGEUR].effect = 3;
						}
					}
					else
					{
						if(ennemies[i].seen == 0)
						{
							moveRand(ennemies,map,i);
						}
						else
						{
							action = rand()%10;
							if(action > 7 || (ennemies[i].life <= 15 && action > 4)) 
							{
								wclear(win_msg);
								repair(ennemies,i, colorPrint, messagePrint);
							}
							else if(action == 0)
							{
								moveRand(ennemies,map,i);
							}
							else
							{
								if(abs(player->x-ennemies[i].x) <= 1 && abs(player->y-ennemies[i].y) <= 1)
								{
									//melee
									if(rand()%101 <= ennemies[i].efficiency)
									{
										int degats = ennemies[i].strength*2 + rand()%3+1 - abs(armor->resistance);
										if(degats > 0)
										{
											armor->state -= degats/3;
											player->life -= degats/2;
											wclear(win_msg);
											*colorPrint = 197; // RED LIKE BLOOOOOOOD
											snprintf(messagePrint,100,"%s HITS YOU WITH HIS ROTATIVE BLADE (-%d LP)",ennemies[i].name,degats/2); 
											*source = 7;
										}
									}
									else
									{
										wclear(win_msg);
										*colorPrint = 47;
										snprintf(messagePrint,100,"%s MISSED YOU !",ennemies[i].name);
									}
								}
								else
								{
									if(ennemies[i].haveBlaster != 1)
									{
										if(abs(player->x - ennemies[i].x) > abs(player->y-ennemies[i].y))
										{
											if(player->x > ennemies[i].x)
											{
												if(map[ennemies[i].x+1][ennemies[i].y].content != WALL && map[ennemies[i].x+1][ennemies[i].y].content != DOOR)
													ennemies[i].x++;
											}
											else
											{
												if(map[ennemies[i].x-1][ennemies[i].y].content != WALL && map[ennemies[i].x-1][ennemies[i].y].content != DOOR)
													ennemies[i].x--;
											}
										}
										else
										{
											if(player->y > ennemies[i].y)
											{
												if(map[ennemies[i].x][ennemies[i].y+1].content != WALL && map[ennemies[i].x][ennemies[i].y+1].content != DOOR)
													ennemies[i].y++;
											}
											else
											{
												if(map[ennemies[i].x][ennemies[i].y-1].content != WALL && map[ennemies[i].x][ennemies[i].y-1].content != DOOR)
													ennemies[i].y--;
											}
										}
									}
									else
									{
										if(rand()%101 <= ennemies[i].efficiency)
										{
											degats = blastHit(ennemies[i],player,armor,map);
											if(degats > 0)
											{
												wclear(win_msg);
												*colorPrint = 197; // RED LIKE BLOOOOOOOD
												snprintf(messagePrint,100,"%s HITS YOU WITH HIS HIS BLASTER (-%d LP)",ennemies[i].name,degats/2);	
												*source = 7;			
											}
										}
										else
										{
											wclear(win_msg);
											*colorPrint = 47;
											snprintf(messagePrint,100,"%s MISSED YOU !",ennemies[i].name);
										}
									}
								}
							}
						}
					}
				break;

				case 2: // sentry
					action = rand()%10;
					if(ennemies[i].seen == 0)
					{
						if(rand()%75 == 0)
						{
							ennemies[i].life++;
						}
					}
					else
					{
						if(ennemies[i].boss != 0)
						{
							if(action <= 6)
							{
								if(rand()%101 <= ennemies[i].efficiency)
								{
									degats = blastHit(ennemies[i],player,armor,map);
									if(degats > 0)
									{
										wclear(win_msg);
										*colorPrint = 197; // RED LIKE BLOOOOOOOD
										snprintf(messagePrint,100,"%s HITS YOU WITH HIS HIS LASER-CANON (-%d LP)",ennemies[i].name,degats/2);
										*source = 8;		
									}
								}
								else
								{
									wclear(win_msg);
									*colorPrint = 47;
									snprintf(messagePrint,100,"%s MISSED YOU !",ennemies[i].name);
								}			
							}
							else if(action == 7)
							{
								int xBomb = rand()%5-2;
								int yBomb = rand()%5-2;
								wclear(win_msg);
								*colorPrint = 197; // RED LIKE BLOOOOOOOD
								snprintf(messagePrint,100,"%s THROWS A BOMB NEAR YOU !",ennemies[i].name);
								map[player->x+xBomb][player->y+yBomb].content = BOMB;
								map[player->x+xBomb][player->y+yBomb].resistance = 4;
							}
							else if(action == 8)
							{
								wclear(win_msg);
								*colorPrint = 47;
								snprintf(messagePrint,100,"********** BUG ! CORE DUMPED ! **********");					
							}
							else
							{
								*colorPrint = 197; // RED LIKE BLOOOOOOOD
								snprintf(messagePrint,100,"*** FIRE MODULE ACTIVATED ! ***");
								map[player->x+rand()%5-2][player->y+rand()%5-2].effect = 1;
							}

						}
						else
						{
							if(action <= 7)
							{
								if(rand()%101 <= ennemies[i].efficiency)
								{
									degats = blastHit(ennemies[i],player,armor,map);
									if(degats > 0)
									{
										wclear(win_msg);
										*colorPrint = 197; // RED LIKE BLOOOOOOOD
										snprintf(messagePrint,100,"%s HITS YOU WITH HIS HIS LASER-CANON (-%d LP)",ennemies[i].name,degats/2);	
										*source = 8;			
									}
								}
								else
								{
									wclear(win_msg);
									*colorPrint = 47;
									snprintf(messagePrint,100,"%s MISSED YOU !",ennemies[i].name);
								}			
							}
							else
							{
								wclear(win_msg);
								repair(ennemies,i, colorPrint, messagePrint);
							}
						}
					}

				break;

			case 3:
					if(ennemies[i].boss == 1) // BOSS 1: ALTHORUS THE GUARDIAN
					{
						if(abs(player->x-ennemies[i].x) <= 2 && abs(player->y-ennemies[i].y) <= 2 && rand()%6 == 0)
						{
							int sign = 1;
							if(player->x > ennemies[i].x)
								sign = 1;
							else
								sign = -1;
							int turns = 0;
							while(turns < 4 && map[player->x][player->y].content != WALL)
							{
								player->x+=sign;
								turns++;
							}
							if(map[player->x][player->y].content == WALL)
							{
								player->life -= 10;
								armor->state -= 10;
								map[player->x][player->y].content = FLOOR;
							}
						}
						else if(abs(player->x-ennemies[i].x) <= 5 && abs(player->y-ennemies[i].y) <= 5 && (*nbrEnnmies)+1 < ENEMIES_MAX && rand()%10 == 1)
						{
							(*nbrEnnmies)++;
							ennemies[i+(*nbrEnnmies)].x = player->x + rand()%1-3;
							ennemies[i+(*nbrEnnmies)].y = player->y + rand()%1-3;
							ennemies[i+(*nbrEnnmies)].type = 3;
							ennemies[i+(*nbrEnnmies)].boss = 0;
							ennemies[i+(*nbrEnnmies)].life = 30;
							ennemies[i+(*nbrEnnmies)].strength = rand()%3+4;
							ennemies[i+(*nbrEnnmies)].seen = 0;
							ennemies[i+(*nbrEnnmies)].agility = 3;
							ennemies[i+(*nbrEnnmies)].haveBlaster = 0;
							ennemies[i+(*nbrEnnmies)].name = "MINI-GUARDIAN";	
						}
						else
						{
							if(abs(player->x - ennemies[i].x) > abs(player->y-ennemies[i].y))
							{
								if(player->x > ennemies[i].x)
								{
									if(map[ennemies[i].x+1][ennemies[i].y].content != WALL && map[ennemies[i].x+1][ennemies[i].y].content != DOOR)
										ennemies[i].x++;
								}
								else
								{
									if(map[ennemies[i].x-1][ennemies[i].y].content != WALL && map[ennemies[i].x-1][ennemies[i].y].content != DOOR)
										ennemies[i].x--;
								}
							}
							else
							{
								if(player->y > ennemies[i].y)
								{
									if(map[ennemies[i].x][ennemies[i].y+1].content != WALL && map[ennemies[i].x][ennemies[i].y+1].content != DOOR)
										ennemies[i].y++;
								}
								else
								{
									if(map[ennemies[i].x][ennemies[i].y-1].content != WALL && map[ennemies[i].x][ennemies[i].y-1].content != DOOR)
										ennemies[i].y--;
								}
							}
						}
					}
					else
					{
						if(abs(player->x-ennemies[i].x) <= 1 && abs(player->y-ennemies[i].y) <= 1)
						{
						//melee
							if(rand()%101 <= ennemies[i].efficiency)
							{
								int degats = ennemies[i].strength*2 + rand()%5 + 3 - armor->resistance;
								if(degats > 0)
								{
									armor->state -= degats/3;
									player->life -= degats/2;
									wclear(win_msg);
									*colorPrint = 197; // RED LIKE BLOOOOOOOD
									snprintf(messagePrint,100,"%s HITS YOU WITH HIS SPEAR (-%d LP)",ennemies[i].name,degats/2); 
									*source = 9;
								}
							}
							else
							{
								wclear(win_msg);
								*colorPrint = 47;
								snprintf(messagePrint,100,"%s MISSED YOU !",ennemies[i].name);
							}
						}
						else
						{
							if(rand()%10+1 < 8)
							{
								if(abs(player->x - ennemies[i].x) > abs(player->y-ennemies[i].y))
								{
									if(player->x > ennemies[i].x)
									{
										if(map[ennemies[i].x+1][ennemies[i].y].content != WALL && map[ennemies[i].x+1][ennemies[i].y].content != DOOR)
											ennemies[i].x++;
									}
									else
									{
										if(map[ennemies[i].x-1][ennemies[i].y].content != WALL && map[ennemies[i].x-1][ennemies[i].y].content != DOOR)
											ennemies[i].x--;
									}
								}
								else
								{
									if(player->y > ennemies[i].y)
									{
										if(map[ennemies[i].x][ennemies[i].y+1].content != WALL && map[ennemies[i].x][ennemies[i].y+1].content != DOOR)
											ennemies[i].y++;
									}
									else
									{
										if(map[ennemies[i].x][ennemies[i].y-1].content != WALL&& map[ennemies[i].x][ennemies[i].y-1].content != DOOR)
											ennemies[i].y--;
									}
								}
							}
						}
					}
				break;

				case 4:
						if(abs(player->x-ennemies[i].x) <= 1 && abs(player->y-ennemies[i].y) <= 1)
						{
							if(rand()%3 == 1)
							{
								// explode !
								ennemies[i].life = 0;
								map[ennemies[i].x][ennemies[i].y].content = BOMB;

								int angle = 0;
								int c = 0;
								float ox = 0;
								float oy = 0;
								int tailleRad = 3;

								for(angle = 0; angle < 360; angle++)
								{
									if(oy >= 0 && oy <= LARGEUR && ox <= LONGUEUR && ox >= 0)
									{
										float angleI = cos((float)angle*0.01745f); // 1° = 0.01745 rad because 360° = 2pi rad
										float angleJ = sin((float)angle*0.01745f);
										ox = (float)ennemies[i].x+0.5f;
										oy = (float)ennemies[i].y+0.5f;

										for(c = 0; c < tailleRad && (int)ox+angleI <= LONGUEUR && (int)oy+angleJ <= LARGEUR; c++)
										{
											map[(int)ox][(int)oy].effect = 2;

											ox+=angleI;
											oy+=angleJ;		
										}
									}
								}
							}
						}
						else
						{
							if(abs(player->x - ennemies[i].x) > abs(player->y-ennemies[i].y))
							{
								if(player->x > ennemies[i].x)
								{
									if(map[ennemies[i].x+1][ennemies[i].y].content != WALL && map[ennemies[i].x+1][ennemies[i].y].content != DOOR)
										ennemies[i].x++;
								}
								else
								{
									if(map[ennemies[i].x-1][ennemies[i].y].content != WALL && map[ennemies[i].x-1][ennemies[i].y].content != DOOR)
										ennemies[i].x--;
								}
							}
							else
							{
								if(player->y > ennemies[i].y)
								{
									if(map[ennemies[i].x][ennemies[i].y+1].content != WALL && map[ennemies[i].x][ennemies[i].y+1].content != DOOR)
										ennemies[i].y++;
								}
								else
								{
									if(map[ennemies[i].x][ennemies[i].y-1].content != WALL&& map[ennemies[i].x][ennemies[i].y-1].content != DOOR)
										ennemies[i].y--;
								}
							}
					}
				break;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %rcx, 0x58(%rsp)
cmpl $0x0, (%rcx)
jle 0x6ad1
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
leaq -0xe38(%rdx), %rax
movq %rax, 0x50(%rsp)
leaq -0x1c70(%rdx), %rax
movq %rax, 0x88(%rsp)
leaq 0x14(%rdx), %rax
movq %rax, 0x78(%rsp)
leaq 0x1c74(%rdx), %rax
movq %rax, 0x80(%rsp)
xorl %ebx, %ebx
imulq $0x38, %rbx, %rax
leaq (%rax,%rbp), %r15
movslq (%rbp,%rax), %rcx
movslq 0x4(%rbp,%rax), %rax
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
imulq $0xe38, %rcx, %rax      # imm = 0xE38
addq %r12, %rax
movl 0x4(%rax,%rdx), %eax
cmpl $0x1, %eax
je 0x58f9
cmpl $0x3, %eax
je 0x58f9
cmpl $0x2, %eax
jne 0x5906
decl 0x8(%r15)
jmp 0x5906
addl $-0x4, 0x8(%r15)
movl $0x1, 0x24(%r15)
cmpl $0x1, 0x24(%r15)
jne 0x5932
addl $-0x5, 0x8(%r15)
callq 0x11d0
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
movl $0x19999998, %ecx       # imm = 0x19999998
addl %ecx, %eax
rorl %eax
cmpl %ecx, %eax
ja 0x5932
movl $0x0, 0x24(%r15)
movslq (%r15), %rax
movslq 0x4(%r15), %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x18, %rsi
movl (%rsi), %edi
cmpl $0x3, %edi
je 0x59b1
cmpl $0x2, %edi
je 0x597b
cmpl $0x1, %edi
jne 0x59e5
addl $-0x5, 0x8(%r15)
movl $0x0, (%rsi)
movl $0x1, (%rax,%rcx)
jmp 0x59e5
movl $0x2, 0x24(%r15)
movl $0x0, (%rsi)
movl $0x1, (%rax,%rcx)
callq 0x11d0
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
addl $0x19999999, %eax       # imm = 0x19999999
cmpl $0x33333332, %eax       # imm = 0x33333332
ja 0x59e5
movl $0x0, 0x24(%r15)
jmp 0x59e5
movl $0x0, (%rsi)
movl $0x1, %edi
movl %edi, (%rax,%rcx)
movl %edi, 0x20(%rcx,%rax)
decl %edx
movslq %edx, %rdx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
movl %edi, 0x4(%rax,%rsi)
movl %edi, 0xe3c(%rax,%rcx)
movl %edi, -0xe34(%rax,%rcx)
cmpl $0x0, 0x8(%r15)
jle 0x59f3
cmpl $0x2, 0x24(%r15)
jne 0x5a0c
incq %rbx
movq 0x58(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %rbx
jl 0x58b9
jmp 0x6ad1
movl 0x20(%r15), %eax
decl %eax
cmpl $0x3, %eax
ja 0x59f3
leaq 0xa542(%rip), %rcx      # 0xff60
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x3, 0x28(%r15)
jne 0x60b9
callq 0x11d0
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
cmpl $0x9, %eax
jg 0x62e1
movups 0xa527(%rip), %xmm0     # 0xff89
movq 0x40(%rsp), %rax
movups %xmm0, 0x9(%rax)
movups 0xa50e(%rip), %xmm0     # 0xff80
movups %xmm0, (%rax)
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
sarl %ecx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
notl %eax
addl %eax, 0x10(%r13)
callq 0x11d0
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x30(%r13)
xorl %eax, %eax
callq 0xaa83
jmp 0x59f3
movl (%r15), %ecx
movl 0x14(%r13), %eax
movl %eax, %edx
subl %ecx, %edx
movl %edx, %edi
negl %edi
cmovsl %edx, %edi
cmpl $0x1, 0x28(%r15)
jne 0x5f84
movl 0x18(%r13), %esi
movl 0x4(%r15), %edx
cmpl $0x2, %edi
ja 0x5b4e
movl %esi, %r8d
subl %edx, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl $0x2, %r9d
ja 0x5b57
callq 0x11d0
imull $0xaaaaaaab, %eax, %edx # imm = 0xAAAAAAAB
addl $0x2aaaaaaa, %edx       # imm = 0x2AAAAAAA
rorl %edx
movl 0x14(%r13), %eax
movl 0x18(%r13), %esi
movl (%r15), %ecx
cmpl $0x2aaaaaab, %edx       # imm = 0x2AAAAAAB
jb 0x6669
movl 0x4(%r15), %edx
movl %eax, %r8d
subl %ecx, %r8d
movl %r8d, %edi
negl %edi
cmovsl %r8d, %edi
cmpl $0x5, %edi
ja 0x684d
movl %esi, %r8d
subl %edx, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl $0x5, %r9d
ja 0x684d
movq 0x58(%rsp), %r8
cmpl $0x21, (%r8)
jg 0x684d
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jne 0x682f
movq 0x58(%rsp), %r14
incl (%r14)
movl 0x14(%r13), %r15d
callq 0x11d0
addl $-0x3, %r15d
movslq (%r14), %rax
movslq %ebx, %rcx
movq %rcx, 0x60(%rsp)
addq %rcx, %rax
imulq $0x38, %rax, %rax
movl %r15d, (%rbp,%rax)
movl 0x18(%r13), %r15d
callq 0x11d0
addl $-0x3, %r15d
movslq (%r14), %rax
movq 0x60(%rsp), %rcx
addq %rcx, %rax
imulq $0x38, %rax, %rax
movl %r15d, 0x4(%rbp,%rax)
movslq (%r14), %rax
addq %rcx, %rax
imulq $0x38, %rax, %rax
movl $0x3, %edx
movl %edx, 0x20(%rbp,%rax)
movslq (%r14), %rax
addq %rcx, %rax
imulq $0x38, %rax, %rax
xorl %edx, %edx
movl %edx, 0x28(%rbp,%rax)
movslq (%r14), %rax
addq %rcx, %rax
movq %rcx, %r15
imulq $0x38, %rax, %rax
movl $0x1e, 0x8(%rbp,%rax)
callq 0x11d0
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
addl $0x4, %eax
movslq (%r14), %rcx
addq %r15, %rcx
imulq $0x38, %rcx, %rcx
movl %eax, 0x10(%rbp,%rcx)
movslq (%r14), %rax
addq %r15, %rax
imulq $0x38, %rax, %rax
xorl %ecx, %ecx
movl %ecx, 0xc(%rbp,%rax)
movslq (%r14), %rax
addq %r15, %rax
imulq $0x38, %rax, %rax
movl $0x3, %esi
movl %esi, 0x14(%rbp,%rax)
movslq (%r14), %rax
addq %r15, %rax
imulq $0x38, %rax, %rax
movl %ecx, 0x18(%rbp,%rax)
movslq (%r14), %rax
addq %r15, %rax
imulq $0x38, %rax, %rax
leaq 0xa3ef(%rip), %rcx      # 0x10094
movq %rcx, 0x30(%rbp,%rax)
jmp 0x59f3
movl 0x14(%r13), %edx
movl 0x18(%r13), %esi
movslq (%r15), %rax
movl %edx, %ecx
subl %eax, %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x2, %edi
setb %r9b
movslq 0x4(%r15), %rcx
movl %esi, %r10d
subl %ecx, %r10d
movl %r10d, %r8d
negl %r8d
cmovsl %r10d, %r8d
cmpl $0x2, %r8d
setb %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0x607c
callq 0x11d0
movss 0xa232(%rip), %xmm6     # 0xff34
movss 0xa226(%rip), %xmm5     # 0xff30
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jne 0x59f3
movl $0x0, 0x8(%r15)
movslq (%r15), %rax
movslq 0x4(%r15), %rcx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl $0xa, (%rax,%rdx)
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
ucomiss 0xa1cf(%rip), %xmm1     # 0xff3c
jb 0x5e5a
ucomiss %xmm1, %xmm5
jb 0x5e5a
ucomiss %xmm0, %xmm6
jb 0x5e5a
ucomiss 0xa1b0(%rip), %xmm0     # 0xff3c
jb 0x5e5a
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
mulss 0xa196(%rip), %xmm0     # 0xff38
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
callq 0x10c0
movaps %xmm0, 0x60(%rsp)
movsd 0x90(%rsp), %xmm0
callq 0x1200
movss 0xa165(%rip), %xmm6     # 0xff34
movss 0xa159(%rip), %xmm5     # 0xff30
movapd 0x60(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
cvtpd2ps %xmm1, %xmm1
movapd %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
movsd (%r15), %xmm0
cvtdq2ps %xmm0, %xmm0
addps 0xa144(%rip), %xmm0     # 0xff40
movl $0x3, %eax
cvttps2dq %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
addss %xmm1, %xmm3
ucomiss %xmm3, %xmm6
jb 0x5e5a
movaps %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
cvttps2dq %xmm3, %xmm4
cvtdq2ps %xmm4, %xmm4
addss %xmm2, %xmm4
ucomiss %xmm4, %xmm5
jb 0x5e5a
cvttss2si %xmm0, %ecx
cvttss2si %xmm3, %edx
movslq %ecx, %rcx
movslq %edx, %rdx
imulq $0xe38, %rcx, %rcx      # imm = 0xE38
addq %r12, %rcx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
movl $0x2, 0x4(%rcx,%rsi)
addps %xmm1, %xmm0
decl %eax
jne 0x5e01
incl %r14d
cmpl $0x168, %r14d           # imm = 0x168
jne 0x5d5f
jmp 0x59f3
callq 0x11d0
cmpl $0x0, 0xc(%r15)
je 0x6294
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cmpl $0x0, 0x28(%r15)
je 0x6342
cmpl $0x6, %eax
jle 0x6347
cmpl $0x8, %eax
je 0x6542
cmpl $0x7, %eax
jne 0x6584
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
movq %rax, 0x60(%rsp)
callq 0x11d0
movl %eax, %r14d
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0xa110(%rip), %rdx      # 0x1002e
xorl %eax, %eax
callq 0x1050
movslq 0x14(%r13), %rax
addq 0x60(%rsp), %rax
movslq %r14d, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x21, %rdx
addl %esi, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
movslq %ecx, %rcx
movslq 0x18(%r13), %rdx
addq %rcx, %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
addq %r12, %rax
movl $0xa, -0x1ca8(%rax,%rcx)
movl $0x4, -0x1c94(%rax,%rcx)
jmp 0x59f3
cmpl $0x1, %edi
ja 0x6202
movl 0x18(%r13), %eax
subl 0x4(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x1, %ecx
ja 0x6202
callq 0x11d0
cltq
imulq $0x288df0cb, %rax, %rcx # imm = 0x288DF0CB
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x65, %ecx, %ecx
subl %ecx, %eax
cmpl 0x1c(%r15), %eax
jg 0x636d
movl 0x10(%r15), %r14d
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
leal (%rax,%r14,2), %r14d
movq 0xd0(%rsp), %rax
subl 0x14(%rax), %r14d
addl $0x3, %r14d
testl %r14d, %r14d
jle 0x59f3
movl %r14d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movq 0xd0(%rsp), %rcx
subl %eax, 0x18(%rcx)
shrl %r14d
subl %r14d, 0x10(%r13)
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0xa043(%rip), %rdx      # 0x100a2
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xe0(%rsp), %rax
movl $0x9, (%rax)
jmp 0x59f3
cmpl %r8d, %edi
jbe 0x62b8
cmpl %eax, %edx
jle 0x645c
incq %rax
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
imulq $0xe38, %rax, %rcx      # imm = 0xE38
addq %r12, %rcx
movl (%rcx,%rdx), %ecx
orl $0x4, %ecx
cmpl $0x6, %ecx
je 0x59f3
jmp 0x6484
cmpl $0x0, 0xc(%r15)
je 0x6a24
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cmpl $0x7, %eax
jg 0x63a6
cmpl $0x5, %eax
jl 0x60ff
cmpl $0xf, 0x8(%r15)
jle 0x63a6
testl %eax, %eax
je 0x6a24
movl 0x14(%r13), %edx
movslq (%r15), %rax
movl %edx, %ecx
subl %eax, %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
cmpl $0x1, %esi
ja 0x676a
movl 0x18(%r13), %ecx
subl 0x4(%r15), %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x1, %edi
ja 0x676a
callq 0x11d0
cltq
imulq $0x288df0cb, %rax, %rcx # imm = 0x288DF0CB
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x65, %ecx, %ecx
subl %ecx, %eax
cmpl 0x1c(%r15), %eax
jg 0x636d
movl 0x10(%r15), %r14d
callq 0x11d0
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
movq 0xd0(%rsp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, %edx
negl %edx
leal (%rax,%r14,2), %eax
cmovnsl %ecx, %edx
leal (%rdx,%rax), %r14d
incl %r14d
testl %r14d, %r14d
jle 0x59f3
movl %r14d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movq 0xd0(%rsp), %rcx
subl %eax, 0x18(%rcx)
shrl %r14d
subl %r14d, 0x10(%r13)
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x9d9c(%rip), %rdx      # 0xff99
jmp 0x6812
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cmpl $0x6, %eax
jg 0x59f3
movl 0x14(%r13), %edx
movl 0x18(%r13), %esi
movslq (%r15), %rcx
movl %edx, %eax
subl %ecx, %eax
movl %eax, %edi
negl %edi
cmovsl %eax, %edi
movslq 0x4(%r15), %rax
movl %esi, %r8d
subl %eax, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl %r9d, %edi
jbe 0x6508
cmpl %ecx, %edx
jle 0x670e
incq %rcx
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
imulq $0xe38, %rcx, %rax      # imm = 0xE38
addq %r12, %rax
movl (%rax,%rdx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
jmp 0x6736
callq 0x11d0
imull $0x962fc963, %eax, %eax # imm = 0x962FC963
addl $0x1b4e81b, %eax        # imm = 0x1B4E81B
cmpl $0x369d036, %eax        # imm = 0x369D036
ja 0x59f3
incl 0x8(%r15)
jmp 0x59f3
cmpl %ecx, %esi
jle 0x648c
leaq 0x1(%rcx), %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rsi, %rcx
incq %rcx
jmp 0x64a8
cmpl $0x1d, %eax
ja 0x64c0
movslq 0x14(%r13), %rax
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
movslq 0x18(%r13), %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl $0x2, %ecx
movl %ecx, 0xe38(%rdx,%rax)
movl $0xa, %esi
movl %esi, 0xe4c(%rdx,%rax)
movl %ecx, -0xe38(%rdx,%rax)
movl %esi, -0xe24(%rdx,%rax)
movl %ecx, 0x1c(%rdx,%rax)
movl %esi, 0x30(%rdx,%rax)
movl %ecx, -0x1c(%rdx,%rax)
movl %esi, -0x8(%rdx,%rax)
jmp 0x59f3
cmpl $0x7, %eax
jg 0x63a6
callq 0x11d0
cltq
imulq $0x288df0cb, %rax, %rcx # imm = 0x288DF0CB
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x65, %ecx, %ecx
subl %ecx, %eax
cmpl 0x1c(%r15), %eax
jle 0x63cc
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0x2f, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x9c2c(%rip), %rdx      # 0xffc6
xorl %eax, %eax
callq 0x1050
jmp 0x59f3
movq 0xd8(%rsp), %rdi
callq 0x1030
movq %rbp, %rdi
movl %ebx, %esi
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x6ae3
jmp 0x59f3
movq 0x30(%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
movq 0xd0(%rsp), %rsi
movq %r12, %rdx
callq 0x6b8f
testl %eax, %eax
jle 0x59f3
movl %eax, %r14d
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
shrl %r14d
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x9bc1(%rip), %rdx      # 0x10000
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xe0(%rsp), %rax
movl $0x8, (%rax)
jmp 0x59f3
imulq $0xe38, %rax, %rdx      # imm = 0xE38
addq 0x50(%rsp), %rdx
leaq (%rcx,%rcx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rcx, %rsi
movl (%rdx,%rsi), %ecx
orl $0x4, %ecx
cmpl $0x6, %ecx
je 0x59f3
decl %eax
movl %eax, (%r15)
jmp 0x59f3
leaq -0x1(%rcx), %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rsi, %rcx
decq %rcx
movl (%rax,%rcx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
movl %edx, 0x4(%r15)
jmp 0x59f3
cmpl $0x27, %eax
ja 0x6626
movslq (%r15), %rax
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq 0x80(%rsp), %rax
movq $-0xe38, %rcx           # imm = 0xF1C8
movl $0x2, -0x4(%rax,%rcx)
movl $0x5, 0x10(%rax,%rcx)
movl $0x1, 0xe38(%rax,%rcx)
addq $0x1c, %rcx
jne 0x64e2
jmp 0x59f3
imulq $0xe38, %rcx, %rcx      # imm = 0xE38
addq %r12, %rcx
cmpl %eax, %esi
jle 0x673e
leaq (%rax,%rax,8), %rdx
addq $0x9, %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
incq %rdx
movl (%rcx,%rdx), %ecx
orl $0x4, %ecx
cmpl $0x6, %ecx
je 0x59f3
incl %eax
jmp 0x6761
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0x2f, (%rax)
movups 0x9ae9(%rip), %xmm0     # 0x1004a
movq 0x40(%rsp), %rax
movups %xmm0, (%rax)
movups 0x9aea(%rip), %xmm0     # 0x1005a
movups %xmm0, 0x10(%rax)
movups 0x9ae9(%rip), %xmm0     # 0x10064
movups %xmm0, 0x1a(%rax)
jmp 0x59f3
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movups 0x9aee(%rip), %xmm0     # 0x10084
movq 0x40(%rsp), %rax
movups %xmm0, 0x10(%rax)
movups 0x9ace(%rip), %xmm0     # 0x10074
movups %xmm0, (%rax)
movslq 0x14(%r13), %r15
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movslq %eax, %r14
addq %r15, %r14
movl 0x18(%r13), %r15d
callq 0x11d0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x21, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
addl %r15d, %eax
addl $-0x2, %eax
cltq
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
imulq $0xe38, %r14, %rax      # imm = 0xE38
addq 0x88(%rsp), %rax
movl $0x1, 0x4(%rax,%rcx)
jmp 0x59f3
cmpl $0x3b, %eax
ja 0x692f
movslq 0x18(%r13), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r12, %rax
addq %rcx, %rax
movq $-0x18, %rcx
movl $0x1, %edx
movl %edx, (%rax,%rcx)
movl %edx, 0x38(%rax,%rcx)
addq $0xe38, %rcx            # imm = 0xE38
cmpq $0x22a70, %rcx          # imm = 0x22A70
jne 0x6648
jmp 0x59f3
movslq %eax, %rdi
movslq %esi, %r8
xorl %edx, %edx
cmpl %ecx, %eax
setg %sil
imulq $0xe38, %rdi, %r9       # imm = 0xE38
addq %r12, %r9
leaq (%r8,%r8,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %r8, %rcx
cmpl $0x2, (%r9,%rcx)
je 0x66d9
movb %sil, %dl
leaq -0x1(,%rdx,2), %rdx
addq %rdx, %rdi
imulq $0xe38, %rdi, %rsi      # imm = 0xE38
addq %r12, %rsi
addq %rcx, %rsi
imulq $0xe38, %rdx, %rdi      # imm = 0xE38
addl %edx, %eax
movl $0x4, %r8d
movl %eax, %r9d
movl %r9d, %eax
decl %r8d
je 0x66d5
cmpl $0x2, (%rsi)
leaq (%rsi,%rdi), %rsi
leal (%rax,%rdx), %r9d
jne 0x66c0
movl %eax, 0x14(%r13)
cltq
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
cmpl $0x2, (%rax,%rcx)
jne 0x59f3
addq %rcx, %rax
addl $-0xa, 0x10(%r13)
movq 0xd0(%rsp), %rcx
addl $-0xa, 0x18(%rcx)
movl $0x1, (%rax)
jmp 0x59f3
imulq $0xe38, %rcx, %rdx      # imm = 0xE38
addq 0x50(%rsp), %rdx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rax, %rsi
movl (%rdx,%rsi), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
decl %ecx
movl %ecx, (%r15)
jmp 0x59f3
leaq (%rax,%rax,8), %rdx
addq $-0x9, %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rax, %rdx
decq %rdx
movl (%rcx,%rdx), %ecx
orl $0x4, %ecx
cmpl $0x6, %ecx
je 0x59f3
decl %eax
movl %eax, 0x4(%r15)
jmp 0x59f3
cmpl $0x1, 0x18(%r15)
jne 0x69c4
callq 0x11d0
cltq
imulq $0x288df0cb, %rax, %rcx # imm = 0x288DF0CB
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x65, %ecx, %ecx
subl %ecx, %eax
cmpl 0x1c(%r15), %eax
jg 0x636d
movq 0x30(%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
movq 0xd0(%rsp), %rsi
movq %r12, %rdx
callq 0x6b8f
testl %eax, %eax
jle 0x59f3
movl %eax, %r14d
movq 0xd8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
shrl %r14d
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x97c4(%rip), %rdx      # 0xffd6
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xe0(%rsp), %rax
movl $0x7, (%rax)
jmp 0x59f3
movl 0x14(%r13), %eax
movl 0x18(%r13), %esi
movl (%r15), %ecx
movl 0x4(%r15), %edx
movl %eax, %r8d
subl %ecx, %r8d
movl %r8d, %edi
negl %edi
cmovsl %r8d, %edi
movl %esi, %r8d
subl %edx, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl %r9d, %edi
jbe 0x6894
cmpl %ecx, %eax
jle 0x68cd
incl %ecx
movslq %ecx, %rax
movslq %edx, %rdx
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
movl (%rax,%rsi), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
jmp 0x68fb
movslq %ecx, %rax
movslq %edx, %rcx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
cmpl %edx, %esi
jle 0x6903
leaq (%rcx,%rcx,8), %rsi
addq $0x9, %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rsi, %rcx
incq %rcx
movl (%rax,%rcx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
incl %edx
jmp 0x6926
movslq %ecx, %rax
movslq %edx, %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq 0x50(%rsp), %rax
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
movl (%rax,%rsi), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
decl %ecx
movl %ecx, (%r15)
jmp 0x59f3
leaq (%rcx,%rcx,8), %rsi
addq $-0x9, %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rsi, %rcx
decq %rcx
movl (%rax,%rcx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
decl %edx
movl %edx, 0x4(%r15)
jmp 0x59f3
cmpl $0x45, %eax
ja 0x6a1f
callq 0x11d0
cltq
imulq $0x7e07e07f, %rax, %rcx # imm = 0x7E07E07F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movl %ecx, %edx
shll $0x7, %edx
leal (%rdx,%rcx,2), %ecx
subl %ecx, %eax
movl 0x14(%r13), %ecx
cltq
imulq $0xe38, %rcx, %rcx      # imm = 0xE38
leaq (%rax,%rax,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x78(%rsp), %rsi
addq %rax, %rsi
addq %rsi, %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
jne 0x6991
cmpl %eax, 0x18(%r13)
jne 0x6991
addl $-0xa, 0x10(%r13)
jmp 0x69a0
movl $0x2, -0x14(%rdx,%rsi)
movl $0x5, (%rdx,%rsi)
addq $0xe38, %rsi            # imm = 0xE38
cmpq $0x22a88, %rsi          # imm = 0x22A88
jne 0x697f
incq %rax
addq $0x1c, %rdx
cmpq $0x82, %rax
jne 0x697d
jmp 0x59f3
movl 0x18(%r13), %edi
movslq 0x4(%r15), %rcx
movl %edi, %r8d
subl %ecx, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
cmpl %r9d, %esi
ja 0x6085
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
cmpl %ecx, %edi
jle 0x6aa5
leaq (%rcx,%rcx,8), %rdx
addq $0x9, %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
incq %rdx
movl (%rax,%rdx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
incl %ecx
jmp 0x6ac8
cmpl $0x5e, %eax
ja 0x6a36
movq %rbp, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x5634
jmp 0x59f3
callq 0x11d0
cltq
imulq $-0x2df2df2d, %rax, %rcx # imm = 0xD20D20D3
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x5, %ecx
addl %edx, %ecx
imull $0x27, %ecx, %ecx
subl %ecx, %eax
movslq %eax, %r14
callq 0x11d0
cltq
imulq $0x7e07e07f, %rax, %rcx # imm = 0x7E07E07F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movl %ecx, %edx
shll $0x7, %edx
leal (%rdx,%rcx,2), %ecx
subl %ecx, %eax
cltq
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
imulq $0xe38, %r14, %rax      # imm = 0xE38
addq %r12, %rax
movl $0x3, 0x4(%rax,%rcx)
jmp 0x59f3
leaq (%rcx,%rcx,8), %rdx
addq $-0x9, %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
decq %rdx
movl (%rax,%rdx), %eax
orl $0x4, %eax
cmpl $0x6, %eax
je 0x59f3
decl %ecx
movl %ecx, 0x4(%r15)
jmp 0x59f3
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq