// File: /workspace/github_c_makefile_star2_O2/TurkeyMcMac[P]ts3d/src/play-level.c
// Function: play_level
int play_level(const char *root_dir, struct save_state *save,
	const char *map_name, struct ticker *timer, struct logger *log)
{
	struct loader ldr;
	loader_init(&ldr, root_dir);
	logger_free(loader_set_logger(&ldr, log));
	struct map *map = load_map(&ldr, map_name);
	if (!map) {
		logger_printf(loader_logger(&ldr), LOGGER_ERROR,
			"Failed to load map \"%s\"\n", map_name);
		goto error_map;
	}
	if (map->prereq && !save_state_is_complete(save, map->prereq))
		goto error_map; // Map not unlocked.
	int health_meter_full_color = color_map_add_pair(
		loader_color_map(&ldr),
		pixel(HEALTH_METER_FG_COLOR, HEALTH_METER_BG_COLOR));
	int health_meter_empty_color = color_map_add_pair(
		loader_color_map(&ldr),
		pixel(HEALTH_METER_BG_COLOR, HEALTH_METER_FG_COLOR));
	struct meter health_meter = {
		.label = "HEALTH",
		.full_style = COLOR_PAIR(health_meter_full_color),
		.empty_style = COLOR_PAIR(health_meter_empty_color),
		// Position and size not initialized yet.
	};
	int reload_meter_full_color = color_map_add_pair(
		loader_color_map(&ldr),
		pixel(RELOAD_METER_FG_COLOR, RELOAD_METER_BG_COLOR));
	int reload_meter_empty_color = color_map_add_pair(
		loader_color_map(&ldr),
		pixel(RELOAD_METER_BG_COLOR, RELOAD_METER_FG_COLOR));
	struct meter reload_meter = {
		.label = "RELOAD",
		.full_style = COLOR_PAIR(reload_meter_full_color),
		.empty_style = COLOR_PAIR(reload_meter_empty_color),
		// Position and size not initialized yet.
	};
	color_map_apply(loader_color_map(&ldr));
	loader_print_summary(&ldr);
	srand(time(NULL)); // For random_start_frame
	struct ents ents;
	init_entities(&ents, map);
	d3d_board *board = map->board;
	WINDOW *dead_popup = NULL;
	WINDOW *pause_popup = NULL;
	WINDOW *quit_popup = NULL;
	d3d_camera *cam = NULL;
	struct player player;
	player_init(&player, map);
	keypad(stdscr, TRUE);
	int translation = '\0'; // No initial translation
	int turn_duration = 0; // No initial turning
	bool won = false;
	bool paused = false;
	bool quitting = false;
	bool do_redraw = true;
	struct screen_area area = { 0, 0, 1, 1 };
	clear();
	for (;;) {
		static const char dead_msg[] =
			"You died.\n"
			"Press Y to return to the menu.";
		static const char pause_msg[] =
			"Game paused.\n"
			"Press P to resume.";
		static const char quit_msg[] =
			"Are you sure you want to quit?\n"
			"Press Y to confirm or N to cancel.";
		tick(timer);
		// next_key is preserved after the input flush and put back into
		// the input buffer; only keeping one key in the buffer ensures
		// responsiveness, though keys could theoretically be dropped:
		int key = getch(), next_key = getch();
		flushinp();
		if (next_key != ERR) ungetch(next_key);
		int lowkey = key >= 0 && key <= UCHAR_MAX ? tolower(key) : key;
		bool resized = key == KEY_RESIZE || !cam;
		if (resized) {
			update_term_size();
			area.width = COLS;
			// LINES - 1 so that one is reserved for the health and
			// reload meters:
			area.height = LINES > 0 ? LINES - 1 : 0;
			d3d_free_camera(cam);
			cam = camera_with_dims(area.width, area.height);
			// Takes up the left half of the bottom:
			health_meter.x = 0;
			health_meter.y = area.height;
			health_meter.width = area.width / 2;
			health_meter.win = stdscr;
			// Takes up the right half of the bottom:
			reload_meter.x = health_meter.width;
			reload_meter.y = area.height;
			reload_meter.width = area.width - health_meter.width;
			reload_meter.win = stdscr;
			if (dead_popup) {
				delwin(dead_popup);
				dead_popup = popup_window(dead_msg);
			}
			if (pause_popup) {
				delwin(pause_popup);
				pause_popup = popup_window(pause_msg);
			}
			if (quit_popup) {
				delwin(quit_popup);
				quit_popup = popup_window(quit_msg);
			}
			do_redraw = true;
		}
		int remaining = get_remaining(&ents);
		// Player wins if all targets gone and they are not, or if they
		// won already:
		won = won || (remaining <= 0 && !player_is_dead(&player));
		bool lost = !won && player_is_dead(&player);
		if (do_redraw) {
			d3d_draw(cam, player.body.pos, player.facing, board,
				ents_num(&ents), ents_sprites(&ents));
			display_frame(cam, &area, loader_color_map(&ldr));
			health_meter.fraction = player_health_fraction(&player);
			meter_draw(&health_meter);
			reload_meter.fraction = player_reload_fraction(&player);
			meter_draw(&reload_meter);
			attron(A_BOLD);
			if (won) {
				mvaddstr(0, 0,
					"YOU WIN! Press Y to return to menu.");
			} else {
				mvprintw(0, 0, "TARGETS LEFT: %d", remaining);
			}
			attroff(A_BOLD);
			refresh();
		}
		do_redraw = resized;
		if (dead_popup) {
			// Display the death popup if possible.
			touchwin(dead_popup);
			wrefresh(dead_popup);
		} else if (!lost && quitting) {
			if (quit_popup) {
				// Display the quit popup if possible.
				touchwin(quit_popup);
				wrefresh(quit_popup);
			}
			switch (lowkey) {
			case 'y':
				goto quit;
			case 'n':
				if (quit_popup) {
					delwin(quit_popup);
					quit_popup = NULL;
					touchwin(stdscr);
					do_redraw = true;
				}
				quitting = false;
				break;
			}
			continue;
		} else if (!lost && paused) {
			if (pause_popup) {
				// Display the pause popup if possible.
				touchwin(pause_popup);
				wrefresh(pause_popup);
			}
			switch (lowkey) {
			case 'p':
				if (pause_popup) {
					delwin(pause_popup);
					pause_popup = NULL;
					touchwin(stdscr);
					do_redraw = true;
				}
				paused = false;
				break;
			case 'x':
				quit_popup = popup_window(quit_msg);
				quitting = true;
				break;
			}
			continue;
		}
		// After this point, a redraw is needed next time:
		do_redraw = true;
		if (won && lowkey == 'y') {
			// Player quits after winning.
			goto quit;
		} else if (lost) {
			// Player lost, entities still simulated. Y to quit.
			if (lowkey == 'y') goto quit;
			if (!dead_popup) dead_popup = popup_window(dead_msg);
		} else if (lowkey == 'p') {
			paused = true;
			pause_popup = popup_window(pause_msg);
			continue;
		} else if (lowkey == 'x' || key == ESC) {
			quitting = true;
			quit_popup = popup_window(quit_msg);
			continue;
		} else {
			// Otherwise, let the player be controlled.
			move_player(&player,
				&translation, &turn_duration, key);
		}
		move_ents(&ents, map, &player);
		player_collide(&player, &ents);
		hit_ents(&ents);
		// Let the player shoot. key != lowkey means the key is an
		// uppercase char. The shooting is blocked by player_try_shoot
		// if the player is dead:
		if (key != lowkey || key == ' ')
			player_try_shoot(&player, &ents);
		shoot_bullets(&ents);
		player_tick(&player);
		ents_tick(&ents);
		ents_clean_up_dead(&ents);
	}
quit:
	clear();
	refresh();
	if (pause_popup) delwin(pause_popup);
	if (quit_popup) delwin(quit_popup);
	if (dead_popup) delwin(dead_popup);
	d3d_free_camera(cam);
	// Record the player's winning:
	if (won) save_state_mark_complete(save, map_name);
	ents_destroy(&ents);
	loader_free(&ldr);
	return 0;

error_map:
	loader_free(&ldr);
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %r8, %rbx
movq %rcx, 0x118(%rsp)
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rsi
leaq 0x190(%rsp), %r14
movq %r14, %rdi
callq 0x639c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x670d
movq %rax, %rdi
callq 0x6a11
movq %r14, %rdi
movq %r12, %rsi
callq 0x76c0
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x94e0
movq %rax, 0x40(%rsp)
movq 0x8(%rax), %rsi
testq %rsi, %rsi
je 0x883d
movq %r15, %rdi
callq 0x9bf4
testb %al, %al
je 0x9591
movq %r15, 0x100(%rsp)
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
callq 0x6700
pushq $0x2
popq %rsi
movq %rax, %rdi
callq 0xa14f
movl %eax, %ebp
movq %rbx, %rdi
callq 0x6700
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0xa14f
leaq 0x371d(%rip), %rcx      # 0xbf99
movq %rcx, 0xd0(%rsp)
andq $0x0, 0xd8(%rsp)
shll $0x8, %ebp
movl $0xffff, %r14d          # imm = 0xFFFF
andl %r14d, %ebp
movl %ebp, 0xe0(%rsp)
shll $0x8, %eax
andl %r14d, %eax
movl %eax, 0xe4(%rsp)
andq $0x0, 0xe8(%rsp)
andl $0x0, 0xf0(%rsp)
andq $0x0, 0xf8(%rsp)
movq %rbx, %rdi
callq 0x6700
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0xa14f
movl %eax, %ebp
movq %rbx, %rdi
callq 0x6700
pushq $0x8
popq %rsi
movq %rax, %rdi
callq 0xa14f
leaq 0x36aa(%rip), %rcx      # 0xbfa0
movq %rcx, 0xa0(%rsp)
andq $0x0, 0xa8(%rsp)
shll $0x8, %ebp
andl %r14d, %ebp
movl %ebp, 0xb0(%rsp)
shll $0x8, %eax
andl %r14d, %eax
movl %eax, 0xb4(%rsp)
andq $0x0, 0xb8(%rsp)
andl $0x0, 0xc0(%rsp)
andq $0x0, 0xc8(%rsp)
movq %rbx, %rdi
callq 0x6700
movq %rax, %rdi
callq 0xa180
movq %rbx, %rdi
callq 0x668a
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x2550
movl %eax, %edi
callq 0x23c0
movq 0x40(%rsp), %r13
movq 0x28(%r13), %rsi
addq %rsi, %rsi
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
callq 0x4588
xorl %r15d, %r15d
cmpq 0x28(%r13), %r15
jae 0x89c9
movq 0x30(%r13), %rax
leaq (%rax,%r14), %rcx
movq 0x10(%rax,%r14), %rsi
movl 0x18(%rax,%r14), %edx
movq %rbx, %rdi
callq 0x45e5
movq 0x30(%r13), %rcx
xorl %ebp, %ebp
cmpl $0x4, 0x18(%rcx,%r14)
sete %bpl
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4895
movl %ebp, (%rax)
incq %r15
addq $0x28, %r14
jmp 0x8983
movq %r12, 0x108(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x110(%rsp)
leaq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0x95b4
movq 0x85e4(%rip), %rbx      # 0x10fd8
movq (%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x2140
movupd 0x2739(%rip), %xmm0     # 0xb140
leaq 0x90(%rsp), %rax
movapd %xmm0, (%rax)
movq (%rbx), %rdi
callq 0x2070
movb $0x1, %bpl
leaq 0x120(%rsp), %r13
movl $0x0, 0x14(%rsp)
movl $0x0, 0x2c(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
movl $0x0, 0xc(%rsp)
movq $0x0, 0x78(%rsp)
xorl %r8d, %r8d
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %r8, 0x58(%rsp)
movq 0x118(%rsp), %rdi
callq 0xa0d2
movq 0x855e(%rip), %r15      # 0x10fd8
movq (%r15), %rdi
callq 0x2500
movl %eax, 0x4c(%rsp)
movq (%r15), %rdi
callq 0x2500
movl %eax, %r15d
callq 0x2460
cmpl $-0x1, %r15d
je 0x8aa4
movl %r15d, %edi
callq 0x2270
movl 0x4c(%rsp), %r12d
movl %r12d, %eax
cmpl $0xff, %r12d
movq 0x78(%rsp), %r15
ja 0x8ac2
movl %r12d, %edi
callq 0x23a0
movl %eax, 0x10(%rsp)
cmpl $0x19a, %r12d           # imm = 0x19A
sete %al
testq %r15, %r15
sete %r12b
orb %al, %r12b
cmpb $0x1, %r12b
jne 0x8bae
callq 0xa553
movq 0x84d8(%rip), %rax      # 0x10fc8
movl (%rax), %eax
movl %eax, 0x98(%rsp)
movq 0x84a0(%rip), %rax      # 0x10fa0
movl (%rax), %eax
leal -0x1(%rax), %ecx
testl %eax, %eax
movl $0x0, %eax
cmovlel %eax, %ecx
movl %ecx, 0x9c(%rsp)
movq %r15, %rdi
callq 0x28e5
movl 0x98(%rsp), %edi
movl 0x9c(%rsp), %esi
callq 0xa4f2
movq %rax, 0x78(%rsp)
andl $0x0, 0xe8(%rsp)
movl 0x98(%rsp), %ecx
movl 0x9c(%rsp), %esi
movl %esi, 0xec(%rsp)
movl %ecx, %eax
cltd
pushq $0x2
popq %rdi
idivl %edi
movl %eax, 0xf0(%rsp)
movq 0x846f(%rip), %rdx      # 0x10fd8
movq (%rdx), %rdx
movq %rdx, 0xf8(%rsp)
movl %eax, 0xb8(%rsp)
movl %esi, 0xbc(%rsp)
subl %eax, %ecx
movl %ecx, 0xc0(%rsp)
movq %rdx, 0xc8(%rsp)
testq %rbx, %rbx
je 0x8bc4
movq %rbx, %rdi
callq 0x2250
leaq 0x3439(%rip), %rdi      # 0xbfe0
callq 0xa308
jmp 0x8bc6
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x38(%rsp)
jmp 0x8c1b
xorl %eax, %eax
movq %rax, 0x38(%rsp)
testq %r14, %r14
je 0x8be6
movq %r14, %rdi
callq 0x2250
leaq 0x3431(%rip), %rdi      # 0xc010
callq 0xa308
jmp 0x8be8
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movb $0x1, %bpl
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x8c12
callq 0x2250
leaq 0x342a(%rip), %rdi      # 0xc030
callq 0xa308
movq %rax, 0x20(%rsp)
jmp 0x8c1b
movq $0x0, 0x20(%rsp)
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq 0x130(%rsp), %rbx
jae 0x8c3d
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4895
addl (%rax), %r14d
incq %rbx
jmp 0x8c20
testb $0x1, 0xc(%rsp)
je 0x8c4e
xorl %ebx, %ebx
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x8c7b
testl %r14d, %r14d
jg 0x8c64
leaq 0x140(%rsp), %rdi
callq 0x974a
testb %al, %al
je 0x8c44
leaq 0x140(%rsp), %rdi
callq 0x974a
movl %eax, %ebx
movl $0x0, 0xc(%rsp)
testb $0x1, %bpl
je 0x8dac
movsd 0x170(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq %r13, %rdi
callq 0x45bc
movq %rax, %r15
movq %r13, %rdi
callq 0x45c1
movsd 0x140(%rsp), %xmm0
movsd 0x148(%rsp), %xmm1
movq 0x78(%rsp), %rbp
movq %rbp, %rdi
movsd 0x58(%rsp), %xmm2
movq 0x110(%rsp), %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x29ff
leaq 0x190(%rsp), %rdi
callq 0x6700
movq %rbp, %rdi
leaq 0x90(%rsp), %rsi
movq %rax, %rdx
callq 0xa41d
leaq 0x140(%rsp), %r15
movq %r15, %rdi
callq 0x963f
movsd %xmm0, 0xd8(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xa1ff
movq %r15, %rdi
callq 0x9660
movsd %xmm0, 0xa8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xa1ff
movq 0x8293(%rip), %r15      # 0x10fd8
movq (%r15), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x2440
cmpb $0x0, 0xc(%rsp)
je 0x8d80
movq (%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2320
cmpl $-0x1, %eax
je 0x8d95
movq (%r15), %rdi
leaq 0x3231(%rip), %rsi      # 0xbfa7
pushq $-0x1
popq %rdx
callq 0x2380
jmp 0x8d95
xorl %edi, %edi
xorl %esi, %esi
leaq 0x3240(%rip), %rdx      # 0xbfcb
movl %r14d, %ecx
xorl %eax, %eax
callq 0x21e0
movq (%r15), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x20e0
movq (%r15), %rdi
callq 0x2220
movq 0x38(%rsp), %r14
testq %r14, %r14
je 0x8dfc
movswl 0x4(%r14), %edx
incl %edx
movq %r14, %rdi
xorl %esi, %esi
pushq $0x1
popq %rcx
callq 0x24b0
movq %r14, %rdi
callq 0x2220
cmpl $0x79, 0x10(%rsp)
sete %al
testb %al, 0xc(%rsp)
jne 0x9509
testb %bl, %bl
je 0x8f41
cmpl $0x79, 0x10(%rsp)
jne 0x909c
jmp 0x950f
testb %bl, %bl
je 0x8e21
cmpl $0x79, 0x10(%rsp)
je 0x950f
leaq 0x31ce(%rip), %rdi      # 0xbfe0
callq 0xa308
movq %rax, 0x38(%rsp)
jmp 0x909c
testb $0x1, 0x30(%rsp)
movl 0x10(%rsp), %eax
je 0x8e8e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8e5e
movswl 0x4(%rdi), %edx
incl %edx
movq 0x20(%rsp), %rdi
xorl %esi, %esi
pushq $0x1
popq %rcx
callq 0x24b0
movq 0x20(%rsp), %rdi
callq 0x2220
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rdi
cmpl $0x6e, %eax
je 0x8fd8
movl %eax, %ecx
movb $0x1, %al
movq %rax, 0x30(%rsp)
movl %r12d, %ebp
movq %rdi, %r8
movq 0x18(%rsp), %r14
movl $0x0, %ebx
cmpl $0x79, %ecx
jne 0x8a61
jmp 0x950f
testb $0x1, 0x50(%rsp)
je 0x8f31
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x8ec1
movswl 0x4(%rdi), %edx
incl %edx
xorl %esi, %esi
pushq $0x1
popq %rcx
callq 0x24b0
movq 0x18(%rsp), %rdi
callq 0x2220
movl 0x10(%rsp), %eax
cmpl $0x78, %eax
je 0x9470
movl %eax, %edx
movb $0x1, %al
movq %rax, 0x50(%rsp)
movq $0x0, 0x30(%rsp)
movl %r12d, %ebp
movq 0x20(%rsp), %rcx
movq %rcx, %r8
movq 0x18(%rsp), %r14
movl $0x0, %ebx
cmpl $0x70, %edx
jne 0x8a61
movq $0x0, 0x30(%rsp)
movl %r12d, %ebp
movl $0x0, %eax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rdi
movq %rcx, %r8
movl $0x0, %r14d
movl $0x0, %ebx
testq %rdi, %rdi
jne 0x949a
jmp 0x8a61
cmpl $0x79, %eax
sete %al
testb %al, 0xc(%rsp)
jne 0x9509
movl 0x10(%rsp), %eax
cmpl $0x70, %eax
jne 0x8f72
leaq 0x30bf(%rip), %rdi      # 0xc010
callq 0xa308
movq %rax, %r14
movb $0x1, %bpl
movb $0x1, %al
movq %rax, 0x50(%rsp)
movq 0x20(%rsp), %r8
movq 0x38(%rsp), %rbx
jmp 0x8a61
cmpl $0x78, %eax
sete %al
movl 0x4c(%rsp), %edi
cmpl $0x1b, %edi
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x8fa7
leaq 0x30a0(%rip), %rdi      # 0xc030
callq 0xa308
movq %rax, %r8
movb $0x1, %bpl
movb $0x1, %al
movq %rax, 0x30(%rsp)
jmp 0x9403
cmpl $0xff, %edi
ja 0x901d
callq 0x23a0
movl %eax, %ebx
leal -0x61(%rbx), %eax
cmpl $0x16, %eax
ja 0x901d
movl $0x440009, %ecx         # imm = 0x440009
btl %eax, %ecx
jae 0x9002
cmpl %ebx, 0x14(%rsp)
movl $0x0, %eax
jne 0x9023
jmp 0x9068
movq $0x0, 0x30(%rsp)
movl %r12d, %ebp
movl $0x0, %r8d
movq 0x18(%rsp), %r14
movl $0x0, %ebx
testq %rdi, %rdi
jne 0x9438
jmp 0x8a61
cmpl $0x4, %eax
je 0x9426
cmpl $0x10, %eax
jne 0x901d
movl 0x14(%rsp), %eax
movl %eax, %ebx
pushq $0x5
jmp 0x942e
movl 0x14(%rsp), %eax
movl %eax, %ebx
cmpl $0x61, %ebx
je 0x9051
cmpl $0x64, %ebx
je 0x9041
cmpl $0x77, %ebx
je 0x904b
cmpl $0x73, %ebx
jne 0x9066
movsd 0x2091(%rip), %xmm0     # 0xb0d0
jmp 0x9059
movsd 0x2f0f(%rip), %xmm0     # 0xbf58
jmp 0x9059
xorpd %xmm0, %xmm0
jmp 0x9059
movsd 0x2f07(%rip), %xmm0     # 0xbf60
leaq 0x140(%rsp), %rdi
callq 0x96c1
movl %ebx, %eax
movl 0x2c(%rsp), %ebx
testl %ebx, %ebx
movl %eax, 0x14(%rsp)
jle 0x908c
leaq 0x140(%rsp), %rdi
callq 0x972a
pushq $-0x1
popq %rax
addl %eax, %ebx
movl %ebx, 0x2c(%rsp)
jmp 0x909c
testl %ebx, %ebx
js 0x9412
movl $0x0, 0x2c(%rsp)
movq 0x40(%rsp), %rdi
movsd 0x150(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
callq 0x71b4
xorl %ebx, %ebx
cmpq 0x130(%rsp), %rbx
jae 0x923b
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4840
movq %rax, %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0x481a
movq %rax, %rbp
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4838
movq %rax, %r14
movupd (%rax), %xmm0
movupd (%rbp), %xmm1
addpd %xmm0, %xmm1
movupd %xmm1, (%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movl 0x44(%r15), %r12d
callq 0x24a0
cmpl %eax, %r12d
jbe 0x9150
movupd (%rbp), %xmm0
subpd 0x140(%rsp), %xmm0
movapd %xmm0, 0x80(%rsp)
movsd 0x50(%r15), %xmm0
xorpd 0x1f0d(%rip), %xmm0     # 0xb050
leaq 0x80(%rsp), %rdi
callq 0xa78a
movupd (%rbp), %xmm0
movapd %xmm0, 0x60(%rsp)
cmpb $0x1, 0x59(%r15)
jne 0x91ac
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4829
movsd 0x10(%rax), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x71b4
movsd 0x60(%rsp), %xmm0
ucomisd (%rbp), %xmm0
jne 0x919f
jp 0x919f
movsd 0x68(%rsp), %xmm0
ucomisd 0x8(%rbp), %xmm0
jne 0x919f
jnp 0x91fe
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4887
jmp 0x91fe
cmpb $0x1, 0x58(%r15)
jne 0x91fe
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4829
movsd 0x10(%rax), %xmm0
movq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x71b4
movapd 0x60(%rsp), %xmm0
movupd (%rbp), %xmm1
subpd %xmm1, %xmm0
addpd 0x80(%rsp), %xmm0
movapd %xmm0, 0x80(%rsp)
movapd 0x60(%rsp), %xmm0
movupd %xmm0, (%rbp)
movsd 0x80(%rsp), %xmm0
ucomisd 0x2d59(%rip), %xmm0     # 0xbf68
jne 0x9213
jnp 0x9218
movsd %xmm0, (%r14)
movsd 0x88(%rsp), %xmm0
ucomisd 0x2d3f(%rip), %xmm0     # 0xbf68
jne 0x922d
jnp 0x9233
movsd %xmm0, 0x8(%r14)
incq %rbx
jmp 0x90b9
leaq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0x9809
movq 0x130(%rsp), %rax
xorl %ebx, %ebx
cmpq %rax, %rbx
jae 0x92e9
leaq 0x1(%rbx), %r14
movq %r14, 0x58(%rsp)
cmpq %rax, %r14
jae 0x92df
movq %r13, %rdi
movq %rbx, %rsi
callq 0x484d
movl %eax, %ebp
movq %r13, %rdi
movq %r14, %rsi
callq 0x484d
movl %eax, %r15d
movl %ebp, %edi
movl %eax, %esi
callq 0xa091
testb %al, %al
je 0x92d2
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4829
movq %rax, %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x4829
movq %r12, %rdi
movq %rax, %rsi
callq 0x267c
testb %al, %al
je 0x92d2
cmpl $0x3, %ebp
setne %al
cmpl $0x3, %r15d
setne %cl
testb %cl, %al
jne 0x92d2
callq 0x2170
incq %r14
movq 0x130(%rsp), %rax
jmp 0x9267
movq 0x58(%rsp), %rbx
jmp 0x9255
movl 0x4c(%rsp), %ecx
cmpl 0x10(%rsp), %ecx
sete %al
cmpl $0x20, %ecx
setne %cl
testb %al, %cl
jne 0x930e
leaq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0x9757
xorl %ebx, %ebx
cmpq 0x130(%rsp), %rbx
jae 0x93de
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4840
cmpq $0x0, 0x30(%rax)
je 0x93d6
movq %rax, %r14
movl 0x48(%rax), %ebp
callq 0x24a0
cmpl %eax, %ebp
jbe 0x93d6
movq %r13, %rdi
movq %rbx, %rsi
callq 0x481a
movups (%rax), %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x30(%r14), %r14
movq %r13, %rdi
movq %rbx, %rsi
callq 0x484d
movq %r13, %rdi
movq %r14, %rsi
movl %eax, %edx
leaq 0x80(%rsp), %rcx
callq 0x45e5
movq %rax, %r14
movq %r13, %rdi
movq %rax, %rsi
callq 0x4838
movq %rax, %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4838
movups (%rax), %xmm0
movups %xmm0, (%r15)
movups (%rax), %xmm0
movaps %xmm0, 0x60(%rsp)
movq %r13, %rdi
movq %r14, %rsi
callq 0x4840
movsd 0x50(%rax), %xmm0
leaq 0x60(%rsp), %rdi
callq 0xa78a
movupd (%r15), %xmm0
addpd 0x60(%rsp), %xmm0
movupd %xmm0, (%r15)
incq %rbx
jmp 0x9310
leaq 0x140(%rsp), %rdi
callq 0x9685
movq %r13, %rdi
callq 0x4724
movq %r13, %rdi
callq 0x48a4
movb $0x1, %bpl
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %r14
movq 0x38(%rsp), %rbx
jmp 0x8a61
leaq 0x140(%rsp), %rdi
callq 0x973a
pushq $0x1
jmp 0x9083
movl 0x14(%rsp), %eax
movl %eax, %ebx
pushq $-0x5
popq %rax
movl %eax, 0x2c(%rsp)
jmp 0x9023
callq 0x2250
movq 0x7b94(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
pushq $-0x1
popq %rdx
testq %rdi, %rdi
je 0x9455
movswl 0x4(%rdi), %edx
incl %edx
movq $0x0, 0x30(%rsp)
xorl %esi, %esi
pushq $0x1
popq %rcx
callq 0x24b0
movb $0x1, %bpl
xorl %r8d, %r8d
jmp 0x9490
leaq 0x2bb9(%rip), %rdi      # 0xc030
callq 0xa308
movq %rax, %r8
movb $0x1, %al
movq %rax, 0x30(%rsp)
movl %r12d, %ebp
movb $0x1, %al
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %r14
jmp 0x8a5f
callq 0x2250
movq 0x7b32(%rip), %rax      # 0x10fd8
movq (%rax), %rdi
pushq $-0x1
popq %rdx
testq %rdi, %rdi
je 0x94b7
movswl 0x4(%rdi), %edx
incl %edx
movq $0x0, 0x30(%rsp)
xorl %esi, %esi
pushq $0x1
popq %rcx
callq 0x24b0
movb $0x1, %bpl
movq $0x0, 0x50(%rsp)
movq 0x20(%rsp), %r8
jmp 0x8a5c
leaq 0x190(%rsp), %rdi
callq 0x6705
leaq 0x2a8c(%rip), %rdx      # 0xbf80
pushq $0x4
popq %rsi
movq %rax, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x691c
jmp 0x9591
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq 0x7ac2(%rip), %rbx      # 0x10fd8
movq (%rbx), %rdi
callq 0x2070
movq (%rbx), %rdi
callq 0x2220
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x9535
callq 0x2250
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movq 0x108(%rsp), %rbx
movq 0x100(%rsp), %r14
je 0x9554
callq 0x2250
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
movq 0x78(%rsp), %r15
je 0x9568
callq 0x2250
movq %r15, %rdi
callq 0x28e5
cmpb $0x0, 0xc(%rsp)
je 0x9582
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9bba
leaq 0x120(%rsp), %rdi
callq 0x493c
xorl %ebx, %ebx
leaq 0x190(%rsp), %rdi
callq 0x671c
movl %ebx, %eax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop