// File: /workspace/github_c_makefile_star2_O1/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 $0x98, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movq %rdi, 0x20(%rsp)
leaq -0xe38(%rsi), %rax
movq %rax, 0x68(%rsp)
leaq -0x8c(%rsi), %rax
movq %rax, 0x60(%rsp)
movq %rsi, 0x50(%rsp)
leaq -0xe50(%rsi), %rcx
movl $0x19999998, %r12d      # imm = 0x19999998
xorl %edx, %edx
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 0x68(%rsp), %rax
movq %r8, 0x38(%rsp)
addq %r8, %rax
addq $0x4, %rax
movq %rax, 0x80(%rsp)
leaq 0x1(%rdx), %rax
movq %rax, 0x18(%rsp)
leaq -0x1(%rdx), %rax
movq %rax, 0x78(%rsp)
movl %esi, %eax
addl $-0x5, %eax
movl %eax, 0x44(%rsp)
cmpl $0x7c, %edx
movl $0x7c, %eax
movq %rdx, 0x30(%rsp)
cmovbl %edx, %eax
addl $0x5, %eax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
movq %rsi, 0x90(%rsp)
addq %rsi, %rax
addq %rax, %rdi
movq %rdi, 0x70(%rsp)
movl $0x6, %edx
movq %rcx, 0x88(%rsp)
xorl %esi, %esi
imulq $0xe38, %rsi, %r14      # imm = 0xE38
movq 0x50(%rsp), %rax
leaq (%rax,%r14), %rbp
movq 0x38(%rsp), %rax
cmpl $0x1, 0x8(%rbp,%rax)
jne 0xdbc3
movq %rcx, 0x10(%rsp)
movl %edx, 0x4(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%rbp), %r13
cmpl $0x0, 0xc(%r13)
movq %rsi, 0x8(%rsp)
je 0xdb46
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl %r15d, %ecx
callq 0x57a3
movq 0x8(%rsp), %rsi
testl %eax, %eax
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
js 0xdbc3
movl %eax, %eax
imulq $0x38, %rax, %rax
movl $0x0, 0xc(%rbx,%rax)
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq 0xc(%r13), %rax
leaq 0x3e5a(%rip), %rcx      # 0x1195d
movsbl -0x1(%rax,%rcx), %r8d
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x3e34(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
movl 0x4(%rsp), %edx
jmp 0xdbc3
movl (%r13), %eax
cmpq $0xc, %rax
ja 0xdc2a
leaq 0x3db1(%rip), %rcx      # 0x1190c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3ddf(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x3db5(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
incq %rsi
incl %edx
addq $0xe38, %rcx            # imm = 0xE38
cmpq $0x27, %rsi
jne 0xda69
jmp 0xe25d
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0xf00, %esi            # imm = 0xF00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3d65(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x3d3b(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0xf00, %esi            # imm = 0xF00
jmp 0xdbae
movl 0x4(%r13), %eax
cmpq $0x4, %rax
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
ja 0xdbc3
leaq 0x3cfc(%rip), %rcx      # 0x11940
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x100000, %esi         # imm = 0x100000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3cf6(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %r13
leal 0x1(%r13), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x3ccb(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x100000, %esi         # imm = 0x100000
jmp 0xdffc
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq 0x10(%r13), %rax
leaq 0x3cb4(%rip), %rcx      # 0x11970
jmp 0xdb83
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rsi
movslq (%r13), %rax
leaq 0x3c79(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq %r12, %rdi
movq %rsi, 0x28(%rsp)
movq 0x18(%rsp), %rdx
leaq 0x3c52(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
movl 0x14(%r13), %eax
cmpl $0x2, %eax
jl 0xdd71
decl %eax
movl %eax, 0x14(%r13)
movl $0x19999998, %r12d      # imm = 0x19999998
jmp 0xdf51
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0xea00, %esi           # imm = 0xEA00
xorl %edx, %edx
callq 0x11c0
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x14a1(%rip), %rcx      # 0xf1fe
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0xea00, %esi           # imm = 0xEA00
jmp 0xdbae
movl $0x0, 0x14(%r13)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, (%r13)
cmpq $0x0, 0x30(%rsp)
movl $0x19999998, %r12d      # imm = 0x19999998
je 0xddb8
movq 0x78(%rsp), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movl $0x2, 0x4(%rbp,%rax)
cmpq $0x81, 0x30(%rsp)
je 0xddd0
movq 0x18(%rsp), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movl $0x2, 0x4(%rbp,%rax)
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0xddf0
movq 0x80(%rsp), %rax
movl $0x2, (%rax,%r14)
cmpq $0x26, %rdx
je 0xde0b
imulq $0xe38, 0x28(%rsp), %rax # imm = 0xE38
addq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movl $0x2, 0x4(%rax,%rcx)
cmpl $0x6, %edx
movl $0x5, %eax
cmovgel %edx, %eax
addl $-0x5, %eax
leaq 0x5(%rdx), %rcx
cmpq $0x22, %rdx
movl $0x26, %edx
cmovael %edx, %eax
cmpq %rax, %rcx
jb 0xdf47
movl %eax, %r13d
imulq $0xe38, %r13, %rax      # imm = 0xE38
addq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
cmpl %eax, 0x44(%rsp)
jg 0xdf30
movq 0x48(%rsp), %rbp
movq 0x90(%rsp), %r14
leal -0x5(%r14), %edx
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %ecx
callq 0x57a3
testl %eax, %eax
js 0xded3
callq 0x11d0
cltq
movq %rax, 0x28(%rsp)
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
addl %eax, %eax
movq %rbx, %r12
leal (%rax,%rax,4), %ebx
leal -0x5(%r14), %edx
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %ecx
callq 0x57a3
cltq
imulq $0x38, %rax, %rax
movl 0x8(%r12,%rax), %ecx
subl 0x28(%rsp), %ebx
addl %ebx, %ecx
addl $-0x15, %ecx
movq %r12, %rbx
movl $0x19999998, %r12d      # imm = 0x19999998
movl %ecx, 0x8(%rbx,%rax)
callq 0x11d0
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x4, %ecx
subl %ecx, %eax
cmpl $0x2, %eax
jg 0xdef8
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 0xdf16
movl $0x1, 0x4(%rbp)
leaq 0x1(%r14), %rax
addq $-0x5, %r14
addq $0x1c, %rbp
cmpq 0x58(%rsp), %r14
movq %rax, %r14
jb 0xde62
incq %r13
addq $0xe38, 0x48(%rsp)      # imm = 0xE38
cmpl %r13d, 0x4(%rsp)
jne 0xde46
movq 0x20(%rsp), %rdi
callq 0xd8c8
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rsi
jmp 0xdbc3
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x39df(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %r13
leal 0x1(%r13), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x39b4(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
jmp 0xdffc
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x2900, %esi           # imm = 0x2900
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3992(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %r13
leal 0x1(%r13), %esi
movq %r14, %rdi
movq 0x18(%rsp), %rdx
leaq 0x3967(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl $0x2900, %esi           # imm = 0x2900
xorl %edx, %edx
callq 0x1060
movq %r13, %rsi
jmp 0xdbba
callq 0x11d0
movq 0x8(%rsp), %rcx
leal 0x1(%rcx), %ebp
testb $0x3, %al
movl $0xf500, %r13d          # imm = 0xF500
movl $0xcb00, %eax           # imm = 0xCB00
cmovel %eax, %r13d
movq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x11c0
movq %r14, %rdi
movl %ebp, %esi
movq 0x18(%rsp), %rdx
leaq 0x30bd(%rip), %rcx      # 0x11109
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x1060
movq $-0x1, %r14
movq 0x10(%rsp), %r13
xorl %ebp, %ebp
callq 0x11d0
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
addl %r12d, %eax
rorl %eax
cmpl %r12d, %eax
ja 0xe0a0
movl -0x4(%r13,%rbp), %eax
cmpl $0x9, %eax
ja 0xe0a0
movl $0x302, %ecx            # imm = 0x302
btl %eax, %ecx
jae 0xe0a0
movl $0x3, (%r13,%rbp)
addq $0x1c, %rbp
cmpq $0x54, %rbp
jne 0xe06e
incq %r14
addq $0xe38, %r13            # imm = 0xE38
cmpq $0x2, %r14
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rsi
jne 0xe06c
jmp 0xdbc3
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 0x20(%rsp), %r14
jg 0xe125
callq 0x11d0
andl $0x80000003, %eax       # imm = 0x80000003
movq 0x8(%rsp), %rcx
incl %ecx
movl %ecx, 0x28(%rsp)
cmpl $0x3, %eax
jne 0xe15e
movl $0xa00, %ebp            # imm = 0xA00
movq %r14, %rdi
movl $0xa00, %esi            # imm = 0xA00
jmp 0xe16b
movl $0x0, 0x4(%r13)
movl $0x200000, %ebp         # imm = 0x200000
movq %r14, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x3816(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq 0x8(%rsp), %rax
leal 0x1(%rax), %esi
movq %r14, %rdi
jmp 0xe189
movl $0xcb00, %ebp           # imm = 0xCB00
movq %r14, %rdi
movl $0xcb00, %esi           # imm = 0xCB00
xorl %edx, %edx
callq 0x11c0
movslq (%r13), %rax
leaq 0x37e5(%rip), %rcx      # 0x11962
movsbl (%rax,%rcx), %r8d
movq %r14, %rdi
movl 0x28(%rsp), %esi
movq 0x18(%rsp), %rdx
leaq 0x37bf(%rip), %rcx      # 0x11954
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1060
cmpl $0x2, (%r13)
movl 0x4(%rsp), %edx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rsi
jne 0xdbc3
callq 0x11d0
movq 0x8(%rsp), %rsi
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
movl 0x4(%rsp), %edx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movq 0x10(%rsp), %rcx
cmpl $0x2, %eax
jne 0xdbc3
movl 0x14(%r13), %eax
cmpl $0x2, %eax
jl 0xe20e
decl %eax
movl %eax, 0x14(%r13)
jmp 0xdbc3
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 0xe248
movl $0x1, (%r13)
jmp 0xdf51
movl $0x4, (%r13)
movl $0x1, 0x18(%r13)
jmp 0xdf51
movq 0x88(%rsp), %rcx
addq $0x1c, %rcx
movq 0x18(%rsp), %rax
movq %rax, %rdx
cmpq $0x82, %rax
jne 0xd9d8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq