// File: /workspace/github_c_makefile_star2_O3/S01den[P]Lost_CavernRL/screen.c
// Function: recalcScreen
void recalcScreen(WINDOW *win_map, Map map[LONGUEUR][LARGEUR], int nbrEnnemies, Ennemy ennemies[])
{
	const char tileset_ennemies[] = "dtgn";
	const char tileset[] = " .#>=!+]/;* ?";
	const char tileset_pnj[] = "cwes";
	
	int j = 0;
	int i = 0;

	for(i = 0; i < LARGEUR; i++)
	{
		for(j = 0; j < LONGUEUR; j++)
		{
			if(map[j][i].seen == 1)
			{
				if(map[j][i].typeEnnemy == 0)
				{
					if(map[j][i].content == STAIRS)
					{
						wattron(win_map,A_BOLD);
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,A_BOLD);
					}
					else if(map[j][i].content == HOLE)
					{
						wattron(win_map,COLOR_PAIR(COLOR_HOLE));
						mvwprintw(win_map,j+1,i+1," ");
						wattroff(win_map,COLOR_PAIR(COLOR_HOLE));	
					}
					else if(map[j][i].content == MINES || map[j][i].content == DIST_WEAPON || map[j][i].content == CONTACT_WEAPON || map[j][i].content == DRUG || map[j][i].content == COMPUTER)
					{
						wattron(win_map,A_BOLD);
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,A_BOLD);		
					}
					else if(map[j][i].content == DOOR)
					{
						wattron(win_map,COLOR_PAIR(15));
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,COLOR_PAIR(15));			
					}
					else if(map[j][i].content == PNJ)
					{
						wattron(win_map,A_BOLD);
						mvwprintw(win_map,j+1,i+1,"%c",tileset_pnj[map[j][i].typePnj]);
						wattroff(win_map,A_BOLD);
					}				
					else if(map[j][i].content == BOMB)
					{
						wattron(win_map,A_BOLD);
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,A_BOLD);
						if(map[j][i].resistance-1 > 0)
						{
							map[j][i].resistance--;
						}
						else // EXPLOSION !!!
						{
							map[j][i].resistance = 0;
							map[j][i].content = FLOOR;
							map[j][i].effect = 2;
							if(i > 0)
								map[j][i-1].effect = 2;
							if(i < LARGEUR-1)
								map[j][i+1].effect = 2;
							if(j > 0)
								map[j-1][i].effect = 2;		
							if(j < LONGUEUR-1)
								map[j+1][i].effect = 2;

							int k = 0;
							int l = 0;

							int minJ = j-5;
							if(minJ < 0)
								minJ = 0;
							int maxJ = j+5;
							if(maxJ >= LONGUEUR)
								minJ = LONGUEUR-1;
							int minI = i-5;
							if(minI < 0)
								minI = 0;
							int maxI = i+5;
							if(maxI >= LARGEUR)
								maxI = LARGEUR-1;

							for(k = minJ; k <= maxJ; k++)
							{
								for(l = minI; l <= maxI; l++)
								{
									if(testEnnemyOnPos(ennemies,k,l,nbrEnnemies) >= 0)
									{
										ennemies[testEnnemyOnPos(ennemies,k,l,nbrEnnemies)].life -= 21+rand()%10;
									}
									if(rand()%4 <= 2)
									{
										map[k][l].resistance = 0;
										map[k][l].content = FLOOR;
									}
									if(rand()%5 == 0) //set fire
										map[k][l].effect = 1;	
								}
							}	

							flashBomb(win_map);
						}
					}
					else if(map[j][i].effect == 0)
					{
						wattron(win_map,A_DIM);
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,A_DIM);
					}
					else if(map[j][i].effect == 1) // fire
					{
						if(rand()%300 <= 298)
						{
							if(rand()%4 == 3)
							{
								wattron(win_map,COLOR_PAIR(10));
								mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
								wattroff(win_map,COLOR_PAIR(10));		
							}
							else
							{
								wattron(win_map,COLOR_PAIR(203));
								mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
								wattroff(win_map,COLOR_PAIR(203));
							}					
						}
						else
						{
							map[j][i].effect = 0;
							wattron(win_map,A_BOLD);
							mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
							wattroff(win_map,A_BOLD);						
						}

						if(map[j][i].content == WALL && rand()%10 == 2)
						{
							if(map[j][i].resistance-1 > 0)
							{
								map[j][i].resistance--;
							}
							else
							{
								map[j][i].resistance = 0;
								if(rand()%100 <= 90)
									map[j][i].content = FLOOR;
								else
								{
									map[j][i].content = MINES;
									map[j][i].trap = 1;
								}
							}
						}						
					}
					else if(map[j][i].effect == 2) // radioactive
					{
						wattron(win_map,COLOR_PAIR(41));
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,COLOR_PAIR(41));				
					}
					else if(map[j][i].effect == 4) // gem
					{
						wattron(win_map,COLOR_PAIR(124));
						mvwprintw(win_map,j+1,i+1,"%c",tileset[map[j][i].content]);
						wattroff(win_map,COLOR_PAIR(124));				
					}
					else if(map[j][i].effect == 3) // lava
					{
						if(rand()%4 == 0)
						{
							wattron(win_map,COLOR_PAIR(203));
							mvwprintw(win_map,j+1,i+1,"*");
							wattroff(win_map,COLOR_PAIR(203));
						}
						else
						{
							wattron(win_map,COLOR_PAIR(COLOR_LAVA));
							mvwprintw(win_map,j+1,i+1,"*");
							wattroff(win_map,COLOR_PAIR(COLOR_LAVA));
						}

						int counterX = 0;
						int counterY = 0;

						for(counterX = -1; counterX <= 1; counterX++) // the lava flow
						{
							for(counterY = -1; counterY <= 1; counterY++)
							{
								if(rand()%10 == 0)
								{
									if(map[j+counterX][i+counterY].content == FLOOR || map[j+counterX][i+counterY].content == CONTACT_WEAPON || map[j+counterX][i+counterY].content == DIST_WEAPON)
									{
										map[j+counterX][i+counterY].effect = 3;
									}
								}
							}
						}		
					}				
				}
				else
				{
					int ennemy = testEnnemyOnPos(ennemies,j,i,nbrEnnemies);
					if(ennemy >= 0)
					{
						ennemies[ennemy].seen = 0;
						wattron(win_map,A_BOLD);
						mvwprintw(win_map,j+1,i+1,"%c",tileset_ennemies[map[j][i].typeEnnemy-1]);
						wattroff(win_map,A_BOLD);
					}
				}
			}				
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movq %rdi, 0x28(%rsp)
leaq -0xe38(%rsi), %rax
movq %rax, 0x78(%rsp)
leaq -0x8c(%rsi), %rax
movq %rax, 0x70(%rsp)
movq %rsi, 0x60(%rsp)
leaq -0xe50(%rsi), %rcx
xorl %edx, %edx
movl %r12d, 0x34(%rsp)
cmpl $0x6, %edx
movl $0x5, %esi
cmovgel %edx, %esi
leaq (%rsi,%rsi,8), %rax
leaq (%rax,%rax,2), %rdi
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %r8
addq %rdx, %r8
movq 0x78(%rsp), %rax
movq %r8, 0x38(%rsp)
addq %r8, %rax
addq $0x4, %rax
movq %rax, 0x90(%rsp)
leaq 0x1(%rdx), %rax
movq %rax, 0x20(%rsp)
leaq -0x1(%rdx), %rax
movq %rax, 0x88(%rsp)
movl %esi, %eax
addl $-0x5, %eax
movl %eax, 0x4c(%rsp)
cmpl $0x7c, %edx
movl $0x7c, %eax
movq %rdx, 0x58(%rsp)
cmovbl %edx, %eax
addl $0x5, %eax
movq %rax, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rsi, 0xa0(%rsp)
addq %rsi, %rax
addq %rax, %rdi
movq %rdi, 0x80(%rsp)
movl $0x6, %edx
movq %rcx, 0x98(%rsp)
xorl %esi, %esi
imulq $0xe38, %rsi, %r15      # imm = 0xE38
movq 0x60(%rsp), %rax
leaq (%rax,%r15), %rbp
movq 0x38(%rsp), %rax
cmpl $0x1, 0x8(%rbp,%rax)
jne 0xdccd
movq %rcx, 0x18(%rsp)
movl %edx, 0xc(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%rbp), %r13
cmpl $0x0, 0xc(%r13)
movq %rsi, 0x10(%rsp)
je 0xdc50
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x58(%rsp), %rdx
movl %r12d, %ecx
callq 0x5820
movq 0x10(%rsp), %rsi
testl %eax, %eax
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
js 0xdccd
movl %eax, %eax
imulq $0x38, %rax, %rax
movl $0x0, 0xc(%rbx,%rax)
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq 0xc(%r13), %rax
leaq 0x3e64(%rip), %rcx      # 0x11a71
movsbl -0x1(%rax,%rcx), %r8d
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x3e3e(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rcx
movl 0xc(%rsp), %edx
jmp 0xdccd
movl (%r13), %eax
cmpq $0xc, %rax
ja 0xdd34
leaq 0x3dbb(%rip), %rcx      # 0x11a20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3de9(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x3dbf(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
incq %rsi
incl %edx
addq $0xe38, %rcx            # imm = 0xE38
cmpq $0x27, %rsi
jne 0xdb73
jmp 0xe35c
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0xf00, %esi            # imm = 0xF00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3d6f(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x3d45(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0xf00, %esi            # imm = 0xF00
jmp 0xdcb8
movl 0x4(%r13), %eax
cmpq $0x4, %rax
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
ja 0xdccd
leaq 0x3d06(%rip), %rcx      # 0x11a54
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x100000, %esi         # imm = 0x100000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3d00(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %r15
leal 0x1(%r15), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x3cd5(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x100000, %esi         # imm = 0x100000
jmp 0xe0f7
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq 0x10(%r13), %rax
leaq 0x3cbe(%rip), %rcx      # 0x11a84
jmp 0xdc8d
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rsi
movslq (%r13), %rax
leaq 0x3c83(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq %r14, %rdi
movq %rsi, 0x40(%rsp)
movq 0x20(%rsp), %rdx
leaq 0x3c5c(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movl 0x14(%r13), %eax
cmpl $0x2, %eax
jl 0xde75
decl %eax
movl %eax, 0x14(%r13)
jmp 0xe04c
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0xea00, %esi           # imm = 0xEA00
xorl %edx, %edx
callq 0x11c0
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x13dd(%rip), %rcx      # 0xf23e
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0xea00, %esi           # imm = 0xEA00
jmp 0xdcb8
movl $0x0, 0x14(%r13)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, (%r13)
movq 0x58(%rsp), %rcx
testq %rcx, %rcx
je 0xdeb9
movq 0x88(%rsp), %rdx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
movl $0x2, 0x4(%rbp,%rax)
cmpq $0x81, %rcx
je 0xded1
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movl $0x2, 0x4(%rbp,%rax)
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0xdef1
movq 0x90(%rsp), %rax
movl $0x2, (%rax,%r15)
cmpq $0x26, %rdx
je 0xdf0c
imulq $0xe38, 0x40(%rsp), %rax # imm = 0xE38
addq 0x60(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0x2, 0x4(%rax,%rcx)
cmpl $0x6, %edx
movl $0x5, %eax
cmovael %edx, %eax
addl $-0x5, %eax
leaq 0x5(%rdx), %rcx
cmpq $0x22, %rdx
movslq %eax, %r13
movl $0x26, %eax
cmovaeq %rax, %r13
cmpq %rcx, %r13
jg 0xe042
imulq $0xe38, %r13, %rax      # imm = 0xE38
addq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rax
cmpl %eax, 0x4c(%rsp)
ja 0xe02b
movq 0x50(%rsp), %rbp
movq 0xa0(%rsp), %r15
leaq -0x5(%r15), %r14
movq %rbx, %rdi
movl %r13d, %esi
movl %r14d, %edx
movl %r12d, %ecx
callq 0x5820
testl %eax, %eax
js 0xdfd6
callq 0x11d0
cltq
movq %rax, 0x40(%rsp)
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
addl %eax, %eax
leal (%rax,%rax,4), %r12d
movq %rbx, %rdi
movl %r13d, %esi
movl %r14d, %edx
movl 0x34(%rsp), %ecx
callq 0x5820
cltq
imulq $0x38, %rax, %rax
movl 0x8(%rbx,%rax), %ecx
subl 0x40(%rsp), %r12d
addl %r12d, %ecx
addl $-0x15, %ecx
movl %ecx, 0x8(%rbx,%rax)
movl 0x34(%rsp), %r12d
callq 0x11d0
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x4, %ecx
subl %ecx, %eax
cmpl $0x2, %eax
jg 0xdffb
movl $0x0, 0x14(%rbp)
movl $0x1, (%rbp)
callq 0x11d0
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
addl $0x19999999, %eax       # imm = 0x19999999
cmpl $0x33333332, %eax       # imm = 0x33333332
ja 0xe019
movl $0x1, 0x4(%rbp)
incq %r15
addq $0x1c, %rbp
cmpq 0x68(%rsp), %r14
jb 0xdf67
incq %r13
addq $0xe38, 0x50(%rsp)      # imm = 0xE38
cmpl %r13d, 0xc(%rsp)
jne 0xdf4b
movq 0x28(%rsp), %rdi
callq 0xd9cd
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rsi
jmp 0xdccd
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x39f8(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %r15
leal 0x1(%r15), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x39cd(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
jmp 0xe0f7
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl $0x2900, %esi           # imm = 0x2900
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x39ab(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %r15
leal 0x1(%r15), %esi
movq %r14, %rdi
movq 0x20(%rsp), %rdx
leaq 0x3980(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x2900, %esi           # imm = 0x2900
xorl %edx, %edx
callq 0x1060
movq %r15, %rsi
jmp 0xdcc4
callq 0x11d0
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %r14d
testb $0x3, %al
movl $0xf500, %r13d          # imm = 0xF500
movl $0xcb00, %eax           # imm = 0xCB00
cmovel %eax, %r13d
movq 0x28(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x11c0
movq %r15, %rdi
movl %r14d, %esi
movq 0x20(%rsp), %rdx
leaq 0x30a0(%rip), %rcx      # 0x111e9
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x1060
movq $-0x1, %r14
movq 0x18(%rsp), %r15
xorl %r13d, %r13d
movl $0x19999998, %ebp       # imm = 0x19999998
callq 0x11d0
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
addl %ebp, %eax
rorl %eax
cmpl %ebp, %eax
ja 0xe1a0
movl -0x4(%r15,%r13), %eax
cmpl $0x9, %eax
ja 0xe1a0
movl $0x302, %ecx            # imm = 0x302
btl %eax, %ecx
jae 0xe1a0
movl $0x3, (%r15,%r13)
addq $0x1c, %r13
cmpq $0x54, %r13
jne 0xe171
incq %r14
addq $0xe38, %r15            # imm = 0xE38
cmpq $0x2, %r14
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rsi
jne 0xe169
jmp 0xdccd
callq 0x11d0
cltq
imulq $0x1b4e81b5, %rax, %rcx # imm = 0x1B4E81B5
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x12c, %ecx, %ecx      # imm = 0x12C
subl %ecx, %eax
cmpl $0x12a, %eax            # imm = 0x12A
movq 0x28(%rsp), %r15
jg 0xe223
callq 0x11d0
andl $0x80000003, %eax       # imm = 0x80000003
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %ebp
cmpl $0x3, %eax
jne 0xe25d
movl $0xa00, %r14d           # imm = 0xA00
movq %r15, %rdi
movl $0xa00, %esi            # imm = 0xA00
jmp 0xe26b
movl $0x0, 0x4(%r13)
movl $0x200000, %r14d        # imm = 0x200000
movq %r15, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x382b(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq 0x10(%rsp), %rax
leal 0x1(%rax), %esi
movq %r15, %rdi
jmp 0xe287
movl $0xcb00, %r14d          # imm = 0xCB00
movq %r15, %rdi
movl $0xcb00, %esi           # imm = 0xCB00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x37f9(%rip), %rcx      # 0x11a76
movsbl (%rax,%rcx), %r8d
movq %r15, %rdi
movl %ebp, %esi
movq 0x20(%rsp), %rdx
leaq 0x37d5(%rip), %rcx      # 0x11a68
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x1060
cmpl $0x2, (%r13)
movl 0xc(%rsp), %edx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rsi
jne 0xdccd
callq 0x11d0
movq 0x10(%rsp), %rsi
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
movl 0xc(%rsp), %edx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movq 0x18(%rsp), %rcx
cmpl $0x2, %eax
jne 0xdccd
movl 0x14(%r13), %eax
cmpl $0x2, %eax
jl 0xe30d
decl %eax
movl %eax, 0x14(%r13)
jmp 0xdccd
movl $0x0, 0x14(%r13)
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 $0x5a, %eax
jg 0xe347
movl $0x1, (%r13)
jmp 0xe04c
movl $0x4, (%r13)
movl $0x1, 0x18(%r13)
jmp 0xe04c
movq 0x98(%rsp), %rcx
addq $0x1c, %rcx
movq 0x20(%rsp), %rax
movq %rax, %rdx
cmpq $0x82, %rax
jne 0xdadc
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq