// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %rsp
movq %r9, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq %rcx, 0x60(%rsp)
cmpl $0x0, (%rcx)
jle 0x689d
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
leaq -0xe38(%rdx), %rax
movq %rax, 0x58(%rsp)
leaq -0x1c70(%rdx), %rax
movq %rax, 0x80(%rsp)
leaq 0x14(%rdx), %rax
movq %rax, 0x70(%rsp)
leaq 0x1c74(%rdx), %rax
movq %rax, 0x78(%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 0x5879
cmpl $0x3, %eax
je 0x5879
cmpl $0x2, %eax
jne 0x5886
decl 0x8(%r15)
jmp 0x5886
addl $-0x4, 0x8(%r15)
movl $0x1, 0x24(%r15)
cmpl $0x1, 0x24(%r15)
jne 0x58b2
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 0x58b2
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 0x5931
cmpl $0x2, %edi
je 0x58fb
cmpl $0x1, %edi
jne 0x5965
addl $-0x5, 0x8(%r15)
movl $0x0, (%rsi)
movl $0x1, (%rax,%rcx)
jmp 0x5965
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 0x5965
movl $0x0, 0x24(%r15)
jmp 0x5965
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 0x5973
cmpl $0x2, 0x24(%r15)
jne 0x598c
incq %rbx
movq 0x60(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %rbx
jl 0x5839
jmp 0x689d
movl 0x20(%r15), %eax
decl %eax
cmpl $0x3, %eax
ja 0x5973
leaq 0xa566(%rip), %rcx      # 0xff04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x3, 0x28(%r15)
jne 0x5fd6
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 0x620b
movups 0xa54b(%rip), %xmm0     # 0xff2d
movq 0x40(%rsp), %rax
movups %xmm0, 0x9(%rax)
movups 0xa532(%rip), %xmm0     # 0xff24
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 0xa98e
jmp 0x5973
movl (%r15), %eax
cmpl $0x1, 0x28(%r15)
jne 0x5ed1
movl 0x14(%r13), %ecx
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x2, %eax
ja 0x5aa1
movl 0x18(%r13), %eax
subl 0x4(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x2, %ecx
ja 0x5aa1
callq 0x11d0
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
movl $0x2aaaaaaa, %ecx       # imm = 0x2AAAAAAA
addl %ecx, %eax
rorl %eax
cmpl %ecx, %eax
jbe 0x654e
movl 0x14(%r13), %eax
subl (%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x5, %ecx
ja 0x614a
movl 0x18(%r13), %eax
subl 0x4(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x5, %ecx
ja 0x614a
movq 0x60(%rsp), %rax
cmpl $0x21, (%rax)
jg 0x614a
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 0x614a
movq 0x60(%rsp), %r14
incl (%r14)
movl 0x14(%r13), %r15d
callq 0x11d0
addl $-0x3, %r15d
movslq (%r14), %rax
movslq %ebx, %rcx
movq %rcx, 0x50(%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 0x50(%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 0xa435(%rip), %rcx      # 0x10038
movq %rcx, 0x30(%rbp,%rax)
jmp 0x5973
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 0x66a9
movl 0x18(%r13), %ecx
subl 0x4(%r15), %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x1, %edi
ja 0x66a9
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
cmpl $0x1, %eax
jne 0x5973
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)
xorl %r14d, %r14d
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
ucomiss 0xa25c(%rip), %xmm1     # 0xff00
jb 0x5da7
movss 0xa23e(%rip), %xmm2     # 0xfef0
ucomiss %xmm1, %xmm2
jb 0x5da7
movss 0xa231(%rip), %xmm2     # 0xfef4
ucomiss %xmm0, %xmm2
jb 0x5da7
ucomiss 0xa22d(%rip), %xmm0     # 0xff00
jb 0x5da7
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
mulss 0xa20f(%rip), %xmm0     # 0xfef8
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
callq 0x10c0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x6c(%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x1200
movss 0x6c(%rsp), %xmm5
xorps %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl (%r15), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x4(%r15), %xmm1
movss 0xa1c9(%rip), %xmm3     # 0xfefc
addss %xmm3, %xmm0
addss %xmm3, %xmm1
movl $0x3, %eax
cvttps2dq %xmm0, %xmm3
cvtdq2ps %xmm3, %xmm3
addss %xmm5, %xmm3
movss 0xa1a1(%rip), %xmm4     # 0xfef4
ucomiss %xmm3, %xmm4
jb 0x5da7
cvttps2dq %xmm1, %xmm3
cvtdq2ps %xmm3, %xmm3
addss %xmm2, %xmm3
movss 0xa185(%rip), %xmm4     # 0xfef0
ucomiss %xmm3, %xmm4
jb 0x5da7
cvttss2si %xmm0, %ecx
cvttss2si %xmm1, %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)
addss %xmm5, %xmm0
addss %xmm2, %xmm1
decl %eax
jne 0x5d40
incl %r14d
cmpl $0x168, %r14d           # imm = 0x168
jne 0x5c9d
jmp 0x5973
callq 0x11d0
cmpl $0x0, 0xc(%r15)
je 0x61ad
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 0x626c
cmpl $0x6, %eax
jle 0x6271
cmpl $0x8, %eax
je 0x6427
cmpl $0x7, %eax
jne 0x6469
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, 0x50(%rsp)
callq 0x11d0
movl %eax, %r14d
movq 0xc8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0xa167(%rip), %rdx      # 0xffd2
xorl %eax, %eax
callq 0x1050
movslq 0x14(%r13), %rax
addq 0x50(%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 0x5973
movl 0x14(%r13), %ecx
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x1, %eax
ja 0x611f
movl 0x18(%r13), %eax
subl 0x4(%r15), %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x1, %ecx
ja 0x611f
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 0x6297
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 0xc0(%rsp), %rax
subl 0x14(%rax), %r14d
addl $0x3, %r14d
testl %r14d, %r14d
jle 0x5973
movl %r14d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movq 0xc0(%rsp), %rcx
subl %eax, 0x18(%rcx)
shrl %r14d
subl %r14d, 0x10(%r13)
movq 0xc8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0xa08d(%rip), %rdx      # 0x10046
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xd0(%rsp), %rax
movl $0x9, (%rax)
jmp 0x5973
cmpl $0x0, 0xc(%r15)
je 0x681c
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 0x62d0
cmpl $0x5, %eax
jl 0x601c
cmpl $0xf, 0x8(%r15)
jle 0x62d0
testl %eax, %eax
je 0x681c
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 0x65e4
movl 0x18(%r13), %ecx
subl 0x4(%r15), %ecx
movl %ecx, %edi
negl %edi
cmovsl %ecx, %edi
cmpl $0x1, %edi
ja 0x65e4
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 0x6297
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 0xc0(%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 0x5973
movl %r14d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movq 0xc0(%rsp), %rcx
subl %eax, 0x18(%rcx)
shrl %r14d
subl %r14d, 0x10(%r13)
movq 0xc8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x9e23(%rip), %rdx      # 0xff3d
jmp 0x668c
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 0x5973
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 0x61d1
cmpl %ecx, %edx
jle 0x6386
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 0x5973
jmp 0x63ae
callq 0x11d0
imull $0x962fc963, %eax, %eax # imm = 0x962FC963
addl $0x1b4e81b, %eax        # imm = 0x1B4E81B
cmpl $0x369d036, %eax        # imm = 0x369D036
ja 0x5973
incl 0x8(%r15)
jmp 0x5973
imulq $0xe38, %rcx, %rcx      # imm = 0xE38
addq %r12, %rcx
cmpl %eax, %esi
jle 0x63b6
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 0x5973
incl %eax
jmp 0x63d9
cmpl $0x1d, %eax
jg 0x63e2
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 0x5973
cmpl $0x7, %eax
jg 0x62d0
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 0x62f6
movq 0xc8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0x2f, (%rax)
movq 0x30(%r15), %rcx
movl $0x64, %esi
movq 0x40(%rsp), %rdi
leaq 0x9ca6(%rip), %rdx      # 0xff6a
xorl %eax, %eax
callq 0x1050
jmp 0x5973
movq 0xc8(%rsp), %rdi
callq 0x1030
movq %rbp, %rdi
movl %ebx, %esi
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
callq 0x68af
jmp 0x5973
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 0xc0(%rsp), %rsi
movq %r12, %rdx
callq 0x695b
testl %eax, %eax
jle 0x5973
movl %eax, %r14d
movq 0xc8(%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 0x9c3b(%rip), %rdx      # 0xffa4
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xd0(%rsp), %rax
movl $0x8, (%rax)
jmp 0x5973
imulq $0xe38, %rcx, %rdx      # imm = 0xE38
addq 0x58(%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 0x5973
decl %ecx
movl %ecx, (%r15)
jmp 0x5973
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 0x5973
decl %eax
movl %eax, 0x4(%r15)
jmp 0x5973
cmpl $0x27, %eax
jg 0x650b
movslq (%r15), %rax
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq 0x78(%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 0x6401
jmp 0x5973
movq 0xc8(%rsp), %rdi
callq 0x1030
movq 0x48(%rsp), %rax
movl $0x2f, (%rax)
movups 0x9ba8(%rip), %xmm0     # 0xffee
movq 0x40(%rsp), %rax
movups %xmm0, (%rax)
movups 0x9ba9(%rip), %xmm0     # 0xfffe
movups %xmm0, 0x10(%rax)
movups 0x9ba8(%rip), %xmm0     # 0x10008
movups %xmm0, 0x1a(%rax)
jmp 0x5973
movq 0x48(%rsp), %rax
movl $0xc5, (%rax)
movups 0x9bad(%rip), %xmm0     # 0x10028
movq 0x40(%rsp), %rax
movups %xmm0, 0x10(%rax)
movups 0x9b8d(%rip), %xmm0     # 0x10018
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 0x80(%rsp), %rax
movl $0x1, 0x4(%rax,%rcx)
jmp 0x5973
cmpl $0x3b, %eax
jg 0x6782
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 0x652d
jmp 0x5973
movslq 0x14(%r13), %rsi
xorl %eax, %eax
cmpl (%r15), %esi
setg %al
leaq -0x1(,%rax,2), %rax
movslq 0x18(%r13), %rdx
imulq $0xe38, %rsi, %rdi      # imm = 0xE38
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
addq %rdi, %rcx
addq %r12, %rcx
imulq $0xe38, %rax, %rdx      # imm = 0xE38
addl %eax, %esi
movl $0x4, %edi
cmpl $0x2, (%rcx)
je 0x659e
movl %esi, 0x14(%r13)
addq %rdx, %rcx
addl %eax, %esi
decl %edi
jne 0x658c
movslq 0x14(%r13), %rax
movslq 0x18(%r13), %rdx
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
cmpl $0x2, (%rax,%rcx)
jne 0x5973
addq %rcx, %rax
addl $-0xa, 0x10(%r13)
movq 0xc0(%rsp), %rcx
addl $-0xa, 0x18(%rcx)
movl $0x1, (%rax)
jmp 0x5973
cmpl $0x1, 0x18(%r15)
jne 0x66a9
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 0x6297
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 0xc0(%rsp), %rsi
movq %r12, %rdx
callq 0x695b
testl %eax, %eax
jle 0x5973
movl %eax, %r14d
movq 0xc8(%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 0x98ee(%rip), %rdx      # 0xff7a
movl %r14d, %r8d
xorl %eax, %eax
callq 0x1050
movq 0xd0(%rsp), %rax
movl $0x7, (%rax)
jmp 0x5973
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
jbe 0x66f3
cmpl %eax, %edx
jle 0x6726
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 0x5973
jmp 0x674e
imulq $0xe38, %rax, %rax      # imm = 0xE38
addq %r12, %rax
cmpl %ecx, %edi
jle 0x6756
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 0x5973
incl %ecx
jmp 0x6779
imulq $0xe38, %rax, %rdx      # imm = 0xE38
addq 0x58(%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 0x5973
decl %eax
movl %eax, (%r15)
jmp 0x5973
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 0x5973
decl %ecx
movl %ecx, 0x4(%r15)
jmp 0x5973
cmpl $0x45, %eax
jg 0x6817
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 0x70(%rsp), %rsi
addq %rax, %rsi
addq %rsi, %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
jne 0x67e4
cmpl %eax, 0x18(%r13)
jne 0x67e4
addl $-0xa, 0x10(%r13)
jmp 0x67f3
movl $0x2, -0x14(%rdx,%rsi)
movl $0x5, (%rdx,%rsi)
addq $0xe38, %rsi            # imm = 0xE38
cmpq $0x22a88, %rsi          # imm = 0x22A88
jne 0x67d2
incq %rax
addq $0x1c, %rdx
cmpq $0x82, %rax
jne 0x67d0
jmp 0x5973
cmpl $0x5e, %eax
jg 0x682e
movq %rbp, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x55d0
jmp 0x5973
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 0x5973
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq