LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/play-level.c
// Function: move_player
static void move_player(struct player *player,
	int *translation, int *turn_duration, int key)
{
	if (key >= 0 && key <= UCHAR_MAX) {
		key = tolower(key);
		switch (key) {
		case 'w': // Forward
		case 's': // Backward
		case 'a': // Left
		case 'd': // Right
			*translation = *translation != key ? key : '\0';
			break;
		case 'q': // Turn CCW
			*turn_duration = +TURN_DURATION;
			break;
		case 'e': // Turn CW
			*turn_duration = -TURN_DURATION;
			break;
		}
	}
	switch (*translation) {
	case 'w': // Forward
		player_walk(player, 0);
		break;
	case 's': // Backward
		player_walk(player, PI);
		break;
	case 'a': // Left
		player_walk(player, PI / 2);
		break;
	case 'd': // Right
		player_walk(player, -PI / 2);
		break;
	default:
		break;
	}
	if (*turn_duration > 0) {
		player_turn_ccw(player);
		--*turn_duration;
	} else if (*turn_duration < 0) {
		player_turn_cw(player);
		++*turn_duration;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0xe405
cmpl $0xff, -0x1c(%rbp)
jg 0xe405
movl -0x1c(%rbp), %edi
callq 0x2390
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
subl $0x61, %eax
je 0xe3c8
jmp 0xe396
movl -0x20(%rbp), %eax
subl $0x64, %eax
je 0xe3c8
jmp 0xe3a0
movl -0x20(%rbp), %eax
subl $0x65, %eax
je 0xe3f9
jmp 0xe3aa
movl -0x20(%rbp), %eax
subl $0x71, %eax
je 0xe3ed
jmp 0xe3b4
movl -0x20(%rbp), %eax
subl $0x73, %eax
je 0xe3c8
jmp 0xe3be
movl -0x20(%rbp), %eax
subl $0x77, %eax
jne 0xe403
jmp 0xe3c8
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpl -0x1c(%rbp), %eax
je 0xe3db
movl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xe3e2
xorl %eax, %eax
movl %eax, -0x24(%rbp)
jmp 0xe3e2
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
jmp 0xe403
movq -0x18(%rbp), %rax
movl $0x5, (%rax)
jmp 0xe403
movq -0x18(%rbp), %rax
movl $0xfffffffb, (%rax)     # imm = 0xFFFFFFFB
jmp 0xe405
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x16, %eax
ja 0xe474
movq -0x30(%rbp), %rax
leaq 0x3cbc(%rip), %rcx      # 0x120e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xec10
jmp 0xe476
movq -0x8(%rbp), %rdi
movsd 0x2c11(%rip), %xmm0     # 0x11058
callq 0xec10
jmp 0xe476
movq -0x8(%rbp), %rdi
movsd 0x3c76(%rip), %xmm0     # 0x120d0
callq 0xec10
jmp 0xe476
movq -0x8(%rbp), %rdi
movsd 0x3c5b(%rip), %xmm0     # 0x120c8
callq 0xec10
jmp 0xe476
jmp 0xe476
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jle 0xe495
movq -0x8(%rbp), %rdi
callq 0xecd0
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
jmp 0xe4b4
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jge 0xe4b2
movq -0x8(%rbp), %rdi
callq 0xed00
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xe4b4
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/play-level.c
// Function: hit_ents
static void hit_ents(struct ents *ents)
{
	ENTS_FOR_EACH_PAIR(ents, ea, eb) {
		enum team ta = ents_team(ents, ea), tb = ents_team(ents, eb);
		if (teams_can_collide(ta, tb)) {
			if (bodies_collide(ents_body(ents, ea),
				ents_body(ents, eb))
			 && (ta == TEAM_ALLY || tb == TEAM_ALLY))
				beep();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xe80e
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xe7fb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6520
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6520
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0xfde0
testb $0x1, %al
jne 0xe7a5
jmp 0xe7e8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x64a0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x64a0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x2680
testb $0x1, %al
jne 0xe7d5
jmp 0xe7e6
cmpl $0x3, -0x1c(%rbp)
je 0xe7e1
cmpl $0x3, -0x20(%rbp)
jne 0xe7e6
callq 0x2170
jmp 0xe7e8
jmp 0xe7ea
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xe762
jmp 0xe7fd
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xe744
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/play-level.c
// Function: shoot_bullets
static void shoot_bullets(struct ents *ents)
{
	ENTS_FOR_EACH(ents, e) {
		struct ent_type *type = ents_type(ents, e);
		if (type->bullet && chance_decide(type->shoot_chance)) {
			d3d_vec_s pos = *ents_pos(ents, e);
			ent_id bullet = ents_add(ents, type->bullet,
				ents_team(ents, e), &pos);
			d3d_vec_s *bvel = ents_vel(ents, bullet), d_bvel;
			d_bvel = *bvel = *ents_vel(ents, e);
			vec_norm_mul(&d_bvel, ents_type(ents, bullet)->speed);
			bvel->x += d_bvel.x;
			bvel->y += d_bvel.y;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xe972
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x64f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xe95f
movq -0x18(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x4c(%rbp)
callq 0x24a0
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
jbe 0xe95f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6470
movq (%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6520
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl %eax, %edx
leaq -0x28(%rbp), %rcx
callq 0x60c0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x64d0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x64d0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq (%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x64f0
movsd 0x50(%rax), %xmm0
leaq -0x48(%rbp), %rdi
callq 0x10af0
movsd -0x48(%rbp), %xmm0
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd -0x40(%rbp), %xmm0
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0xe961
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xe834
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/player.c
// Function: player_init
void player_init(struct player *player, struct map *map)
{
	player->start = &map->player;
	player->body.pos = player->start->pos;
	player->body.radius = player->start->type->width / 2;
	player->body.health = player->start->type->health;
	player->body.damage = player->start->type->damage;
	player->turn_speed = PLAYER_TURN_MULTIPLIER
		* chance_to_fraction(player->start->type->turn_chance);
	double reload_ready =
		1.0 / chance_to_fraction(player->start->type->shoot_chance);
	player->reload_ready = isfinite(reload_ready) ? reload_ready : LONG_MAX;
	player->reload = player->reload_ready;
	player->facing = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
addq $0x38, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x10(%rcx), %rcx
movsd 0x8(%rcx), %xmm0
movsd 0x2665(%rip), %xmm1     # 0x11028
mulsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x10(%rcx), %rcx
movsd 0x60(%rcx), %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x10(%rcx), %rcx
movsd 0x68(%rcx), %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x10(%rcx), %rcx
movl 0x44(%rcx), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x382c(%rip), %xmm1     # 0x12240
mulsd %xmm1, %xmm0
movsd 0x3828(%rip), %xmm1     # 0x12248
mulsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movl 0x48(%rax), %eax
cvtsi2sd %rax, %xmm1
movsd 0x284b(%rip), %xmm0     # 0x11290
divsd %xmm0, %xmm1
movsd 0x25e7(%rip), %xmm0     # 0x11038
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movq %xmm0, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq %rcx, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
subq %rcx, %rax
setl %al
testb $0x1, %al
jne 0xea87
jmp 0xea93
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0xeaa2
movsd 0x25a5(%rip), %xmm0     # 0x11040
movsd %xmm0, -0x20(%rbp)
jmp 0xeaa2
movsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/player.c
// Function: player_try_shoot
bool player_try_shoot(struct player *player, struct ents *ents)
{
	if (!player_can_shoot(player)) return false;
	player->reload = 0;
	ent_id bullet = ents_add(ents, player->start->type->bullet, TEAM_ALLY,
		&player->body.pos);
	d3d_vec_s *bvel = ents_vel(ents, bullet);
	bvel->x = player->start->type->bullet->speed * cos(player->facing);
	bvel->y = player->start->type->bullet->speed * sin(player->facing);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xebb0
testb $0x1, %al
jne 0xed76
movb $0x0, -0x11(%rbp)
jmp 0xee4a
movq -0x20(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rsi
movq -0x20(%rbp), %rcx
movl $0x3, %edx
callq 0x60c0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x64d0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x2190
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq 0x30(%rax), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x2530
movaps %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movb $0x1, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/player.c
// Function: player_collide
void player_collide(struct player *player, struct ents *ents)
{
	if (player_is_dead(player)) return;
	ENTS_FOR_EACH(ents, e) {
		if (teams_can_collide(player->start->team, ents_team(ents, e)))
			bodies_collide(&player->body, ents_body(ents, e));
	}
	player->body.health =
		CLAMP(player->body.health, 0, player->start->type->health);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xed30
testb $0x1, %al
jne 0xee7f
jmp 0xee84
jmp 0xef68
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xeef6
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x18(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6520
movl -0x1c(%rbp), %edi
movl %eax, %esi
callq 0xfde0
testb $0x1, %al
jne 0xeec5
jmp 0xeee6
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x64a0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x2680
jmp 0xeee8
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xee8c
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x18(%rax), %xmm0
jbe 0xef0e
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0xef5a
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
ucomisd 0x60(%rax), %xmm0
jbe 0xef42
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0xef50
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x18(%rax)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/save-state.c
// Function: save_state_write
int save_state_write(struct save_state *save, FILE *to)
{
	struct string buf;
	size_t cap = 64;
	string_init(&buf, cap);
	string_pushz(&buf, &cap, "{\n \"complete\": ");
	if (table_count(&save->complete) > 0) {
		const char *before = "[";
		const char *key;
		void **UNUSED_VAR(val);
		TABLE_FOR_EACH(&save->complete, key, val) {
			string_pushz(&buf, &cap, before);
			string_pushz(&buf, &cap, "\n  \"");
			escape_text_json(key, &buf, &cap);
			before = "\",";
		}
		string_pushz(&buf, &cap, "\"\n ]\n}");
	} else {
		string_pushz(&buf, &cap, "[]\n}");
	}
	// Try to recover from errors where part of the data was written:
	size_t total_writ = 0;
	do {
		size_t writ = fwrite(buf.text + total_writ, 1,
			buf.len - total_writ, to);
		// Exit if no progress is being made:
		if (!writ) {
			free(buf.text);
			return -1;
		}
		clearerr(to);
		total_writ += writ;
	} while (total_writ < buf.len);
	free(buf.text);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x40, -0x30(%rbp)
movq -0x30(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0xf7f0
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0x2c86(%rip), %rdx      # 0x1226a
callq 0xf900
movq -0x10(%rbp), %rdi
callq 0xfcc0
cmpq $0x0, %rax
jbe 0xf6cc
leaq 0x2c77(%rip), %rax      # 0x1227a
movq %rax, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x61(%rbp)
jae 0xf65b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
movb $0x1, %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xf664
jmp 0xf6b6
movq -0x38(%rbp), %rdx
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xf900
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0x2bf8(%rip), %rdx      # 0x1227c
callq 0xf900
movq -0x40(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x7060
leaq 0x2be0(%rip), %rax      # 0x12281
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xf60f
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0x2bbf(%rip), %rdx      # 0x12284
callq 0xf900
jmp 0xf6e0
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0x2bb0(%rip), %rdx      # 0x1228b
callq 0xf900
movq $0x0, -0x58(%rbp)
movq -0x20(%rbp), %rdi
addq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rdx
subq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %esi
callq 0x2470
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0xf723
movq -0x20(%rbp), %rdi
callq 0x2580
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf752
movq -0x18(%rbp), %rdi
callq 0x2450
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0xf6e8
movq -0x20(%rbp), %rdi
callq 0x2580
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/save-state.c
// Function: save_state_destroy
void save_state_destroy(struct save_state *save)
{
	const char *key;
	void **UNUSED_VAR(val);
	TABLE_FOR_EACH(&save->complete, key, val) {
		free((char *)key);
	}
	table_free(&save->complete);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x21(%rbp)
jae 0xf7c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movb $0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xf7c9
jmp 0xf7e0
movq -0x10(%rbp), %rdi
callq 0x2580
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xf774
movq -0x8(%rbp), %rdi
callq 0xfce0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/table.c
// Function: table_add
int table_add(table *tbl, const char *key, void *val)
{
	struct item *slot;
	GROWE(tbl->items, tbl->len, tbl->cap);
	--tbl->len;
	if (find(tbl, &slot, key)) return -1;
	memmove(slot + 1, slot, (tbl->len - (slot - tbl->items)) * ITEM_SIZE);
	slot->key = key;
	slot->val = val;
	++tbl->len;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
movl $0x10, %ecx
callq 0x6700
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x28(%rbp), %rsi
callq 0xfab0
testb $0x1, %al
jne 0xfa37
jmp 0xfa40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfa9e
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
sarq $0x4, %rax
subq %rax, %rdx
shlq $0x4, %rdx
callq 0x22b0
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/table.c
// Function: find
static bool find(table *tbl, struct item **found, const char *key)
{
	long start = 0, end = tbl->len - 1;
	while (start <= end) {
		long mid = (start + end) / 2;
		int cmp = strcmp(key, tbl->items[mid].key);
		if (cmp > 0) {
			start = mid + 1;
		} else if (cmp < 0) {
			end = mid - 1;
		} else {
			*found = &tbl->items[mid];
			return true;
		}
	}
	*found = &tbl->items[start];
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jg 0xfb70
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2380
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jle 0xfb35
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xfb6b
cmpl $0x0, -0x3c(%rbp)
jge 0xfb49
movq -0x38(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xfb69
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x38(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xfb8e
jmp 0xfb6b
jmp 0xfadb
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/table.c
// Function: table_remove
void *table_remove(table *tbl, const char *key)
{
	struct item *got;
	if (find(tbl, &got, key)) {
		void *val = got->val;
		--tbl->len;
		memmove(got, got + 1,
			(tbl->len - (got - tbl->items)) * ITEM_SIZE);
		return val;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq -0x20(%rbp), %rsi
callq 0xfab0
testb $0x1, %al
jne 0xfc57
jmp 0xfcad
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
sarq $0x4, %rax
subq %rax, %rdx
shlq $0x4, %rdx
callq 0x22b0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xfcb5
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/team.c
// Function: team_from_str
enum team team_from_str(const char *str)
{
	if (!strcasecmp(str, "GHOST")) {
		return TEAM_GHOST;
	} else if (!strcasecmp(str, "UNALIGNED")) {
		return TEAM_UNALIGNED;
	} else if (!strcasecmp(str, "PLAYER")) {
		return TEAM_PLAYER;
	} else if (!strcasecmp(str, "ALLY")) {
		return TEAM_ALLY;
	} else if (!strcasecmp(str, "ENEMY")) {
		return TEAM_ENEMY;
	} else if (!strcasecmp(str, "PICKUP")) {
		return TEAM_PICKUP;
	} else {
		return TEAM_INVALID;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2579(%rip), %rsi      # 0x12290
callq 0x2120
cmpl $0x0, %eax
jne 0xfd2d
movl $0x0, -0x4(%rbp)
jmp 0xfdca
movq -0x10(%rbp), %rdi
leaq 0x255e(%rip), %rsi      # 0x12296
callq 0x2120
cmpl $0x0, %eax
jne 0xfd4b
movl $0x1, -0x4(%rbp)
jmp 0xfdca
movq -0x10(%rbp), %rdi
leaq 0x254a(%rip), %rsi      # 0x122a0
callq 0x2120
cmpl $0x0, %eax
jne 0xfd69
movl $0x2, -0x4(%rbp)
jmp 0xfdca
movq -0x10(%rbp), %rdi
leaq 0x2533(%rip), %rsi      # 0x122a7
callq 0x2120
cmpl $0x0, %eax
jne 0xfd87
movl $0x3, -0x4(%rbp)
jmp 0xfdca
movq -0x10(%rbp), %rdi
leaq 0x251a(%rip), %rsi      # 0x122ac
callq 0x2120
cmpl $0x0, %eax
jne 0xfda5
movl $0x4, -0x4(%rbp)
jmp 0xfdca
movq -0x10(%rbp), %rdi
leaq 0x2502(%rip), %rsi      # 0x122b2
callq 0x2120
cmpl $0x0, %eax
jne 0xfdc3
movl $0x5, -0x4(%rbp)
jmp 0xfdca
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/ticker.c
// Function: tick
void tick(struct ticker *tkr)
{
	struct timeval now;
	gettimeofday(&now, NULL);
	long elapsed = (long)now.tv_usec - (long)tkr->last_tick.tv_usec;
	if (elapsed < 0) elapsed += 1000000;
	long delay = tkr->interval - elapsed;
	if (delay > 0) {
		struct timespec delay_ts =
			{ .tv_sec = 0, .tv_nsec = delay * 1000 };
		nanosleep(&delay_ts, NULL);
	}
	gettimeofday(&tkr->last_tick, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2130
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x8(%rcx), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0xfe8e
movq -0x20(%rbp), %rax
addq $0xf4240, %rax          # imm = 0xF4240
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jle 0xfec6
movq $0x0, -0x38(%rbp)
imulq $0x3e8, -0x28(%rbp), %rax # imm = 0x3E8
movq %rax, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x23a0
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2130
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/ui-util.c
// Function: color_map_add_pair
int color_map_add_pair(struct color_map *map, d3d_pixel pix)
{
	if (pix >= sizeof(map->pixel2pair)) return 0;
	if (map->pixel2pair[pix] == 0) {
		if (map->pair_num >= COLOR_PAIRS - 1) return 0;
		++map->pair_num;
		map->pixel2pair[pix] = map->pair_num;
	}
	return map->pixel2pair[pix];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
cmpq $0x40, %rax
jb 0xff31
movl $0x0, -0x4(%rbp)
jmp 0xff91
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movsbl 0x4(%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xff81
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq 0x6040(%rip), %rcx      # 0x15f90
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0xff62
movl $0x0, -0x4(%rbp)
jmp 0xff91
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movb %dl, 0x4(%rax,%rcx)
movq -0x10(%rbp), %rax
movzbl -0x11(%rbp), %ecx
movsbl 0x4(%rax,%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/ui-util.c
// Function: color_map_apply
int color_map_apply(struct color_map *map)
{
	static const short colors[] = {
		COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
		COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE
	};
	int ret = 0;
	for (d3d_pixel p = 0; p < sizeof(map->pixel2pair); ++p) {
		int pair = map->pixel2pair[p];
		if (pair > 0) {
			int fg = colors[pixel_fg(p)];
			int bg = colors[pixel_bg(p)];
			if (init_pair(pair, fg, bg) == ERR) {
				map->pixel2pair[p] = 0;
				ret = -1;
			}
		}
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
movzbl -0xd(%rbp), %eax
cmpq $0x40, %rax
jae 0x10055
movq -0x8(%rbp), %rax
movzbl -0xd(%rbp), %ecx
movsbl 0x4(%rax,%rcx), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x10046
movzbl -0xd(%rbp), %eax
sarl $0x3, %eax
andl $0x7, %eax
movslq %eax, %rcx
leaq 0x2311(%rip), %rax      # 0x12300
movswl (%rax,%rcx,2), %eax
movl %eax, -0x18(%rbp)
movzbl -0xd(%rbp), %eax
andl $0x7, %eax
movslq %eax, %rcx
leaq 0x22f9(%rip), %rax      # 0x12300
movswl (%rax,%rcx,2), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
movw %ax, %dx
movl -0x18(%rbp), %eax
movw %ax, %cx
movl -0x1c(%rbp), %eax
movswl %dx, %edi
movswl %cx, %esi
movswl %ax, %edx
callq 0x21b0
cmpl $-0x1, %eax
jne 0x10044
movq -0x8(%rbp), %rax
movzbl -0xd(%rbp), %ecx
movb $0x0, 0x4(%rax,%rcx)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
jmp 0x10046
jmp 0x10048
movb -0xd(%rbp), %al
addb $0x1, %al
movb %al, -0xd(%rbp)
jmp 0xffb7
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/ui-util.c
// Function: display_frame
void display_frame(d3d_camera *cam, struct screen_area *area,
	struct color_map *colors)
{
	size_t width = d3d_camera_width(cam);
	if (width > (size_t)area->width) width = (size_t)area->width;
	size_t height = d3d_camera_height(cam);
	if (height > (size_t)area->height) height = (size_t)area->height;
	for (size_t x = 0; x < width; ++x) {
		for (size_t y = 0; y < height; ++y) {
			d3d_pixel pix = *d3d_camera_get(cam, x, y);
			int pair = color_map_get_pair(colors, pix);
			mvaddch((int)y + area->y, (int)x + area->x,
				COLOR_PAIR(pair) | SCENE_FG_CHAR);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3bb0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x104be
movq -0x10(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3bd0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0xc(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x104e8
movq -0x10(%rbp), %rax
movslq 0xc(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x105ab
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x10598
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x3bf0
movb (%rax), %al
movb %al, -0x39(%rbp)
movq -0x18(%rbp), %rdi
movzbl -0x39(%rbp), %esi
callq 0x10080
movl %eax, -0x40(%rbp)
movq 0x5a97(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x10(%rbp), %rax
addl 0x4(%rax), %esi
movq -0x30(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
addl (%rax), %edx
callq 0x2310
cmpl $-0x1, %eax
jne 0x10569
jmp 0x10587
movq 0x5a68(%rip), %rax      # 0x15fd8
movq (%rax), %rdi
movl -0x40(%rbp), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
orl $0x3a, %esi
callq 0x2210
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x10506
jmp 0x1059a
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x104f0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/ui-util.c
// Function: camera_with_dims
d3d_camera *camera_with_dims(int width, int height)
{
	d3d_camera *cam;
	if (width <= 0) width = 1;
	if (height <= 0) height = 1;
	if (width >= height) {
		cam = assert_alloc(d3d_new_camera(CAM_FOV_X,
			CAM_FOV_X / PIXEL_ASPECT * height / width,
			width, height, pixel(PC_BLACK, PC_BLACK)));
	} else {
		cam = assert_alloc(d3d_new_camera(CAM_FOV_X * width / height,
			CAM_FOV_X / PIXEL_ASPECT, width, height,
			pixel(PC_BLACK, PC_BLACK)));
	}
	return cam;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0x105db
movl $0x1, -0x4(%rbp)
cmpl $0x0, -0x8(%rbp)
jg 0x105e8
movl $0x1, -0x8(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jl 0x1062f
cvtsi2sdl -0x8(%rbp), %xmm0
movsd 0x1ceb(%rip), %xmm1     # 0x122e8
mulsd %xmm0, %xmm1
cvtsi2sdl -0x4(%rbp), %xmm0
divsd %xmm0, %xmm1
movslq -0x4(%rbp), %rdi
movslq -0x8(%rbp), %rsi
movsd 0x1cd6(%rip), %xmm0     # 0x122f0
xorl %edx, %edx
callq 0x27c0
movq %rax, %rdi
callq 0x10d50
movq %rax, -0x10(%rbp)
jmp 0x1066c
cvtsi2sdl -0x4(%rbp), %xmm1
movsd 0x1cb4(%rip), %xmm0     # 0x122f0
mulsd %xmm1, %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
divsd %xmm1, %xmm0
movslq -0x4(%rbp), %rdi
movslq -0x8(%rbp), %rsi
movsd 0x1c8f(%rip), %xmm1     # 0x122e8
xorl %edx, %edx
callq 0x27c0
movq %rax, %rdi
callq 0x10d50
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/util.c
// Function: flip_direction
d3d_direction flip_direction(d3d_direction dir)
{
	switch (dir) {
	case D3D_DPOSX: return D3D_DNEGX;
	case D3D_DPOSY: return D3D_DNEGY;
	case D3D_DNEGX: return D3D_DPOSX;
	case D3D_DNEGY: return D3D_DPOSY;
	case D3D_DUP: return D3D_DDOWN;
	case D3D_DDOWN: return D3D_DUP;
	default: return dir;

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq %rax, -0x10(%rbp)
subq $0x5, %rax
ja 0x1074e
movq -0x10(%rbp), %rax
leaq 0x1c01(%rip), %rcx      # 0x12310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, -0x4(%rbp)
jmp 0x10754
movl $0x3, -0x4(%rbp)
jmp 0x10754
movl $0x0, -0x4(%rbp)
jmp 0x10754
movl $0x1, -0x4(%rbp)
jmp 0x10754
movl $0x5, -0x4(%rbp)
jmp 0x10754
movl $0x4, -0x4(%rbp)
jmp 0x10754
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/util.c
// Function: mid_cat
char *mid_cat(const char *part1, int mid, const char *part2)
{
	char *cat;
	size_t len1, len2, len;
	len1 = strlen(part1);
	len2 = strlen(part2);
	len = len1 + 1 + len2;
	cat = xmalloc(len + 1);
	memcpy(cat, part1, len1);
	cat[len1] = mid;
	memcpy(cat + len1 + 1, part2, len2 + 1);
	return cat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2200
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2200
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
callq 0x10b80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2510
movl -0xc(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rdi
addq -0x28(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq $0x1, %rdx
callq 0x2510
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/util.c
// Function: ensure_file
int ensure_file(const char *path, bool dir)
{
#ifdef _WIN32
	if (dir) {
		if (_mkdir(path) && errno != EEXIST) return -1;
	} else {
		FILE *f = fopen(path, "a");
		if (!f) return -1;
		fclose(f);
	}
	return 0;
#else
	int fd;
	struct stat st;
	if (stat(path, &st)) {
		fd = dir ? mkdir(path, 0775)
			: open(path, O_RDONLY | O_CREAT, 0664);
	} else {
		if (dir) {
			if (!S_ISDIR(st.st_mode)) {
				errno = EEXIST;
				return -1;
			}
		} else if (!S_ISREG(st.st_mode)) {
			errno = S_ISDIR(st.st_mode) ? EISDIR : EEXIST;
			return -1;
		}
		fd = open(path, O_RDONLY);
	}
	if (fd < 0) return -1;
	close(fd);
	return 0;
#endif /* !defined(_WIN32) */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x24e0
cmpl $0x0, %eax
je 0x10871
testb $0x1, -0x11(%rbp)
je 0x10848
movq -0x10(%rbp), %rdi
movl $0x1fd, %esi            # imm = 0x1FD
callq 0x2540
movl %eax, -0xac(%rbp)
jmp 0x10863
movq -0x10(%rbp), %rdi
movl $0x40, %esi
movl $0x1b4, %edx            # imm = 0x1B4
movb $0x0, %al
callq 0x2520
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x108fe
testb $0x1, -0x11(%rbp)
je 0x1089f
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
je 0x1089d
callq 0x2320
movl $0x11, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1091c
jmp 0x108ee
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x108ec
movl -0x90(%rbp), %edx
andl $0xf000, %edx           # imm = 0xF000
movl $0x11, %eax
movl $0x15, %ecx
cmpl $0x4000, %edx           # imm = 0x4000
cmovel %ecx, %eax
movl %eax, -0xb0(%rbp)
callq 0x2320
movl -0xb0(%rbp), %ecx
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1091c
jmp 0x108ee
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x2520
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x1090d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1091c
movl -0x18(%rbp), %edi
callq 0x2090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/util.c
// Function: default_file
char *default_file(const char *name, const char *env)
{
#ifdef _WIN32
	static const char env_storage_dir[] = "AppData", ts3d_dir[] = "ts3d";
#else
	static const char env_storage_dir[] = "HOME", ts3d_dir[] = ".ts3d";
#endif
	char *dot_dir = NULL, *path = NULL;
	char *env_root, *env_path = getenv(env);
	if (env_path) return str_dup(env_path);
	env_root = getenv("TS3D_ROOT");
	if (env_root) {
		dot_dir = str_dup(env_root);
	} else {
		char *storage_dir = getenv(env_storage_dir);
		if (storage_dir) {
			dot_dir = mid_cat(storage_dir, DIRSEP, ts3d_dir);
		} else {
			errno = ENOENT;
			return NULL;
		}
	}
	if (!ensure_file(dot_dir, true))
		path = mid_cat(dot_dir, DIRSEP, name);
	free(dot_dir);
	return path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2300
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x10976
movq -0x38(%rbp), %rdi
callq 0x106a0
movq %rax, -0x8(%rbp)
jmp 0x10a1f
leaq 0x19c6(%rip), %rdi      # 0x12343
callq 0x2300
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1099c
movq -0x30(%rbp), %rdi
callq 0x106a0
movq %rax, -0x20(%rbp)
jmp 0x109e5
leaq 0x1995(%rip), %rdi      # 0x12338
callq 0x2300
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x109ce
movq -0x40(%rbp), %rdi
movl $0x2f, %esi
leaq 0x197a(%rip), %rdx      # 0x1233d
callq 0x10760
movq %rax, -0x20(%rbp)
jmp 0x109e3
callq 0x2320
movl $0x2, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x10a1f
jmp 0x109e5
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x10800
cmpl $0x0, %eax
jne 0x10a0e
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x2f, %esi
callq 0x10760
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2580
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/util.c
// Function: vec_norm_mul
void vec_norm_mul(d3d_vec_s *vec, d3d_scalar mag)
{
	d3d_scalar hyp = hypot(vec->x, vec->y);
	if (hyp != 0) {
		vec->x *= mag / hyp;
		vec->y *= mag / hyp;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsd (%rax), %xmm1
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm1, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
callq 0x21a0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x10b42
jp 0x10b42
jmp 0x10b70
movsd -0x20(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd -0x20(%rbp), %xmm0
divsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/xalloc.c
// Function: xmalloc
void *xmalloc(size_t size)
{
	void *ptr = malloc(size);
	if (!ptr && size != 0) {
		die("malloc(%lu) failed. Aborting.\n", (unsigned long)size);
	}
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2150
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x10bb9
cmpq $0x0, -0x8(%rbp)
je 0x10bb9
movq -0x8(%rbp), %rsi
leaq 0x179b(%rip), %rdi      # 0x1234d
movb $0x0, %al
callq 0x10bd0
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/xalloc.c
// Function: die
static void die(const char *fmt, ...)
{
	// Probably thread-unsafety is OK.
	static char msgbuf[128];
	va_list va;
	va_start(va, fmt);
	// Hopefully snprintf doesn't allocate.
	int l = vsnprintf(msgbuf, sizeof(msgbuf), fmt, va);
	va_end(va);
	if (l > 0) {
		ssize_t UNUSED_VAR(w) = write(STDERR_FILENO, msgbuf, (size_t)l);
	} else {
		print_default_oom_message();
	}
	abort();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x10c08
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rsi, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq -0x8(%rbp), %rdx
leaq -0x20(%rbp), %rcx
leaq 0x567e(%rip), %rdi      # 0x162e0
movl $0x80, %esi
callq 0x22d0
movl %eax, -0x24(%rbp)
leaq -0x20(%rbp), %rax
cmpl $0x0, -0x24(%rbp)
jle 0x10c94
movslq -0x24(%rbp), %rdx
movl $0x2, %edi
leaq 0x5657(%rip), %rsi      # 0x162e0
callq 0x24d0
movq %rax, -0x30(%rbp)
jmp 0x10c99
callq 0x10d80
callq 0x20c0
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/xalloc.c
// Function: xcalloc
void *xcalloc(size_t count, size_t size)
{
	void *ptr = calloc(count, size);
	if (!ptr && count * size != 0) {
		die("calloc(%lu, %lu) failed. Aborting.\n",
			(unsigned long)count, (unsigned long)size);
	}
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x23d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10ced
movq -0x8(%rbp), %rax
imulq -0x10(%rbp), %rax
cmpq $0x0, %rax
je 0x10ced
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x1686(%rip), %rdi      # 0x1236c
movb $0x0, %al
callq 0x10bd0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/xalloc.c
// Function: xrealloc
void *xrealloc(void *ptr, size_t size)
{
	ptr = realloc(ptr, size);
	if (!ptr && size != 0) {
		die("realloc(%p, %lu) failed. Aborting.\n",
			ptr, (unsigned long)size);
	}
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2480
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x10d45
cmpq $0x0, -0x10(%rbp)
je 0x10d45
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x1652(%rip), %rdi      # 0x12390
movb $0x0, %al
callq 0x10bd0
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/xalloc.c
// Function: assert_alloc
void *assert_alloc(void *ptr)
{
	if (!ptr) {
		print_default_oom_message();
		abort();
	}
	return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x10d6d
callq 0x10d80
callq 0x20c0
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/kaiserschmarrn0[P]mywm/mywm.c
// Function: close_helper
void close_helper(xcb_window_t win) {
	xcb_icccm_get_wm_protocols_reply_t pro;
	xcb_get_property_cookie_t cookie;
	cookie = xcb_icccm_get_wm_protocols_unchecked(conn, win, ewmh->WM_PROTOCOLS);
	if (!xcb_icccm_get_wm_protocols_reply(conn, cookie, &pro, NULL)) {
		xcb_kill_client(conn, win);
		return;
	}

	for (int i = 0; i < pro.atoms_len; i++) {
		if (pro.atoms[i] == wm_atoms[WM_DELETE_WINDOW]) {
			xcb_icccm_get_wm_protocols_reply_wipe(&pro);
			goto a;
		}
	}
	xcb_icccm_get_wm_protocols_reply_wipe(&pro);
	xcb_kill_client(conn, win);
	return;

	a:;
	
	xcb_client_message_event_t ev;
	ev.response_type = XCB_CLIENT_MESSAGE;
	ev.format = 32;
	ev.sequence = 0;
	ev.window = win;
	ev.type = wm_atoms[WM_PROTOCOLS];
	ev.data.data32[0] = wm_atoms[WM_DELETE_WINDOW];
	ev.data.data32[1] = XCB_CURRENT_TIME;
	uint32_t mask = XCB_EVENT_MASK_NO_EVENT;
	xcb_send_event(conn, 0, win, mask, (char *)&ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq 0xccb6(%rip), %rdi      # 0x10448
movl -0x4(%rbp), %esi
movq 0xccbc(%rip), %rax      # 0x10458
movl 0xc8(%rax), %edx
callq 0x31c0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movq 0xcc91(%rip), %rdi      # 0x10448
movl -0x24(%rbp), %esi
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x31a0
cmpb $0x0, %al
jne 0x37e2
movq 0xcc76(%rip), %rdi      # 0x10448
movl -0x4(%rbp), %esi
callq 0x3610
movl %eax, -0x2c(%rbp)
jmp 0x3888
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x381c
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl 0xcc62(%rip), %eax      # 0x10464
jne 0x380f
leaq -0x20(%rbp), %rdi
callq 0x3410
jmp 0x3839
jmp 0x3811
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x37e9
leaq -0x20(%rbp), %rdi
callq 0x3410
movq 0xcc1c(%rip), %rdi      # 0x10448
movl -0x4(%rbp), %esi
callq 0x3610
movl %eax, -0x34(%rbp)
jmp 0x3888
movb $0x21, -0x54(%rbp)
movb $0x20, -0x53(%rbp)
movw $0x0, -0x52(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl 0xcc0d(%rip), %eax      # 0x10460
movl %eax, -0x4c(%rbp)
movl 0xcc08(%rip), %eax      # 0x10464
movl %eax, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x58(%rbp)
movq 0xcbd4(%rip), %rdi      # 0x10448
movl -0x4(%rbp), %edx
movl -0x58(%rbp), %ecx
xorl %esi, %esi
leaq -0x54(%rbp), %r8
callq 0x3340
movl %eax, -0x5c(%rbp)
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/kaiserschmarrn0[P]mywm/mywm.c
// Function: enter_notify
void enter_notify(xcb_generic_event_t *ev) {
	xcb_enter_notify_event_t *e = (xcb_enter_notify_event_t *)ev;

	window *found = search_ws(curws, TYPE_NORMAL, WIN_PARENT, e->event);
	if (state != RESIZE && found && found->normal && found != stack[curws].fwin && state != MOVE) {
		focus(found);
		return;
	}
	
	search_data data = search_range(curws, TYPE_NORMAL, WIN_COUNT, REGION_COUNT, e->event);
	if (data.win) {
		draw_region(data.win, data.index, PM_HOVER);
		return;
	}

	margin_enter_handler(ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xd1c5(%rip), %rax      # 0x10a70
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movl $0x1, %edx
movl %edx, %esi
callq 0x8720
movq %rax, -0x18(%rbp)
cmpl $0x2, 0xcb79(%rip)      # 0x10444
je 0x3917
cmpq $0x0, -0x18(%rbp)
je 0x3917
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc0(%rax)
je 0x3917
movq -0x18(%rbp), %rax
leaq 0xd184(%rip), %rcx      # 0x10a70
movslq (%rcx), %rdx
leaq 0xd03a(%rip), %rcx      # 0x10930
imulq $0x50, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x48(%rcx), %rax
je 0x3917
cmpl $0x1, 0xcb3a(%rip)      # 0x10444
je 0x3917
movq -0x18(%rbp), %rdi
callq 0x5f60
jmp 0x3966
leaq 0xd152(%rip), %rax      # 0x10a70
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x8680
movq %rax, -0x28(%rbp)
movl %edx, -0x20(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x395d
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %esi
movl $0x1, %edx
callq 0x69e0
jmp 0x3966
movq -0x8(%rbp), %rdi
callq 0xaed0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/kaiserschmarrn0[P]mywm/mywm.c
// Function: leave_notify
void leave_notify(xcb_generic_event_t *ev) {
	xcb_leave_notify_event_t *e = (xcb_leave_notify_event_t *)ev;

	//printf("left %d, mode: %d, detail: %d, state: %d\n", e->event, e->mode, e->detail, e->state);

	search_data data = search_range(curws, TYPE_NORMAL, WIN_COUNT, REGION_COUNT, e->event);
	if (data.win && e->mode == XCB_NOTIFY_MODE_NORMAL) {
		if (state == PRESS) {
			region_abort();
		}

		draw_region(data.win, data.index, PM_FOCUS);

		return;
	}

	margin_leave_handler(ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xd0e5(%rip), %rax      # 0x10a70
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x8680
movq %rax, -0x20(%rbp)
movl %edx, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x39e4
movq -0x10(%rbp), %rax
movzbl 0x1e(%rax), %eax
cmpl $0x0, %eax
jne 0x39e4
cmpl $0x4, 0xca79(%rip)      # 0x10444
jne 0x39d4
movb $0x0, %al
callq 0x91b0
movq -0x20(%rbp), %rdi
movl -0x18(%rbp), %esi
xorl %edx, %edx
callq 0x69e0
jmp 0x39ed
movq -0x8(%rbp), %rdi
callq 0xaf30
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)