LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: move_actor(actor*, int, int)
int move_actor(actor* a, int dx, int dy)
{

	if (dx==0 && dy==0)
		return 1;
	int ox = a->x; int oy = a->y;
	int x = ox+dx; int y = oy+dy;
	if(!on_map(x,y)) return 1;
	if (terrain_immovable(a,x,y))
	{

		return 1;
	}
	if(a->is_player)
	{
		for(unsigned int i=0;i<devices.size();i++)
		{
			if(devices[i]->player_has)
			{
				devices[i]->x = p_ptr->x; devices[i]->y = p_ptr->y;
			}
		}
	}
	map_occupants[ox][oy] = NULL;
	map_occupants[x][y] = a;
	if(a->ai_x == a->x && a->ai_y == a->y)
	{
		a->ai_x = x; a->ai_y = y;
	}
	a->x = x; a->y = y;
	if(a->running)
	{
		make_noise(x,y,&run_noise[a->sspecies->id][map_terrain[x][y]]);
	}
	else
	{
		make_noise(x,y,&walk_noise[a->sspecies->id][map_terrain[x][y]]);
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x1
popq %rbp
movl %edx, %eax
orl %esi, %eax
je 0xce18
movq %rdi, %r14
movslq 0x20(%rdi), %r13
movslq 0x24(%rdi), %r12
movslq %esi, %rbx
addq %r13, %rbx
movslq %edx, %r15
addq %r12, %r15
movl %r15d, %eax
orl %ebx, %eax
js 0xce18
cmpl $0x95, %ebx
jg 0xce18
cmpl $0x95, %r15d
jg 0xce18
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x9049
testb %al, %al
jne 0xce18
cmpb $0x1, 0x8(%r14)
jne 0xcd8b
movq 0xb66df(%rip), %rax     # 0xc3430
movq 0xb66d0(%rip), %rcx     # 0xc3428
subq %rcx, %rax
sarq $0x3, %rax
xorl %edx, %edx
movq 0x5e778(%rip), %rsi     # 0x6b4e0
movl %edx, %edx
cmpq %rdx, %rax
jbe 0xcd8b
movq (%rcx,%rdx,8), %rdi
cmpb $0x1, 0x98(%rdi)
jne 0xcd87
movq 0x20(%rsi), %r8
movq %r8, 0x90(%rdi)
incl %edx
jmp 0xcd68
imulq $0x4b0, %r13, %rax      # imm = 0x4B0
leaq 0x5e757(%rip), %rcx     # 0x6b4f0
addq %rcx, %rax
andq $0x0, (%rax,%r12,8)
imulq $0x4b0, %rbx, %rax      # imm = 0x4B0
addq %rcx, %rax
movq %r14, (%rax,%r15,8)
cmpl %r13d, 0x28(%r14)
jne 0xcdc3
cmpl %r12d, 0x2c(%r14)
jne 0xcdc3
movl %ebx, 0x28(%r14)
movl %r15d, 0x2c(%r14)
movl %ebx, 0x20(%r14)
movl %r15d, 0x24(%r14)
movq (%r14), %rax
movslq (%rax), %rax
imulq $0x258, %rbx, %rcx      # imm = 0x258
leaq 0x11561(%rip), %rdx     # 0x1e340
addq %rcx, %rdx
movslq (%rdx,%r15,4), %rcx
leaq 0x5e52b(%rip), %rdx     # 0x6b318
cmpb $0x0, 0x14(%r14)
leaq 0x5e507(%rip), %rsi     # 0x6b300
cmovneq %rdx, %rsi
movq (%rsi), %rsi
imulq $0x18, %rax, %rax
imulq $0x30, %rcx, %rdx
addq (%rsi,%rax), %rdx
movl %ebx, %edi
movl %r15d, %esi
callq 0x92a3
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: kill_actor(actor*)
void kill_actor(actor* a)
{
	map_occupants[a->x][a->y] = NULL;
	if(current_target == a) current_target = NULL;
	a->dead = true;
	//if(sym_los_in_range(p_ptr->x,p_ptr->y,a->x,a->y,is_opaque))
	if(tile_visible(a->x,a->y))
	{
		add_message("The "+a->sspecies->name+" dies.");
	}
	a->sspecies->health_known = true;
	add_junk(a->sspecies->name +" corpse","the bloody corpse of a "+a->sspecies->name,'%',a->sspecies->colour,a->x,a->y);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movslq 0x20(%rdi), %rdi
movslq 0x24(%rbx), %rsi
imulq $0x4b0, %rdi, %rax      # imm = 0x4B0
leaq 0x5e477(%rip), %rcx     # 0x6b4f0
addq %rax, %rcx
andq $0x0, (%rcx,%rsi,8)
cmpq %rbx, 0x5e438(%rip)     # 0x6b4c0
jne 0xd092
andq $0x0, 0x5e42e(%rip)     # 0x6b4c0
movb $0x1, 0x1c(%rbx)
callq 0xc2fd
testb %al, %al
je 0xd0ed
movl $0xf0, %edx
addq (%rbx), %rdx
leaq 0x810f(%rip), %rsi      # 0x151bd
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x10d4b
leaq 0x8100(%rip), %rdx      # 0x151c2
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x111b3
leaq 0x48(%rsp), %rdi
callq 0x5c6e
leaq 0x48(%rsp), %rdi
callq 0x5418
leaq 0x68(%rsp), %rdi
callq 0x5418
movq (%rbx), %rsi
movb $0x1, 0x46(%rsi)
movl $0xf0, %r14d
addq %r14, %rsi
leaq 0x80c5(%rip), %rdx      # 0x151c9
leaq 0x28(%rsp), %rdi
callq 0x11030
addq (%rbx), %r14
leaq 0x80b9(%rip), %rsi      # 0x151d1
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x10d4b
movq (%rbx), %rax
movl 0x28(%rax), %ecx
movl 0x20(%rbx), %r8d
movl 0x24(%rbx), %r9d
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x25
popq %rdx
callq 0x96dd
leaq 0x8(%rsp), %rdi
callq 0x5418
leaq 0x28(%rsp), %rdi
callq 0x5418
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5418
jmp 0xd176
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xd194
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5418
jmp 0xd18f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5418
movq %rbx, %rdi
callq 0x53c0
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: calculate_score()
int calculate_score()
{
	int score = 0;
	score += died ? -1000 : 1000;
	score += left_ship ? 50 : -50;
	score += ran ? 75 : -75;
	score += entered_building_destroyed_transmitter ? 100 : -100;
	score += destroyed_transmitter ? 200 : -200;
	score += returned_to_ship ? 400 : -400;
	score += closed_doors ? 600 : -600;
	score += left_planet ? 800 : -800;

	score += count_inv_devices(LOW_EXPLOSIVE)*100;
	score += count_inv_devices(HIGH_EXPLOSIVE)*400;
	score += count_inv_devices(HOLOGRAM_PROJECTOR)*50;
	score += count_inv_devices(NOISE_GENERATOR)*50;
	score += count_inv_devices(SCENT_GENERATOR)*50;
	score += count_inv_devices(BRAIN_SLICE)*50;

	score += ammo[PISTOL]*5;
	score += ammo[RIFLE]*3;
	score += ammo[CANNON]*25;
	score -= turn_count;
	score *= difficulty;
	return score;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x0, 0x11170(%rip)     # 0x1e320
movl $0xfffffc18, %eax       # imm = 0xFFFFFC18
movl $0x3e8, %r15d           # imm = 0x3E8
cmovnel %eax, %r15d
leal -0x32(%r15), %eax
addl $0x32, %r15d
cmpb $0x0, 0x11153(%rip)     # 0x1e321
cmovel %eax, %r15d
leal -0x4b(%r15), %eax
addl $0x4b, %r15d
cmpb $0x0, 0x11141(%rip)     # 0x1e322
cmovel %eax, %r15d
leal -0x64(%r15), %eax
addl $0x64, %r15d
cmpb $0x0, 0x1112f(%rip)     # 0x1e323
cmovel %eax, %r15d
leal -0xc8(%r15), %eax
addl $0xc8, %r15d
cmpb $0x0, 0x11117(%rip)     # 0x1e324
cmovel %eax, %r15d
leal -0x190(%r15), %eax
addl $0x190, %r15d           # imm = 0x190
cmpb $0x0, 0x110ff(%rip)     # 0x1e325
cmovel %eax, %r15d
leal -0x258(%r15), %eax
addl $0x258, %r15d           # imm = 0x258
cmpb $0x0, 0x110e7(%rip)     # 0x1e326
cmovel %eax, %r15d
leal -0x320(%r15), %eax
addl $0x320, %r15d           # imm = 0x320
cmpb $0x0, 0x110cf(%rip)     # 0x1e327
cmovel %eax, %r15d
xorl %edi, %edi
callq 0x9479
imull $0x64, %eax, %ebx
pushq $0x1
popq %rdi
callq 0x9479
imull $0x190, %eax, %r12d     # imm = 0x190
addl %ebx, %r12d
pushq $0x2
popq %rdi
callq 0x9479
movl %eax, %ebx
pushq $0x3
popq %rdi
callq 0x9479
movl %eax, %ebp
pushq $0x4
popq %rdi
callq 0x9479
movl %eax, %r14d
pushq $0x5
popq %rdi
callq 0x9479
imull $0x5, 0x5df42(%rip), %ecx # 0x6b1e8
imull $0x3, 0x5df3f(%rip), %edx # 0x6b1ec
addl %r12d, %ecx
addl %ecx, %edx
imull $0x19, 0x5df37(%rip), %ecx # 0x6b1f0
addl %edx, %ecx
addl %r15d, %ecx
addl %ebx, %ebp
addl %r14d, %eax
addl %ebp, %eax
imull $0x32, %eax, %eax
subl 0x11046(%rip), %ecx     # 0x1e314
addl %eax, %ecx
imull 0x11035(%rip), %ecx     # 0x1e30c
movl %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: add_score_str()
void add_score_str()
{
	check_achievements();
	char score_str[10] = "";
	sprintf(score_str,"%d",calculate_score());
	//itoa(calculate_score(),score_str,10);
	add_message("Your score is " + std::string(score_str) + ".");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
callq 0xa210
leaq 0x48(%rsp), %rbx
andw $0x0, 0x8(%rbx)
andq $0x0, (%rbx)
callq 0xd1a1
leaq 0x7ee1(%rip), %rsi      # 0x151e9
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x5050
leaq 0x58(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5110
leaq 0x7ebc(%rip), %rsi      # 0x151ec
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x11400
leaq 0x924c(%rip), %rdx      # 0x16590
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x111b3
leaq 0x28(%rsp), %rdi
callq 0x5c6e
leaq 0x28(%rsp), %rdi
callq 0x5418
leaq 0x8(%rsp), %rdi
callq 0x5418
leaq 0x58(%rsp), %rdi
callq 0x5418
addq $0x78, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5418
jmp 0xd395
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5418
jmp 0xd3a4
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x5418
movq %rbx, %rdi
callq 0x53c0
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: lose()
void lose()
{
	died = true;
	
	add_message("You die. Press 'Q' to quit.");
	
	add_score_str();
	draw_scene();
	int kp = 0;
	while(kp != 'Q') kp = fgetch();
	endwin();
	exit(0);

}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movb $0x1, 0x10f5e(%rip)     # 0x1e320
leaq 0x7e32(%rip), %rsi      # 0x151fb
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x5110
movq %rbx, %rdi
callq 0x5c6e
leaq 0x10(%rsp), %rdi
callq 0x5418
callq 0xd2e2
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xcc13
cmpl $0x51, %ebx
je 0xd409
callq 0x11424
movl %eax, %ebx
jmp 0xd3fb
callq 0x52b0
xorl %edi, %edi
callq 0x52d0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5418
movq %rbx, %rdi
callq 0x53c0
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: win()
void win()
{
	if(map_terrain[ship_x+2][ship_y] == DOOR)
	{
		add_message("You close the doors and fly away! Press Q to quit.");
	}
	else
	{
		add_message("You wipe some blood off the control panel and fly away! Press Q to quit.");
	}
	check_achievements();
	closed_doors = true;
	left_planet = true;
	add_score_str();
	map_terrain[ship_x+2][ship_y] = NS;
	draw_scene();
	int kp = 0;
	while(kp != 'Q') kp = fgetch();
	endwin();
	exit(0);

}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movslq 0x5ddc6(%rip), %rax     # 0x6b1fc
imulq $0x258, %rax, %rax      # imm = 0x258
movslq 0x5ddbc(%rip), %rcx     # 0x6b200
leaq 0x10ef5(%rip), %rbx     # 0x1e340
addq %rbx, %rax
cmpl $0x5, 0x4b0(%rax,%rcx,4)
jne 0xd47f
leaq 0x7db8(%rip), %rsi      # 0x15217
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5110
leaq 0x30(%rsp), %rdi
callq 0x5c6e
leaq 0x30(%rsp), %rdi
jmp 0xd4a4
leaq 0x7dc4(%rip), %rsi      # 0x1524a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5110
leaq 0x10(%rsp), %rdi
callq 0x5c6e
leaq 0x10(%rsp), %rdi
callq 0x5418
callq 0xa210
movb $0x1, %al
movb %al, 0x10e70(%rip)      # 0x1e326
movb %al, 0x10e6b(%rip)      # 0x1e327
callq 0xd2e2
movslq 0x5dd34(%rip), %rax     # 0x6b1fc
imulq $0x258, %rax, %rax      # imm = 0x258
movslq 0x5dd2a(%rip), %rcx     # 0x6b200
addq %rbx, %rax
movl $0xa, 0x4b0(%rax,%rcx,4)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xcc13
cmpl $0x51, %ebx
je 0xd4fb
callq 0x11424
movl %eax, %ebx
jmp 0xd4ed
callq 0x52b0
xorl %edi, %edi
callq 0x52d0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xd519
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5418
jmp 0xd525
jmp 0xd522
movq %rax, %rbx
movq %rbx, %rdi
callq 0x53c0
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: scent_walk(actor*)
void scent_walk(actor* a)
{
	std::pair<int,int> valid_dirs[8];
	int dir_count = 0;
	int best_x = 0; int best_y = 0;
	float best_scent = map_human_scent[a->x][a->y];
	random_shuffle(vdirections.begin(),vdirections.end());
	for(int d=0;d<8;d++)
	{
		std::pair<int,int> dir = directions[d];
		if(!terrain_immovable(a,a->x+dir.first,a->y+dir.second))
		{
			float detect = map_human_scent[a->x+dir.first][a->y+dir.second] + randfloat()*map_human_scent[a->x][a->y]*0.001f;
			if(detect >= best_scent)
			{
				best_scent = detect;
				best_x = dir.first; best_y = dir.second;
			}
		}
	}
	move_actor(a,best_x,best_y);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movslq 0x20(%rdi), %rax
movslq 0x24(%rdi), %rcx
imulq $0x258, %rax, %rax      # imm = 0x258
leaq 0x2650c(%rip), %rdx     # 0x342d0
addq %rdx, %rax
movss (%rax,%rcx,4), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x5d448(%rip), %rdi     # 0x6b220
movq 0x5d449(%rip), %rsi     # 0x6b228
callq 0x1144c
xorl %r13d, %r13d
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
cmpq $0x8, %r13
je 0xdeb5
leaq 0x66a8(%rip), %rax      # 0x144b0
movslq (%rax,%r13,8), %rbp
movslq 0x4(%rax,%r13,8), %r14
movslq 0x20(%rbx), %r15
addq %rbp, %r15
movslq 0x24(%rbx), %r12
addq %r14, %r12
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x9049
testb %al, %al
jne 0xdead
imulq $0x258, %r15, %rax      # imm = 0x258
leaq 0x26491(%rip), %r15     # 0x342d0
addq %r15, %rax
movss (%rax,%r12,4), %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x5c5a
movslq 0x20(%rbx), %rax
movslq 0x24(%rbx), %rcx
imulq $0x258, %rax, %rax      # imm = 0x258
addq %r15, %rax
mulss (%rax,%rcx,4), %xmm0
mulss 0x6212(%rip), %xmm0     # 0x14084
addss 0xc(%rsp), %xmm0
movaps 0x10(%rsp), %xmm3
ucomiss %xmm3, %xmm0
movaps %xmm3, %xmm1
cmpnless %xmm0, %xmm1
movaps %xmm1, %xmm2
andnps %xmm0, %xmm2
andps %xmm3, %xmm1
cmovbl 0x8(%rsp), %r14d
cmovbl 0x4(%rsp), %ebp
orps %xmm2, %xmm1
movaps %xmm1, 0x10(%rsp)
movl %r14d, 0x8(%rsp)
movl %ebp, 0x4(%rsp)
incq %r13
jmp 0xddf7
movq %rbx, %rdi
movl 0x4(%rsp), %esi
movl 0x8(%rsp), %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xccdb
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: random_walk(actor*)
void random_walk(actor* a)
{
	std::pair<int,int> valid_dirs[8];
	int dir_count = 0;
	for(int d=0;d<8;d++)
	{
		std::pair<int,int> dir = directions[d];
		if(is_wall(a->x+dir.first,a->y+dir.second))
		{
			valid_dirs[dir_count] = dir;
			dir_count++;
		}
		if(dir_count != 0)
		{
			int choice = rand()%dir_count;
			move_actor(a,valid_dirs[choice].first,valid_dirs[choice].second);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %r14d, %r14d
leaq 0x65ad(%rip), %r15      # 0x144b0
leaq 0x10436(%rip), %r12     # 0x1e340
xorl %r13d, %r13d
cmpq $0x40, %r14
je 0xdf7b
movq (%r14,%r15), %rax
movslq 0x20(%rbx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
movslq 0x24(%rbx), %rcx
movq %rax, %rsi
sarq $0x20, %rsi
addq %rcx, %rsi
imulq $0x258, %rdx, %rcx      # imm = 0x258
addq %r12, %rcx
cmpl $0x4, (%rcx,%rsi,4)
jne 0xdf55
movq %rax, %rcx
shrq $0x20, %rcx
movslq %r13d, %r13
movl %eax, (%rsp,%r13,8)
movl %ecx, 0x4(%rsp,%r13,8)
incl %r13d
testl %r13d, %r13d
je 0xdf75
callq 0x5080
cltd
idivl %r13d
movslq %edx, %rax
movl (%rsp,%rax,8), %esi
movl 0x4(%rsp,%rax,8), %edx
movq %rbx, %rdi
callq 0xccdb
addq $0x8, %r14
jmp 0xdf0d
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: update_map_seen()
void update_map_seen()
{
	int px = p_ptr->x;
	int py = p_ptr->y;
	for (int x=px - vis_range;x <= px + vis_range; x++)
	{
		for (int y=py - vis_range;y <= py + vis_range; y++)
		{
			if(on_map(x,y))
			{
				if (!map_seen[x][y])
				{
					if(tile_visible(x,y))
						map_seen[x][y] = true;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x5ceed(%rip), %rax     # 0x6b4e0
movslq 0x20(%rax), %rcx
movslq 0x24(%rax), %r12
leal -0x8(%rcx), %eax
addq $0x8, %rcx
movq %rcx, 0x10(%rsp)
leal -0x8(%r12), %ecx
addq $0x8, %r12
movslq %ecx, %rcx
movq %rcx, 0x8(%rsp)
movslq %eax, %rbx
imulq $0x96, %rbx, %rbp
leaq 0x51bc7(%rip), %r15     # 0x601f0
cmpq 0x10(%rsp), %rbx
jg 0xe682
movq 0x8(%rsp), %r14
cmpq %r12, %r14
jg 0xe676
movl %r14d, %eax
orl %ebx, %eax
js 0xe671
cmpq $0x95, %rbx
jg 0xe671
cmpq $0x95, %r14
jg 0xe671
leaq (%r14,%rbp), %r13
cmpb $0x0, (%r15,%r13)
jne 0xe671
movl %ebx, %edi
movl %r14d, %esi
callq 0xc2fd
testb %al, %al
je 0xe671
movb $0x1, (%r15,%r13)
incq %r14
jmp 0xe635
incq %rbx
addq $0x96, %rbp
jmp 0xe629
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: signal_receive[abi:cxx11](int, int)
std::string signal_receive(int x,int y)
{
	if(target_x==-500) return "The radio transmitter is destroyed. Home time!";
	std::string ss = vtransmission[rand()%vtransmission.size()];
	float d2 = sqrt((float)d22(x,y,target_x,target_y));
	float signal = squaref(1.0f + ((float)10 - d2) /90.0f);
	std::string tt = "";
	for(unsigned int i=0;i<ss.length();i++)
		tt += (randfloat()<signal)?ss[i]:'*';
	return "\""+tt+"\"";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
cmpl $0xfffffe0c, 0x5cb4c(%rip) # imm = 0xFFFFFE0C
jne 0xe6c3
leaq 0x6cb0(%rip), %rsi      # 0x15361
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5110
jmp 0xe7da
movl %edx, %ebp
movl %esi, %r14d
callq 0x5080
cltq
movq 0x5cb3a(%rip), %rcx     # 0x6b210
movq 0x5cb2b(%rip), %rsi     # 0x6b208
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %r15d, %r15d
xorl %edx, %edx
divq %rcx
shlq $0x5, %rdx
addq %rdx, %rsi
leaq 0x8(%rsp), %rdi
callq 0x5330
subl 0x5caf0(%rip), %r14d    # 0x6b1f4
subl 0x5caee(%rip), %ebp     # 0x6b1f8
leaq 0x79ab(%rip), %rsi      # 0x160bc
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x5110
imull %r14d, %r14d
imull %ebp, %ebp
addl %r14d, %ebp
cvtsi2ss %ebp, %xmm0
sqrtss %xmm0, %xmm0
movss 0x5952(%rip), %xmm1     # 0x1408c
subss %xmm0, %xmm1
divss 0x5952(%rip), %xmm1     # 0x14098
addss 0x58c6(%rip), %xmm1     # 0x14014
mulss %xmm1, %xmm1
movss %xmm1, 0x4(%rsp)
leaq 0x48(%rsp), %r14
movl %r15d, %r15d
cmpq %r15, 0x10(%rsp)
jbe 0xe792
callq 0x5c5a
movb $0x2a, %al
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xe782
movq 0x8(%rsp), %rax
movb (%rax,%r15), %al
movsbl %al, %esi
movq %r14, %rdi
callq 0x51e0
incl %r15d
jmp 0xe75d
leaq 0x5f4d(%rip), %rsi      # 0x146e6
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x10d4b
leaq 0x5f37(%rip), %rdx      # 0x146e6
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x111b3
leaq 0x28(%rsp), %rdi
callq 0x5418
leaq 0x48(%rsp), %rdi
callq 0x5418
leaq 0x8(%rsp), %rdi
callq 0x5418
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5418
jmp 0xe801
jmp 0xe7fe
movq %rax, %rbx
jmp 0xe80b
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5418
leaq 0x8(%rsp), %rdi
callq 0x5418
movq %rbx, %rdi
callq 0x53c0
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: selectghjk_individual_device_from_type_and_config(int, int)
item* selectghjk_individual_device_from_type_and_config(int type, int config)
{
	bool unacceptable = true;
	std::vector<item*>* options = &dev_inv[type][config];
	attron(COLOR_PAIR(COLOR_WHITE));
	clear_area(0,0,viewport_width,options->size());
	for(unsigned int i=0;i<options->size();i++)
	{
		mvprintw(i,0,"(%c) %s with %d seconds remaining",'a'+i, (*options)[i]->name.c_str(), (*options)[i]->time_remaining);
	}

	int kp = fgetch();
	while(unacceptable)
	{
		unacceptable = false;
	}
	draw_scene();
	return (*options)[kp-'a'];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %edi, %rax
movq 0xb453b(%rip), %rcx     # 0xc3440
imulq $0x18, %rax, %rax
movslq %esi, %rdx
movq (%rcx,%rax), %rbx
imulq $0x18, %rdx, %r14
leaq (%rbx,%r14), %r15
movq 0xf0b9(%rip), %rax      # 0x1dfd8
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x5150
movq 0x8(%rbx,%r14), %rcx
subq (%rbx,%r14), %rcx
shrq $0x3, %rcx
pushq $0x31
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x6a9c
leaq 0x6547(%rip), %rbx      # 0x15495
xorl %eax, %eax
movl %eax, %r14d
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0xef8b
movq (%rax,%r14,8), %rax
movq 0x10(%rax), %r8
movl 0x7c(%rax), %r9d
leal 0x61(%r14), %ecx
movl %r14d, %edi
xorl %esi, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5310
leal 0x1(%r14), %eax
jmp 0xef50
callq 0x11424
movl %eax, %ebx
xorl %edi, %edi
callq 0xcc13
movq (%r15), %rax
movslq %ebx, %rcx
movq -0x308(%rax,%rcx,8), %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: ask_for_time()
int ask_for_time()
{
	clear_area(0,0,viewport_width,1);
	mvaddstr(0,0,"Choose delay (0 to 9 seconds). q or ESC to cancel");
	int t = -2;
	while(t == -2)
	{
		int kp = fgetch();
		if(kp == 'q' || kp == 'Q' || kp == KEY_ESC)
		{
			t = -1;
		}
		else if(kp >='0' && kp <= '9')
		{
			t = kp - '0';
		}
	}
	draw_scene();
	return t*10;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
pushq $0x31
popq %rdx
pushq $0x1
popq %rcx
xorl %edi, %edi
xorl %esi, %esi
callq 0x6a9c
movq 0xf011(%rip), %rbx      # 0x1dfd8
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5260
cmpl $-0x1, %eax
je 0xefea
movq (%rbx), %rdi
leaq 0x64d5(%rip), %rsi      # 0x154b7
pushq $-0x1
popq %rdx
callq 0x50d0
pushq $-0x1
popq %rbx
pushq $-0x2
popq %rbp
movl %ebp, %r14d
cmpl $-0x2, %r14d
jne 0xf024
callq 0x11424
movl %ebx, %r14d
cmpl $0x1b, %eax
je 0xeff3
movl %ebx, %r14d
cmpl $0x51, %eax
je 0xeff3
movl %ebx, %r14d
cmpl $0x71, %eax
je 0xeff3
addl $-0x30, %eax
cmpl $0xa, %eax
cmovael %ebp, %eax
movl %eax, %r14d
jmp 0xeff3
xorl %edi, %edi
callq 0xcc13
imull $0xa, %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: ask_for_wavelength()
int ask_for_wavelength()
{
	clear_area(0,0,viewport_width,3);
	mvaddstr(0,0,"Use which wavelength? Choosing a wavelength");
	mvaddstr(1,0,"already in use will destroy the existing link.");
	mvaddstr(2,0,"q or ESC to cancel");
	for (int i=0;i<WAVELENGTHS;i++)
	{
		item* a = rm_devices[i];
		if (a==NULL)
		{
			mvprintw(i+3,0,"(%d) no device detected",i+1);
		}
		else
		{
			mvprintw(i+3,0,"(%d) %s", a->name.c_str());
		}
	}
	int w = -2;
	while(w == -2)
	{
		int kp = fgetch();
		if(kp == 'q' || kp == 'Q' || kp == KEY_ESC)
		{
			w = -1;
		}
		else if(kp >'0' && kp <= '0'+WAVELENGTHS)
		{
			w = kp - '1';
		}
	}
	draw_scene();
	return w;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq $0x31
popq %rdx
pushq $0x3
popq %rcx
xorl %edi, %edi
xorl %esi, %esi
callq 0x6a9c
movq 0xef86(%rip), %rbx      # 0x1dfd8
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5260
cmpl $-0x1, %eax
je 0xf075
movq (%rbx), %rdi
leaq 0x647c(%rip), %rsi      # 0x154e9
pushq $-0x1
popq %rdx
callq 0x50d0
movq (%rbx), %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x5260
cmpl $-0x1, %eax
je 0xf099
movq (%rbx), %rdi
leaq 0x6484(%rip), %rsi      # 0x15515
pushq $-0x1
popq %rdx
callq 0x50d0
movq (%rbx), %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x5260
cmpl $-0x1, %eax
je 0xf0bd
movq (%rbx), %rdi
leaq 0x6421(%rip), %rsi      # 0x154d6
pushq $-0x1
popq %rdx
callq 0x50d0
pushq $-0x1
popq %rbp
leaq 0x88399(%rip), %r12     # 0x97460
leaq 0x6476(%rip), %rbx      # 0x15544
leaq 0x6487(%rip), %r14      # 0x1555c
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0xf118
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0xf100
movq 0x10(%rax), %rcx
leal 0x3(%r15), %edi
xorl %esi, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x5310
incq %r15
jmp 0xf0d8
leal 0x3(%r15), %edi
incq %r15
xorl %esi, %esi
movq %rbx, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x5310
jmp 0xf0d8
pushq $-0x2
popq %r14
movl %r14d, %ebx
cmpl $-0x2, %ebx
jne 0xf14c
callq 0x11424
movl %ebp, %ebx
cmpl $0x1b, %eax
je 0xf11f
movl %ebp, %ebx
cmpl $0x51, %eax
je 0xf11f
movl %ebp, %ebx
cmpl $0x71, %eax
je 0xf11f
addl $-0x31, %eax
cmpl $0x5, %eax
cmovael %r14d, %eax
movl %eax, %ebx
jmp 0xf11f
xorl %edi, %edi
callq 0xcc13
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: set_unconfigured(item*)
void set_unconfigured(item* dev)
{
	if(dev->player_has && dev->configuration != UNCONFIGURED)
	{
		inv_remove(dev);
		dev_inv[dev->device_type][UNCONFIGURED].push_back(dev);
	}
	if(dev->configuration == ON_TIMER)
	{
		dev->time_remaining = -1;
		kill_velement(timer_devices,dev);
	}
	else if(dev->configuration == ON_REMOTE)
	{
		rm_devices[dev->wavelength] = NULL;
		dev->wavelength = -1;
	}
	dev->configuration = UNCONFIGURED;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rdi, 0x8(%rsp)
cmpb $0x1, 0x98(%rdi)
jne 0xf1a8
cmpl $0x0, 0x8c(%rbx)
je 0xf1a8
movq %rbx, %rdi
callq 0x9569
movslq 0x70(%rbx), %rax
movq 0xb42b0(%rip), %rcx     # 0xc3440
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x110cc
movq (%rbx), %rbx
movl 0x8c(%rbx), %eax
cmpl $0x2, %eax
je 0xf1d2
cmpl $0x1, %eax
jne 0xf1e6
orl $-0x1, 0x7c(%rbx)
leaq 0x882c5(%rip), %rdi     # 0x97488
movq %rbx, %rsi
callq 0x1109b
movq 0x8(%rsp), %rbx
jmp 0xf1e6
movslq 0x74(%rbx), %rax
leaq 0x88283(%rip), %rcx     # 0x97460
andq $0x0, (%rcx,%rax,8)
orl $-0x1, 0x74(%rbx)
andl $0x0, 0x8c(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: set_timer(item*, int)
void set_timer(item* dev,int t)
{
	if(dev->configuration != ON_TIMER)
	{
		set_unconfigured(dev);
		timer_devices.push_back(dev);
		//if(dev->player_has)
		//{
		//	//inv_remove(dev);
		//	//dev_inv[dev->device_type][ON_TIMER].push_back(dev);
		//}
	}
	//if(dev->configuration == ON_REMOTE)
	//{
	//	rm_devices[dev->wavelength] = NULL;
	//	dev->wavelength = -1;
	//}
	if(dev->device_type == NOISE_GENERATOR)
	{
		dev->next_action = rand()%2+1;
	}
	dev->configuration = ON_TIMER;
	dev->time_remaining = t;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, (%rsp)
cmpl $0x1, 0x8c(%rdi)
je 0xf220
callq 0xf15e
leaq 0x88276(%rip), %rdi     # 0x97488
movq %rsp, %r14
movq %r14, %rsi
callq 0x110cc
movq (%r14), %rdi
cmpl $0x3, 0x70(%rdi)
jne 0xf23d
callq 0x5080
pushq $0x2
popq %rcx
cltd
idivl %ecx
incl %edx
movq (%rsp), %rdi
movl %edx, 0x88(%rdi)
movl $0x1, 0x8c(%rdi)
movl %ebx, 0x7c(%rdi)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: set_remote(item*, int)
void set_remote(item* dev,int w)
{
	if(dev->player_has && dev->configuration != ON_REMOTE)
	{
		set_unconfigured(dev);
		inv_remove(dev);
		dev_inv[dev->device_type][ON_REMOTE].push_back(dev);
	}
	//if(dev->configuration == ON_TIMER)
	//{
	//	dev->time_remaining = -1;
	//	kill_velement(timer_devices,dev);
	//}
	dev->configuration = ON_REMOTE;
	dev->wavelength = w;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq %rdi, (%rsp)
cmpb $0x1, 0x98(%rdi)
jne 0xf2a7
cmpl $0x2, 0x8c(%r14)
je 0xf2a7
movq %r14, %rdi
callq 0xf15e
movq %r14, %rdi
callq 0x9569
movslq 0x70(%r14), %rax
movq 0xb41b3(%rip), %rcx     # 0xc3440
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rdi
addq $0x30, %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x110cc
movq (%r14), %r14
movl $0x2, 0x8c(%r14)
movl %ebx, 0x74(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: autotarget()
int autotarget()
{
	int tab_ind = -1;
	if(current_target == NULL || current_target == p_ptr)
	{
		if(visible_actors.size() == 0)
		{
			current_target = p_ptr;
		}
		else
		{
			current_target = visible_actors[0];
			tab_ind = 0;
		}
	}
	if(!symmetrical_los(current_target->x,current_target->y,p_ptr->x,p_ptr->y,is_opaque))
	{
		if(visible_actors.size() == 0)
		{
			current_target = p_ptr;
		}
		else
		{
			current_target = visible_actors[0];
			tab_ind = 0;
		}
	}
	return tab_ind;
}

// Assembly:
pushq %rbx
movq 0x5be7a(%rip), %rcx     # 0x6b4c0
testq %rcx, %rcx
sete %dl
movq 0x5be8d(%rip), %rax     # 0x6b4e0
cmpq %rax, %rcx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0xf67a
movq 0x5be5e(%rip), %rcx     # 0x6b4c8
cmpq %rcx, 0x5be5f(%rip)     # 0x6b4d0
je 0xf67f
movq (%rcx), %rcx
xorl %ebx, %ebx
jmp 0xf685
pushq $-0x1
popq %rbx
jmp 0xf68c
pushq $-0x1
popq %rbx
movq %rax, %rcx
movq %rcx, 0x5be34(%rip)     # 0x6b4c0
movl 0x20(%rcx), %edi
movl 0x24(%rcx), %esi
movl 0x20(%rax), %edx
movl 0x24(%rax), %ecx
leaq -0x4a50(%rip), %r8      # 0xac4f
callq 0xc2b8
testb %al, %al
jne 0xf6d0
movq 0x5be19(%rip), %rax     # 0x6b4c8
xorl %ecx, %ecx
cmpq %rax, 0x5be18(%rip)     # 0x6b4d0
leaq 0x5be21(%rip), %rdx     # 0x6b4e0
cmovneq %rax, %rdx
cmovnel %ecx, %ebx
movq (%rdx), %rax
movq %rax, 0x5bdf0(%rip)     # 0x6b4c0
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: diffuse_scent_human()
void diffuse_scent_human()
{
	for (int x=0;x<MAP_SIZE;x++)
	{
		for(int y=0; y < MAP_SIZE;y++)
		{
			if(!is_wall(x,y))
			{
				spare_scent_map[x][y] = map_human_scent[x][y];
				int count = 1;
				for(int d=0;d<8;d++)
				{
					std::pair<int,int> dir = directions[d];
					int xx = x+dir.first; int yy = y+dir.second;
					if(!undiffusable(xx,yy))
					{
						spare_scent_map[x][y] += map_human_scent[xx][yy];
						count++;
					}
				}
				map_human_scent[x][y] = 0.9999f*spare_scent_map[x][y]/count;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %eax, %eax
leaq 0xdf04(%rip), %rcx      # 0x1e340
leaq 0x23e8d(%rip), %rdx     # 0x342d0
movss 0x3c51(%rip), %xmm0     # 0x1409c
leaq 0x405e(%rip), %r8       # 0x144b0
movl $0x1fd0, %r9d           # imm = 0x1FD0
cmpq $0x96, %rax
je 0x10540
imulq $0x258, %rax, %rdi      # imm = 0x258
leaq (%rcx,%rdi), %r11
leaq (%rdx,%rdi), %rsi
movq %rsi, -0x10(%rsp)
leaq 0x39de1(%rip), %rsi     # 0x4a260
addq %rsi, %rdi
movq %rdi, -0x8(%rsp)
movq %rax, -0x18(%rsp)
movslq %eax, %r14
xorl %r15d, %r15d
cmpq $0x96, %r15
je 0x10533
cmpl $0x4, (%r11,%r15,4)
je 0x1052b
movq -0x10(%rsp), %rax
leaq (%rax,%r15,4), %r12
movss (%r12), %xmm1
movq -0x8(%rsp), %rax
leaq (%rax,%r15,4), %r13
movss %xmm1, (%r13)
movslq %r15d, %rsi
xorl %eax, %eax
movl $0x1, %ebp
cmpq $0x8, %rax
je 0x10519
movslq (%r8,%rax,8), %r10
addq %r14, %r10
movslq 0x4(%r8,%rax,8), %rdi
addq %rsi, %rdi
imulq $0x258, %r10, %rbx      # imm = 0x258
leaq (%rcx,%rbx), %r10
movl (%r10,%rdi,4), %r10d
cmpl $0xc, %r10d
ja 0x10507
btl %r10d, %r9d
jae 0x10507
incq %rax
jmp 0x104d2
addq %rdx, %rbx
addss (%rbx,%rdi,4), %xmm1
movss %xmm1, (%r13)
incl %ebp
jmp 0x10502
cvtsi2ss %ebp, %xmm2
mulss %xmm0, %xmm1
divss %xmm2, %xmm1
movss %xmm1, (%r12)
incq %r15
jmp 0x10492
movq -0x18(%rsp), %rax
incq %rax
jmp 0x10458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: main
int main()
{
	srand((unsigned int)time(NULL));
	init();
#ifdef KILL_ESCAPE
	ESCDELAY=0;
#endif
	int end_game = 0;
	for(turn_count = 0;!end_game; turn_count++)
	{
		end_game = play_turn();
	}
	endwin();
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x5200
movl %eax, %edi
callq 0x5220
callq 0xb313
movq 0xd3e9(%rip), %rax      # 0x1dfc8
andl $0x0, (%rax)
movl %ebx, 0xd72c(%rip)      # 0x1e314
callq 0x1054b
movl 0xd721(%rip), %ebx      # 0x1e314
incl %ebx
jmp 0x10be2
nop
// File: /workspace/github_cpp_makefile_star2_O2/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: is_corner_b(int, int)
inline bool is_corner_b(int x,int y)
{
	bool n = (map_terrain[x][y-1] != WALL);
	bool s = (map_terrain[x][y+1] != WALL);
	bool e = (map_terrain[x+1][y] != WALL);
	bool w = (map_terrain[x-1][y] != WALL);
	if (n || s) return (e || w);
	return false;
}

// Assembly:
movslq %edi, %rdx
imulq $0x258, %rdx, %rax      # imm = 0x258
leaq 0xd1f4(%rip), %rdi      # 0x1e340
addq %rdi, %rax
movslq %esi, %rcx
leal 0x1(%rdx), %esi
movslq %esi, %rsi
imulq $0x258, %rsi, %rsi      # imm = 0x258
addq %rdi, %rsi
decl %edx
movslq %edx, %rdx
imulq $0x258, %rdx, %r8       # imm = 0x258
addq %rdi, %r8
cmpl $0x4, -0x4(%rax,%rcx,4)
movl (%rsi,%rcx,4), %edx
movl (%r8,%rcx,4), %esi
jne 0x11189
cmpl $0x4, 0x4(%rax,%rcx,4)
jne 0x11189
xorl %eax, %eax
retq
xorl $0x4, %esi
xorl $0x4, %edx
orl %esi, %edx
setne %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/fec_test.cpp
// Function: main
int main()
{

    printf("starting");

    // the quantity of data columns
    const int NUM = 6;
    int *err = new int[NUM];

//    fec *fecCode = new rscode(10,3,1024);
//    fec *fecCode = new star(6,257,1024);
    fec *fecCode = new rdp();


    fecCode->setData();
    fecCode->encoding();
    fecCode->outputData();

    // 1 means fault data
    for(int i=0; i<NUM; i++)
    {
        err[i] = 0;
    }

    err[0]=1;
//   err[1]=1;
//   err[2]=1;
    err[3]=1;

    fecCode->setErrData(err);
    fecCode->decoding();
    fecCode->outputOrigin();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1db7(%rip), %rdi      # 0x3004
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x1040
pushq $0x18
popq %rdi
callq 0x1030
movq %rax, %r14
pushq $0x40
popq %rdi
callq 0x10a0
movq %rax, %rbx
movq %rax, %rdi
callq 0x12d4
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
cmpq $0x6, %r15
je 0x12a0
andl $0x0, (%r14,%r15,4)
incq %r15
jmp 0x1290
pushq $0x1
popq %rax
movl %eax, (%r14)
movl %eax, 0xc(%r14)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::rdp()
rdp()
    {
        disks = 4;
        pnumRdp = 257;
        stripe_unit_size = DATA_LENGTH;
        w = pnumRdp - 1;
        allDisks = disks + TOLERENCE;

        idata=(char **)malloc(sizeof(char *)*disks);
        for(int i=0; i<disks; i++)
        {
            idata[i]=(char *) malloc(sizeof(char)*stripe_unit_size);
            memset(idata[i],0,stripe_unit_size);
        }

        odata=(char **)malloc(sizeof(char *)*TOLERENCE);
        for(int i=0; i<TOLERENCE; i++)
        {
            odata[i]=(char *) malloc(sizeof(char)*stripe_unit_size);
            memset(odata[i],0,stripe_unit_size);
        }

        data=(char **)malloc(sizeof(char *)*allDisks);
        for(int i=0; i<allDisks; i++)
        {
            data[i]=(char *) malloc(sizeof(char)*stripe_unit_size);
            memset(data[i],0,stripe_unit_size);
        }

        inthis = (int *)malloc(sizeof(int *)*allDisks);

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3a78(%rip), %rax      # 0x4d60
movq %rax, (%rdi)
movabsq $0x40000000004, %rax    # imm = 0x40000000004
movq %rax, 0x8(%rdi)
movl $0x101, 0x10(%rdi)      # imm = 0x101
movabsq $0x600000100, %rax      # imm = 0x600000100
movq %rax, 0x14(%rdi)
pushq $0x20
popq %rdi
callq 0x10b0
movq %rax, 0x20(%rbx)
pushq $0x4
popq %rax
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x1355
movslq 0xc(%rbx), %r14
movq %r14, %rdi
callq 0x10b0
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1060
incq %r15
movl 0x8(%rbx), %eax
jmp 0x1320
pushq $0x10
popq %rdi
callq 0x10b0
movq %rax, 0x28(%rbx)
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x1395
movslq 0xc(%rbx), %r14
movq %r14, %rdi
callq 0x10b0
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1060
incq %r15
jmp 0x1364
movslq 0x18(%rbx), %r14
movq %r14, %rdi
shlq $0x3, %rdi
callq 0x10b0
movq %rax, 0x30(%rbx)
xorl %r15d, %r15d
movslq %r14d, %rdi
cmpq %rdi, %r15
jge 0x13e3
movslq 0xc(%rbx), %r14
movq %r14, %rdi
callq 0x10b0
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1060
incq %r15
movl 0x18(%rbx), %r14d
jmp 0x13ac
shlq $0x3, %rdi
callq 0x10b0
movq %rax, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::setData()
void setData()
    {
        for(int i = 0; i < disks; i++)
        {
            for(int j = 0; j < stripe_unit_size; j++)
            {
                idata[i][j]=(char) ('a' + i);
            }
        }

        memcpy(odata[0], idata[0], stripe_unit_size* sizeof(char));
        memcpy(odata[1], idata[0], stripe_unit_size* sizeof(char));
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
movslq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jge 0x145b
leal 0x61(%rax), %ecx
xorl %edx, %edx
movslq 0xc(%rbx), %rsi
cmpq %rsi, %rdx
jge 0x1456
movq 0x20(%rbx), %rsi
movq (%rsi,%rax,8), %rsi
movb %cl, (%rsi,%rdx)
incq %rdx
jmp 0x143d
incq %rax
jmp 0x142f
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq (%rcx), %rdi
movq (%rax), %rsi
movslq 0xc(%rbx), %rdx
callq 0x1080
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x8(%rcx), %rdi
movq (%rax), %rsi
movslq 0xc(%rbx), %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1080
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::outputOrigin()
void outputOrigin()
    {

        printf("After decoding:");
        for(int i=0; i < disks; i++)
        {
            printf("idata:%d:  ",i);
            printf(idata[i]);
            printf("\n");
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x190a(%rip), %rdi      # 0x305d
xorl %eax, %eax
callq 0x1040
leaq 0x18da(%rip), %r14      # 0x303b
pushq $0xa
popq %r15
xorl %r12d, %r12d
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x179a
movq %r14, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x1040
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
xorl %eax, %eax
callq 0x1040
movl %r15d, %edi
callq 0x10c0
incq %r12
jmp 0x1768
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::outputData()
void outputData()
    {

        printf("The res:");
        printf("odata:0:  ");
        printf(odata[0]);
        printf("\n");
        printf("odata:1:  ");
        printf(odata[1]);
        printf("\n");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x18b8(%rip), %rdi      # 0x306d
xorl %eax, %eax
callq 0x1040
leaq 0x1884(%rip), %rdi      # 0x3047
xorl %eax, %eax
callq 0x1040
movq 0x28(%rbx), %rax
movq (%rax), %rdi
xorl %eax, %eax
callq 0x1040
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x10c0
leaq 0x1867(%rip), %rdi      # 0x3052
xorl %eax, %eax
callq 0x1040
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rdi
xorl %eax, %eax
callq 0x1040
movl %r14d, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x10c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::outputRes()
void outputRes()
    {

        for(int i=0; i < disks; i++)
        {
            printf("idata:%d:  ",i);
            printf(idata[i]);
            printf("\n");
        }
        printf("odata:0:  ");
        printf(odata[0]);
        printf("\n");
        printf("odata:1:  ");
        printf(odata[1]);
        printf("\n");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x173e(%rip), %r14      # 0x303b
pushq $0xa
popq %r15
xorl %r12d, %r12d
movslq 0x8(%rbx), %rax
cmpq %rax, %r12
jge 0x1936
movq %r14, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x1040
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
xorl %eax, %eax
callq 0x1040
movl %r15d, %edi
callq 0x10c0
incq %r12
jmp 0x1904
leaq 0x170a(%rip), %rdi      # 0x3047
xorl %eax, %eax
callq 0x1040
movq 0x28(%rbx), %rax
movq (%rax), %rdi
xorl %eax, %eax
callq 0x1040
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x10c0
leaq 0x16ed(%rip), %rdi      # 0x3052
xorl %eax, %eax
callq 0x1040
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rdi
xorl %eax, %eax
callq 0x1040
movl %r14d, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::rdp_encoding()
void rdp_encoding()
    {

        int off = 0;
        int d = 0;
        int p = 0;
        int diag = 0;
        int packet_size = stripe_unit_size /w;

        for (d = 1; d < disks; d++)
        {

            diag = d;

            for (p = 0; p < w; p++)
            {
                if (diag <= w - 1)
                {
                    for (off = 0; off < packet_size; off++)
                    {

                        odata[0][p * packet_size + off]^= idata[d][p * packet_size + off];
                        odata[1][diag * packet_size + off]^= idata[d][p * packet_size + off];
                    }
                    diag++;

                }
                else
                {

                    for (off = 0; off < packet_size; off++)
                    {

                        odata[0][p * packet_size + off]^= idata[d][p * packet_size + off];
                    }
                    diag = 0;

                }

            }
        }
        for (p = 1; p < w; p++)
        {
            for (off = 0; off < packet_size; off++)
            {
                odata[1][(p - 1) * packet_size + off]^= odata[0][p * packet_size + off];

            }
        }


    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0xc(%rdi), %eax
movl 0x14(%rdi), %r10d
cltd
idivl %r10d
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
movslq %eax, %rdx
movabsq $0x1, %rsi
movslq 0x8(%rdi), %r8
cmpq %r8, %rsi
jge 0x1a73
xorl %r8d, %r8d
xorl %r9d, %r9d
movl %esi, %r11d
movslq %r10d, %rbx
cmpq %rbx, %r9
jge 0x1a6b
movq %r8, %rbx
movq %rcx, %r14
cmpl %r10d, %r11d
jge 0x1a32
movl %r11d, %r10d
imull %eax, %r10d
movslq %r10d, %r10
movq %r8, %rbx
movq %rcx, %r14
subq $0x1, %r14
jb 0x1a54
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
movq (%r15,%rsi,8), %r15
movb (%r15,%rbx), %r15b
movq (%r12), %r12
xorb %r15b, (%r12,%rbx)
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
movq (%r15,%rsi,8), %r15
movb (%r15,%rbx), %r15b
movq 0x8(%r12), %r12
xorb %r15b, (%r12,%r10)
incq %r10
incq %rbx
jmp 0x19f3
subq $0x1, %r14
jb 0x1a59
movq 0x20(%rdi), %r10
movq 0x28(%rdi), %r11
movq (%r10,%rsi,8), %r10
movb (%r10,%rbx), %r10b
movq (%r11), %r11
xorb %r10b, (%r11,%rbx)
incq %rbx
jmp 0x1a32
incl %r11d
jmp 0x1a5c
xorl %r11d, %r11d
incq %r9
movl 0x14(%rdi), %r10d
addq %rdx, %r8
jmp 0x19cc
incq %rsi
jmp 0x19b6
movabsq $0x1, %rax
xorl %esi, %esi
movslq %r10d, %r8
cmpq %r8, %rax
jge 0x1aba
movq %rcx, %r8
movq %rsi, %r9
subq $0x1, %r8
jb 0x1aae
movq 0x28(%rdi), %r10
movq (%r10), %r11
addq %rdx, %r11
movb (%r9,%r11), %r11b
movq 0x8(%r10), %r10
xorb %r11b, (%r10,%r9)
incq %r9
jmp 0x1a8d
incq %rax
movl 0x14(%rdi), %r10d
addq %rdx, %rsi
jmp 0x1a7f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::rdp_decoding_r(char**, int, int, int, int)
void rdp_decoding_r(char * g_data[], int disks, int stripe_unit_size, int w, int k)
    {
        int off = 0;
        int p = 0;
        int packet_size = stripe_unit_size / w;
        int i = 0;

        memcpy(g_data[k],g_data[0],stripe_unit_size*sizeof(char));
        for(i=2; i<(disks+2); i++)
        {
            if(i==k) continue;
            for (p = 0; p < w; p++)
            {
                for (off = 0; off < packet_size; off++)
                {
                    g_data[k][p * packet_size + off]^=g_data[i][p * packet_size + off];
                }
            }
        }

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %edx, %r15d
movq %rsi, %r14
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %r12d
movslq %r9d, %r13
movq (%rsi,%r13,8), %rdi
movq (%rsi), %rsi
movslq %ecx, %rdx
callq 0x1080
addl $0x2, %r15d
xorl %ecx, %ecx
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
testl %ebx, %ebx
cmovlel %ecx, %ebx
movslq %r12d, %rcx
movslq %r15d, %rdx
movl %r13d, %esi
pushq $0x2
popq %rdi
cmpq %rdx, %rdi
jge 0x1db8
cmpq %rsi, %rdi
jne 0x1d84
incq %rdi
jmp 0x1d75
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq %rbx, %r9
je 0x1d7f
movq %r8, %r10
movq %rax, %r11
subq $0x1, %r11
jb 0x1db0
movq (%r14,%rdi,8), %r15
movb (%r15,%r10), %r15b
movq (%r14,%r13,8), %r12
xorb %r15b, (%r12,%r10)
incq %r10
jmp 0x1d95
incq %r9
addq %rcx, %r8
jmp 0x1d8a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/DavidLBruce[P]sim3dof/build/../src/Autopilot.cpp
// Function: Autopilot::Autopilot()
Autopilot::Autopilot() :
MdlBase()
{
  //
  // Default initialization of input variables
  //
  frameTimeStep = 1.0/64.0;  // sec     Frame time step
  initFrameTime = 0.0;       // sec     Time of first frame update

  accLim = 300.0;            // m/sec^2 Acceleration limit
  tau = 0.2;                 // sec     Control system time constant
                             //         Autopilot, Aero, & CAS
  //
  // Register states for integration
  //
  RegisterState( x0, x0d );
  RegisterState( x1, x1d );
  RegisterState( x2, x2d );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x9cd8
leaq 0x192b6(%rip), %rax     # 0x1c890
movq %rax, (%rbx)
movabsq $0x3f90000000000000, %rax # imm = 0x3F90000000000000
movq %rax, 0x8(%rbx)
andq $0x0, 0xf8(%rbx)
movabsq $0x4072c00000000000, %rax # imm = 0x4072C00000000000
movq %rax, 0x100(%rbx)
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
movq %rax, 0x108(%rbx)
leaq 0x138(%rbx), %rsi
leaq 0x140(%rbx), %rdx
movq %rbx, %rdi
callq 0x9ef0
leaq 0x148(%rbx), %rsi
leaq 0x150(%rbx), %rdx
movq %rbx, %rdi
callq 0x9ef0
leaq 0x158(%rbx), %rsi
leaq 0x160(%rbx), %rdx
movq %rbx, %rdi
callq 0x9ef0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x9dd6
movq %r14, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/DavidLBruce[P]sim3dof/build/../src/Autopilot.cpp
// Function: Autopilot::Initialize()
void Autopilot::Initialize()
{
  ResetAll();

  simTime = GetSimTime();

  launchTime = pMsl->launchTime;

  nextFrameTime = launchTime;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x150(%rdi)
movups %xmm0, 0x140(%rdi)
movups %xmm0, 0x130(%rdi)
movups %xmm0, 0x120(%rdi)
andq $0x0, 0x160(%rdi)
movups %xmm0, 0x110(%rdi)
movq 0x38(%rdi), %rax
movq 0x178(%rdi), %rcx
movsd (%rax), %xmm0
movsd %xmm0, 0x130(%rdi)
movsd 0x108(%rcx), %xmm0
movsd %xmm0, 0x128(%rdi)
movsd %xmm0, 0x30(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DavidLBruce[P]sim3dof/build/../src/Autopilot.cpp
// Function: Autopilot::UpdateDerivatives()
void Autopilot::UpdateDerivatives()
{
  double tauPrime;

  simTime = GetSimTime();

  //
  // Third order transfer function.  Ref Zarchan 3rd ed. page 98.
  // Three identical single order systems in series.
  //
  tauPrime = tau / 3.0 / 1.09;

  x0d = -1.0/tauPrime * x0 + 1.0/tauPrime * x1;

  x1d = -1.0/tauPrime * x1 + 1.0/tauPrime * x2;

  x2d = -1.0/tauPrime * x2 + 1.0/tauPrime * aCmdYbLim;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x38(%rdi), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x130(%rdi)
movsd 0x108(%rdi), %xmm0
divsd 0x1184c(%rip), %xmm0    # 0x15020
divsd 0x1184c(%rip), %xmm0    # 0x15028
movsd 0x1184c(%rip), %xmm1    # 0x15030
divsd %xmm0, %xmm1
movsd 0x11848(%rip), %xmm2    # 0x15038
divsd %xmm0, %xmm2
movsd 0x148(%rdi), %xmm0
movapd %xmm0, %xmm3
mulsd %xmm2, %xmm3
movsd 0x138(%rdi), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, 0x140(%rdi)
movsd 0x158(%rdi), %xmm3
movapd %xmm2, %xmm4
mulsd %xmm3, %xmm4
mulsd %xmm1, %xmm0
addsd %xmm4, %xmm0
movsd %xmm0, 0x150(%rdi)
mulsd 0x110(%rdi), %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, 0x160(%rdi)
popq %rbp
retq