LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/execution.c
// Function: get_wait_time
void			get_wait_time(t_process **p)
{
	int	op_code;
	int	i;

	i = 0;
	op_code = (*p)->pc[0];
	(*p)->op_code = op_code;
	while (g_op_tab[i].name != NULL)
	{
		if (g_op_tab[i].op_code == op_code)
		{
			(*p)->cycles_to_wait = g_op_tab[i].cycles - 1;
			(*p)->op_code = op_code;
		}
		i++;
	}
}

// Assembly:
movq (%rdi), %rax
movq 0x48(%rax), %rcx
movsbl (%rcx), %ecx
movl %ecx, 0x64(%rax)
leaq 0x6cd0(%rip), %rdx      # 0xb120
cmpq $0x0, (%rdx)
je 0x4474
addq $0x10, %rdx
cmpb %cl, (%rdx)
jne 0x4469
movl 0x4(%rdx), %esi
decl %esi
movl %esi, 0x54(%rax)
movl %ecx, 0x64(%rax)
cmpq $0x0, 0x18(%rdx)
leaq 0x28(%rdx), %rdx
jne 0x445a
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/execution.c
// Function: start_fight
void			start_fight(t_arena *arena)
{
	int		lives;

	while (arena->processes != NULL && update_display(arena))
	{
		execute_processes(arena);
		if (arena->cycle >= arena->last_check_cycle + arena->cycle_to_die)
		{
			lives = count_lives(arena);
			check_processes(arena);
			arena->last_check_cycle = arena->cycle;
			arena->checks_without_decrement++;
			if (arena->checks_without_decrement >= MAX_CHECKS
					|| lives >= NBR_LIVE)
			{
				arena->cycle_to_die -= CYCLE_DELTA;
				arena->checks_without_decrement = 0;
			}
		}
		if (arena->cycle == arena->dump_cycle)
		{
			dump_memory(arena);
			break ;
		}
		arena->cycle++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpq $0x0, 0x28(%rdi)
je 0x4588
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
callq 0x48da
testl %eax, %eax
je 0x4588
movq 0x28(%rbx), %r15
movq %r15, 0x8(%rsp)
testq %r15, %r15
je 0x44ff
movl 0x54(%r15), %eax
testl %eax, %eax
jns 0x44c8
movq %r14, %rdi
callq 0x443c
movl 0x54(%r15), %eax
testl %eax, %eax
jg 0x44f3
movq 0x48(%r15), %r12
movq %r15, %rdi
callq 0x2eea
movslq %eax, %rdi
addq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x231c
movq %rax, 0x48(%r15)
movl 0x54(%r15), %eax
decl %eax
movl %eax, 0x54(%r15)
movq 0x70(%r15), %r15
jmp 0x44aa
movl 0x10(%rbx), %eax
movl 0x14(%rbx), %ecx
addl 0x18(%rbx), %ecx
cmpl %ecx, %eax
jl 0x4573
movq 0x28(%rbx), %rdi
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x4552
movq %rdi, %rax
addl 0x60(%rax), %r15d
movq 0x70(%rax), %rax
testq %rax, %rax
jne 0x451b
movq 0x70(%rdi), %r12
cmpl $0x0, 0x58(%rdi)
je 0x453a
movl %ebp, 0x60(%rdi)
movl %ebp, 0x58(%rdi)
jmp 0x453f
callq 0x282f
movq %r12, %rdi
testq %r12, %r12
jne 0x4528
movl 0x10(%rbx), %eax
cmpl $0x15, %r15d
setge %r15b
movl %eax, 0x18(%rbx)
movl 0x1c(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x1c(%rbx)
cmpl $0x8, %ecx
jg 0x4568
testb %r15b, %r15b
je 0x4573
addl $-0x32, 0x14(%rbx)
movl $0x0, 0x1c(%rbx)
cmpl 0x20(%rbx), %eax
je 0x4595
incl %eax
movl %eax, 0x10(%rbx)
cmpq $0x0, 0x28(%rbx)
jne 0x4496
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x241e
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/read_write.c
// Function: wm
int			wm(long long n, void *dst, size_t l, t_process *p)
{
	size_t	i;
	char	*dest;
	t_arena	*a;

	if (l == 0)
		return (0);
	dest = (char *)(dst + l - 1);
	a = p->arena;
	i = 0;
	while (i < l)
	{
		if (dest >= a->memory + MEM_SIZE)
			dest -= MEM_SIZE;
		else if (dest < a->memory)
			dest += MEM_SIZE;
		if (a->display != NULL)
			save_for_display(p, (int)(dest - a->memory));
		*dest-- = (n & 0xFF);
		n >>= 8;
		i++;
	}
	return (i);
}

// Assembly:
testq %rdx, %rdx
je 0x4665
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
addq %rdx, %r15
movq 0x68(%rcx), %rbp
movq %rdx, (%rsp)
movq %rdx, %rbx
leaq -0x1(%r15), %rcx
movq (%rbp), %rax
leaq 0x1000(%rax), %rdx
leaq -0x1001(%r15), %rsi
addq $0xfff, %r15            # imm = 0xFFF
cmpq %rax, %rcx
cmovaeq %rcx, %r15
cmpq %rdx, %rcx
cmovaeq %rsi, %r15
cmpq $0x0, 0x30(%rbp)
je 0x4646
movq %r15, %r13
subq %rax, %r13
cmpl $0xfff, %r13d           # imm = 0xFFF
ja 0x4646
movq 0x68(%r14), %rsi
movl %r13d, %edi
callq 0x4dac
testq %rax, %rax
je 0x4646
movb (%r14), %cl
movb %cl, (%rax)
movb $0x8, 0x1(%rax)
movq 0x68(%r14), %rax
movq 0x30(%rax), %rax
andl $0xfff, %r13d           # imm = 0xFFF
movb %cl, 0x38(%rax,%r13)
movb %r12b, (%r15)
sarq $0x8, %r12
decq %rbx
jne 0x45d7
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/read_write.c
// Function: rm
long long	rm(char *src, size_t length, t_process *p)
{
	long long		n;
	long long		power;
	unsigned char	*ptr;

	n = 0;
	power = 1;
	ptr = (unsigned char *)src + (length - 1);
	while (length > 0)
	{
		if (ptr >= (unsigned char *)p->arena->memory + MEM_SIZE)
			ptr -= MEM_SIZE;
		else if (ptr < (unsigned char *)p->arena->memory)
			ptr += MEM_SIZE;
		n += ((long long)ptr[0]) * power;
		power <<= 8;
		length--;
		ptr--;
	}
	if ((n & (power >> 1)) != 0)
		while (power != 0x0)
		{
			n |= power;
			power <<= 1;
		}
	return (n);
}

// Assembly:
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x46da
addq %rsi, %rdi
movq 0x68(%rdx), %rax
movq (%rax), %rdx
leaq 0x1000(%rdx), %r8
movl $0x1, %ecx
xorl %eax, %eax
movl $0xfff, %r9d            # imm = 0xFFF
movq $-0x1001, %r10          # imm = 0xEFFF
leaq -0x1(%rdi), %r11
leaq (%rdi,%r9), %rbx
cmpq %rdx, %r11
movl $0x0, %r14d
adcq $-0x1, %r14
cmpq %rdx, %r11
cmovaeq %r11, %rbx
orq %r9, %r14
cmpq %r8, %r11
cmovaeq %r10, %r14
movzbl (%rdi,%r14), %r11d
leaq (%rdi,%r10), %rdi
cmovbq %rbx, %rdi
imulq %rcx, %r11
addq %r11, %rax
shlq $0x8, %rcx
decq %rsi
jne 0x4695
jmp 0x46e1
movl $0x1, %ecx
xorl %eax, %eax
movq %rcx, %rdx
sarq %rdx
testq %rax, %rdx
je 0x46f4
orq %rcx, %rax
addq %rcx, %rcx
jne 0x46ec
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/check_player.c
// Function: check_player
void	check_player(char *argv)
{
	int		i;

	i = 0;
	if (argv == NULL)
	{
		ft_putendl_fd("Error: Positive number expected after -n.", 2);
		exit(1);
	}
	while (argv[i])
	{
		if (!(argv[i] >= '0' && argv[i] <= '9'))
		{
			ft_putendl_fd("Error: Positive number expected after -n.", 2);
			exit(1);
		}
		i++;
	}
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x4718
movb (%rdi), %al
testb %al, %al
je 0x4716
incq %rdi
addb $-0x30, %al
cmpb $0xa, %al
jae 0x4718
movb (%rdi), %al
incq %rdi
testb %al, %al
jne 0x4707
popq %rax
retq
leaq 0x2d94(%rip), %rdi      # 0x74b3
movl $0x2, %esi
callq 0x5404
movl $0x1, %edi
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/check_player.c
// Function: check_display_and_n_flags
void	check_display_and_n_flags(char **argv)
{
	while (*++argv)
	{
		if (ft_strcmp("-n", *argv) == 0)
		{
			ft_putendl_fd("Flag -n cannot be used with flag -v", 2);
			exit(0);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rbx
leaq 0x2961(%rip), %r14      # 0x70a6
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x4775
movq %r14, %rdi
callq 0x52f0
addq $0x8, %rbx
testl %eax, %eax
jne 0x4745
leaq 0x2d79(%rip), %rdi      # 0x74dd
movl $0x2, %esi
callq 0x5404
xorl %edi, %edi
callq 0x21e0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display.c
// Function: init_display
void		init_display(t_arena *arena)
{
	initscr();
	start_color();
	cbreak();
	noecho();
	curs_set(0);
	init_color(COLOR_WHITE, 400, 400, 400);
	init_pair(0, COLOR_WHITE, COLOR_BLACK);
	init_colors(arena->players);
	arena->display = (t_display *)ft_memalloc(sizeof(t_display));
	arena->display->updates = NULL;
	arena->display->running = 0;
	arena->display->quitting = 0;
	arena->display->cps = 50;
	init_mem_display(arena);
	attribute_src_code(arena);
	init_info_display(arena);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20b0
callq 0x20f0
callq 0x2160
callq 0x20a0
xorl %edi, %edi
callq 0x2060
movl $0x7, %edi
movl $0x190, %esi            # imm = 0x190
movl $0x190, %edx            # imm = 0x190
movl $0x190, %ecx            # imm = 0x190
callq 0x21a0
xorl %edi, %edi
movl $0x7, %esi
xorl %edx, %edx
callq 0x2170
movq 0x8(%rbx), %rdi
callq 0x514e
movl $0x1038, %edi           # imm = 0x1038
callq 0x539c
movq %rax, 0x30(%rbx)
movq $0x0, (%rax)
movabsq $0x3200000000, %rcx     # imm = 0x3200000000
movq %rcx, 0x8(%rax)
movl $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x4e53
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x48c4
leaq 0x2881(%rip), %r14      # 0x70a0
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
movl (%r15), %eax
leal (%rax,%rax,4), %eax
shll $0x9, %eax
addl $0x600, %eax            # imm = 0x600
movzwl %ax, %esi
xorl %edx, %edx
callq 0x2110
cmpl $0x0, 0x20(%r15)
je 0x4897
movl 0x28(%r15), %eax
subl (%rbx), %eax
movl %eax, %r12d
xorl %r13d, %r13d
movq (%rbx), %rax
movq 0x30(%rbx), %rcx
movq 0x28(%rcx), %rdi
leal (%r12,%r13), %ebp
movl %ebp, %esi
shrl $0x6, %esi
movl %ebp, %ecx
andl $0x3f, %ecx
leal (%rcx,%rcx,2), %edx
addl $0x9, %edx
movzbl (%rax,%rbp), %r8d
movq %r14, %rcx
xorl %eax, %eax
callq 0x20d0
movb (%r15), %al
movq 0x30(%rbx), %rcx
incq %r13
movb %al, 0x38(%rcx,%rbp)
movl 0x20(%r15), %eax
cmpq %rax, %r13
jb 0x4852
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
movl (%r15), %eax
leal (%rax,%rax,4), %eax
shll $0x9, %eax
addl $0x600, %eax            # imm = 0x600
movzwl %ax, %esi
xorl %edx, %edx
callq 0x2210
movq 0x38(%r15), %r15
testq %r15, %r15
jne 0x481f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x49a8
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display.c
// Function: update_display
int			update_display(t_arena *arena)
{
	if (arena->display == NULL)
		return (1);
	highlight_rw(arena);
	highlight_pcs(arena);
	overwrite(arena->display->w_bkp, arena->display->w_mem);
	overlay(arena->display->w_pcs, arena->display->w_mem);
	wrefresh(arena->display->w_mem);
	regulate_speed(arena);
	return (!arena->display->quitting);
}

// Assembly:
cmpq $0x0, 0x30(%rdi)
je 0x4938
pushq %rbx
movq %rdi, %rbx
callq 0x4ff3
movq %rbx, %rdi
callq 0x4f2a
movq 0x30(%rbx), %rax
movq 0x18(%rax), %rsi
movq 0x28(%rax), %rdi
callq 0x2140
movq 0x30(%rbx), %rax
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdi
callq 0x2190
movq 0x30(%rbx), %rax
movq 0x18(%rax), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x4c60
movq 0x30(%rbx), %rcx
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
sete %al
popq %rbx
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display.c
// Function: destroy_display
void		destroy_display(t_arena *arena)
{
	delwin(arena->display->w_mem);
	delwin(arena->display->w_info);
	delwin(arena->display->w_bkp);
	while (arena->display->updates != NULL)
		remove_update_struct(arena->display->updates, arena);
	free(arena->display);
	init_color(COLOR_WHITE, 680, 680, 680);
	endwin();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x18(%rax), %rdi
callq 0x2150
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
callq 0x2150
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
callq 0x2150
movq 0x30(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x497f
movq %rbx, %rsi
callq 0x4e2b
jmp 0x4969
movq %rax, %rdi
callq 0x2040
movl $0x7, %edi
movl $0x2a8, %esi            # imm = 0x2A8
movl $0x2a8, %edx            # imm = 0x2A8
movl $0x2a8, %ecx            # imm = 0x2A8
callq 0x21a0
popq %rbx
jmp 0x2200
nop
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_infos.c
// Function: update_infos
void		update_infos(t_arena *a)
{
	t_player	*player;
	t_process	*p;
	int			line;
	int			i;

	mvwprintw(a->display->w_info, 0, 24, "%-5d (%d processus)",
			a->cycle, count_processes(a));
	mvwprintw(a->display->w_info, 3, 20, "%4d", a->display->cps);
	line = 6;
	player = a->players;
	while (player != NULL)
	{
		i = 0;
		p = a->processes;
		while (p != NULL)
		{
			if (p->player == player->id)
				i++;
			p = p->next;
		}
		mvwprintw(a->display->w_info, line, 20, "%6d", i);
		mvwprintw(a->display->w_info, line + 1, 20, "%6d", player->last_live);
		line += 4;
		player = player->next;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x30(%rax), %r14
movl 0x10(%rdi), %ebp
callq 0x285e
leaq 0x2ad7(%rip), %rcx      # 0x759b
movq %r14, %rdi
xorl %esi, %esi
movl $0x18, %edx
movl %ebp, %r8d
movl %eax, %r9d
xorl %eax, %eax
callq 0x20d0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl 0xc(%rax), %r8d
leaq 0x2a80(%rip), %rcx      # 0x756e
movl $0x3, %esi
movl $0x14, %edx
xorl %eax, %eax
callq 0x20d0
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x4b81
movl $0x6, %ebp
leaq 0x2a83(%rip), %r14      # 0x7597
movq 0x28(%rbx), %rax
movl $0x0, %r8d
testq %rax, %rax
je 0x4b3c
movl (%r15), %ecx
xorl %r8d, %r8d
xorl %edx, %edx
cmpl %ecx, (%rax)
sete %dl
addl %edx, %r8d
movq 0x70(%rax), %rax
testq %rax, %rax
jne 0x4b29
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl %ebp, %esi
movl $0x14, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x20d0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl %ebp, %esi
orl $0x1, %esi
movl 0x30(%r15), %r8d
movl $0x14, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x20d0
addl $0x4, %ebp
movq 0x38(%r15), %r15
testq %r15, %r15
jne 0x4b14
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_infos.c
// Function: check_keystroke
int			check_keystroke(t_arena *a)
{
	char	c;
	int		*cps;

	cps = &(a->display->cps);
	c = wgetch(a->display->w_info);
	if (c == 's')
		return (1);
	else if (c == ' ')
		a->display->running = !a->display->running;
	else if (c == 'j')
		*cps += (*cps < 1000) ? 10 : 1000 - *cps;
	else if (c == 'k')
		*cps -= (*cps >= 11) ? 10 : *cps - 1;
	else if (c == 'l')
		*cps += (*cps < 1000) ? 1 : 0;
	else if (c == ';')
		*cps -= (*cps > 1) ? 1 : 0;
	else if (c == 'q')
		a->display->quitting = 1;
	update_infos(a);
	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %r14
movq 0x30(%r14), %rdi
callq 0x2080
movzbl %al, %eax
leal -0x6a(%rax), %ecx
cmpl $0x9, %ecx
ja 0x4bdc
leaq 0x2952(%rip), %rax      # 0x7504
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl 0xc(%r14), %eax
leal -0x3e8(%rax), %ecx
negl %ecx
cmpl $0x3e8, %eax            # imm = 0x3E8
movl $0xa, %edx
cmovgel %ecx, %edx
addl %eax, %edx
movl %edx, 0xc(%r14)
jmp 0x4c4e
cmpl $0x3b, %eax
je 0x4c3c
cmpl $0x20, %eax
jne 0x4c4e
movq 0x30(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x0, 0x8(%rax)
sete %cl
movl %ecx, 0x8(%rax)
jmp 0x4c4e
movl 0xc(%r14), %eax
leal -0x1(%rax), %ecx
cmpl $0xb, %eax
movl $0xa, %edx
cmovll %ecx, %edx
subl %edx, %eax
movl %eax, 0xc(%r14)
jmp 0x4c4e
movl 0xc(%r14), %eax
xorl %ecx, %ecx
cmpl $0x3e8, %eax            # imm = 0x3E8
setl %cl
addl %eax, %ecx
movl %ecx, 0xc(%r14)
jmp 0x4c4e
movq 0x30(%rbx), %rax
movl $0x1, 0x10(%rax)
jmp 0x4c4e
movl $0x1, %eax
jmp 0x4c58
movl 0xc(%r14), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
setge %cl
subl %ecx, %eax
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x4aa3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_infos.c
// Function: regulate_speed
void		regulate_speed(t_arena *a)
{
	static clock_t	last_release = 0;
	clock_t			now;

	while (1)
	{
		if (check_keystroke(a))
			break ;
		now = clock();
		if ((a->display->running == 1
					&& now >= last_release + CLOCKS_PER_SEC / a->display->cps)
				|| a->display->quitting)
			break ;
	}
	last_release = now;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4b8c
testl %eax, %eax
jne 0x4caa
callq 0x2090
movq %rax, %r14
movq 0x30(%rbx), %rcx
cmpl $0x1, 0x8(%rcx)
jne 0x4c9a
movl $0xf4240, %eax          # imm = 0xF4240
xorl %edx, %edx
idivl 0xc(%rcx)
cltq
addq 0x673b(%rip), %rax      # 0xb3d0
cmpq %rax, %r14
jge 0x4caa
cmpl $0x0, 0x10(%rcx)
jne 0x4caa
movq %rbx, %rdi
callq 0x4b8c
jmp 0x4c6c
movq %r14, 0x671f(%rip)      # 0xb3d0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_infos.c
// Function: print_winner_display
void		print_winner_display(t_arena *a)
{
	t_player	*p;
	t_player	*best;

	best = a->players;
	p = a->players;
	while (p != NULL)
	{
		if (p->last_live >= best->last_live)
			best = p;
		p = p->next;
	}
	a->display->running = 0;
	update_infos(a);
	wtimeout(a->display->w_info, -1);
	wprintw(a->display->w_info, "\n\n\nThe fight as ended.\n\n");
	wprintw(a->display->w_info, "The winner is ");
	wattron(a->display->w_info, COLOR_PAIR(best->id));
	wprintw(a->display->w_info, "%s\n\n", best->name);
	wattroff(a->display->w_info, COLOR_PAIR(best->id));
	wprintw(a->display->w_info, "Press any key to exit");
	wgetch(a->display->w_info);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x4ce2
movq %r14, %rax
movl 0x30(%rax), %ecx
cmpl 0x30(%r14), %ecx
cmovgeq %rax, %r14
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x4ccc
jmp 0x4ce5
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movl $0x0, 0x8(%rax)
movq %rbx, %rdi
callq 0x4aa3
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2130
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
leaq 0x2896(%rip), %rsi      # 0x75af
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
leaq 0x2899(%rip), %rsi      # 0x75c8
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl (%r14), %esi
shll $0x8, %esi
movl $0xffff, %ebp           # imm = 0xFFFF
andl %ebp, %esi
xorl %edx, %edx
callq 0x2110
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movq 0x8(%r14), %rdx
leaq 0x2872(%rip), %rsi      # 0x75d7
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
movl (%r14), %esi
shll $0x8, %esi
andl %ebp, %esi
xorl %edx, %edx
callq 0x2210
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
leaq 0x284a(%rip), %rsi      # 0x75dc
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x30(%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2080
nop
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_mem.c
// Function: get_update_struct_of
t_d_update	*get_update_struct_of(int i, t_arena *arena)
{
	t_d_update	*u;
	t_d_update	*previous;

	u = arena->display->updates;
	previous = NULL;
	while (u != NULL && u->index != i)
	{
		previous = u;
		u = u->next;
	}
	if (u != NULL)
		return (u);
	u = (t_d_update *)malloc(sizeof(t_d_update));
	if (u == NULL)
		return (NULL);
	ft_bzero(u, sizeof(t_d_update));
	if (previous == NULL)
		arena->display->updates = u;
	else
		previous->next = u;
	u->index = i;
	return (u);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
movq 0x30(%rsi), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x4dd9
movq %rax, %r12
cmpl %ebx, 0x4(%rax)
je 0x4e06
movq 0x8(%r12), %rax
testq %rax, %rax
jne 0x4dc5
jmp 0x4ddc
xorl %r12d, %r12d
movl $0x10, %edi
callq 0x2180
testq %rax, %rax
je 0x4e0b
movq %rax, %r15
movl $0x10, %esi
movq %rax, %rdi
callq 0x52b0
testq %r12, %r12
je 0x4e10
addq $0x8, %r12
jmp 0x4e14
movq %r12, %r15
jmp 0x4e1c
xorl %r15d, %r15d
jmp 0x4e1c
movq 0x30(%r14), %r12
movq %r15, (%r12)
movl %ebx, 0x4(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_mem.c
// Function: init_mem_display
void		init_mem_display(t_arena *arena)
{
	int	i;

	arena->display->w_bkp = newwin(MEM_SIZE / 64, 64 * 3 + 10, 0, 0);
	arena->display->w_mem = newwin(MEM_SIZE / 64, 64 * 3 + 10, 0, 0);
	arena->display->w_pcs = newwin(MEM_SIZE / 64, 64 * 3 + 10, 0, 0);
	i = -1;
	while (++i < MEM_SIZE)
	{
		if (i % 64 == 0 && i != MEM_SIZE - 1)
		{
			if (i != 0)
				wprintw(arena->display->w_bkp, "\n");
			wprintw(arena->display->w_bkp, "%0#6x : ", i);
		}
		wprintw(arena->display->w_bkp, "%02x ",
				(unsigned char)arena->memory[i]);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x40, %edi
movl $0xca, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2050
movq 0x30(%rbx), %rcx
movq %rax, 0x28(%rcx)
movl $0x40, %edi
movl $0xca, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2050
movq 0x30(%rbx), %rcx
movq %rax, 0x18(%rcx)
movl $0x40, %edi
movl $0xca, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2050
movq 0x30(%rbx), %rcx
movq %rax, 0x20(%rcx)
leaq 0x21e0(%rip), %r14      # 0x7097
leaq 0x2708(%rip), %r15      # 0x75c6
leaq 0x21db(%rip), %r12      # 0x70a0
xorl %r13d, %r13d
movq 0x30(%rbx), %rax
testb $0x3f, %r13b
jne 0x4efe
testq %r13, %r13
je 0x4ee9
movq 0x28(%rax), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
movq (%rbx), %rax
movzbl (%rax,%r13), %edx
movq %r12, %rsi
xorl %eax, %eax
callq 0x21f0
incq %r13
cmpq $0x1000, %r13           # imm = 0x1000
jne 0x4ec8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_mem.c
// Function: highlight_pcs
int			highlight_pcs(t_arena *arena)
{
	int			p_nbr;
	t_process	*p;

	p_nbr = 0;
	p = arena->processes;
	werase(arena->display->w_pcs);
	while (p != NULL)
	{
		wattron(arena->display->w_pcs, COLOR_PAIR(p->player) | A_BOLD);
		mvwprintw(arena->display->w_pcs,
				(int)(p->pc - arena->memory) / 64,
				((int)(p->pc - arena->memory) % 64) * 3 + 9,
				"%02x", (unsigned char)*(p->pc));
		wattroff(arena->display->w_pcs, COLOR_PAIR(p->player) | A_BOLD);
		p_nbr++;
		p = p->next;
	}
	return (p_nbr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x30(%rdi), %rax
movq 0x20(%rax), %rdi
callq 0x2030
testq %r15, %r15
je 0x4fe0
movl $0xffff, %r12d          # imm = 0xFFFF
movl $0x200000, %r13d        # imm = 0x200000
leaq 0x268d(%rip), %r14      # 0x75f2
xorl %ebp, %ebp
movq 0x30(%rbx), %rax
movq 0x20(%rax), %rdi
movl (%r15), %esi
shll $0x8, %esi
andl %r12d, %esi
orl %r13d, %esi
xorl %edx, %edx
callq 0x2110
movq 0x30(%rbx), %rax
movq 0x20(%rax), %rdi
movq 0x48(%r15), %rax
movl (%rbx), %ecx
movzbl (%rax), %r8d
subl %ecx, %eax
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movl %ecx, %esi
sarl $0x6, %esi
andl $-0x40, %ecx
subl %ecx, %eax
leal (%rax,%rax,2), %edx
addl $0x9, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x20d0
movq 0x30(%rbx), %rax
movq 0x20(%rax), %rdi
movl (%r15), %esi
shll $0x8, %esi
andl %r12d, %esi
orl %r13d, %esi
xorl %edx, %edx
callq 0x2210
incl %ebp
movq 0x70(%r15), %r15
testq %r15, %r15
jne 0x4f67
jmp 0x4fe2
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_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_mem.c
// Function: highlight_rw
void		highlight_rw(t_arena *arena)
{
	t_d_update	*u;
	t_d_update	*next;
	int			pair;

	u = arena->display->updates;
	while (u != NULL)
	{
		next = u->next;
		pair = u->owner * 10 + u->w_turns + MAX_PLAYERS + 1;
		wmove(arena->display->w_bkp, u->index / 64, (u->index % 64) * 3 + 9);
		wattron(arena->display->w_bkp, COLOR_PAIR(pair));
		wprintw(arena->display->w_bkp,
				"%02x", (unsigned char)arena->memory[u->index]);
		wattroff(arena->display->w_bkp, COLOR_PAIR(pair));
		u->w_turns--;
		if (u->w_turns == 0)
			remove_update_struct(u, arena);
		u = next;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x30(%rdi), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x50d8
movq %rdi, %rbx
leaq 0x25dd(%rip), %r15      # 0x75f2
movq 0x8(%r14), %r12
movl (%r14), %eax
movl 0x4(%r14), %ecx
leal (%rax,%rax,4), %eax
movzbl 0x1(%r14), %edx
leal (%rdx,%rax,2), %ebp
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
leal 0x3f(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
movl %eax, %esi
sarl $0x6, %esi
andl $-0x40, %eax
subl %eax, %ecx
leal (%rcx,%rcx,2), %edx
addl $0x9, %edx
callq 0x21d0
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
shll $0x8, %ebp
addl $0x500, %ebp            # imm = 0x500
movzwl %bp, %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x2110
movq (%rbx), %rax
movq 0x30(%rbx), %rcx
movq 0x28(%rcx), %rdi
movslq 0x4(%r14), %rcx
movzbl (%rax,%rcx), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x21f0
movq 0x30(%rbx), %rax
movq 0x28(%rax), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2210
decb 0x1(%r14)
jne 0x50cc
movq 0x30(%rbx), %rcx
movq (%rcx), %rax
cmpq %r14, %rax
je 0x50bd
movq %rax, %rcx
movq 0x8(%rax), %rax
cmpq %r14, %rax
jne 0x50ad
addq $0x8, %rcx
movq 0x8(%rax), %rax
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x2040
movq %r12, %r14
testq %r12, %r12
jne 0x5015
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_color.c
// Function: init_pairs
void		init_pairs(int players)
{
	int		o;
	int		oi;

	o = 0;
	while (++o <= players)
	{
		oi = -1;
		while (++oi < D_WRITE_TURNS + 1)
		{
			init_pair(10 * o + oi + MAX_PLAYERS + 1,
						100 + o * 10 + D_WRITE_TURNS - oi,
						0);
		}
	}
}

// Assembly:
testl %edi, %edi
jle 0x514d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x1, %r12d
movl $0x76, %r14d
movw $0xf, %r15w
movl %r15d, %ebp
xorl %r13d, %r13d
leal (%r14,%r13), %eax
movswl %ax, %esi
movswl %bp, %ebp
movl %ebp, %edi
xorl %edx, %edx
callq 0x2170
decl %r13d
incl %ebp
cmpl $-0x9, %r13d
jne 0x510c
leal 0x1(%r12), %eax
addl $0xa, %r14d
addl $0xa, %r15d
cmpl %ebx, %r12d
movl %eax, %r12d
jne 0x5106
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/src/vm/display_color.c
// Function: init_colors
void		init_colors(t_player *p)
{
	float		i;
	short		r;
	short		g;
	short		b;
	int			c;

	c = 0;
	while (p != NULL)
	{
		color_content(p->id, &r, &g, &b);
		i = 11;
		while (--i > 0)
			init_color(
					100 + p->id * 10 + 9 - i,
					r + (((r + g + b) / 3 - r) + 400) * (i) / 25,
					g + (((r + g + b) / 3 - g) + 800) * (i) / 25,
					b + (((r + g + b) / 3 - b) + 700) * (i) / 25);
		init_pair(p->id, p->id, COLOR_BLACK);
		c++;
		p = p->next;
	}
	init_pairs(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5295
movq %rdi, %r14
xorl %ebx, %ebx
leaq 0x6(%rsp), %r15
leaq 0x4(%rsp), %r12
leaq 0x2(%rsp), %r13
movswl (%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x21c0
movl $0xa, %ebp
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movl (%r14), %eax
leal (%rax,%rax,4), %eax
leal 0x6d(,%rax,2), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
subss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movswl 0x6(%rsp), %edi
xorps %xmm1, %xmm1
cvtsi2ss %edi, %xmm1
movswl 0x4(%rsp), %esi
leal (%rsi,%rdi), %edx
movswl 0x2(%rsp), %ecx
addl %ecx, %edx
movslq %edx, %rdx
imulq $0x55555556, %rdx, %rdx # imm = 0x55555556
movq %rdx, %r8
shrq $0x3f, %r8
shrq $0x20, %rdx
addl %r8d, %edx
movl %edx, %r8d
subl %edi, %r8d
addl $0x190, %r8d            # imm = 0x190
xorps %xmm2, %xmm2
cvtsi2ss %r8d, %xmm2
mulss %xmm0, %xmm2
xorps %xmm3, %xmm3
cvtsi2ss %esi, %xmm3
movss 0x23ed(%rip), %xmm4     # 0x75f8
divss %xmm4, %xmm2
addss %xmm1, %xmm2
movl %edx, %edi
subl %esi, %edi
addl $0x320, %edi            # imm = 0x320
xorps %xmm1, %xmm1
cvtsi2ss %edi, %xmm1
cvttss2si %xmm2, %esi
mulss %xmm0, %xmm1
divss %xmm4, %xmm1
addss %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %ecx, %xmm2
cvttss2si %xmm1, %edi
subl %ecx, %edx
addl $0x2bc, %edx            # imm = 0x2BC
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
mulss %xmm0, %xmm1
divss %xmm4, %xmm1
addss %xmm2, %xmm1
cvttss2si %xmm1, %ecx
movswl %si, %esi
movswl %di, %edx
movswl %cx, %ecx
movswl %ax, %edi
callq 0x21a0
decl %ebp
jne 0x518d
movswl (%r14), %edi
movl %edi, %esi
xorl %edx, %edx
callq 0x2170
incl %ebx
movq 0x38(%r14), %r14
testq %r14, %r14
jne 0x5176
jmp 0x5297
xorl %ebx, %ebx
movl %ebx, %edi
callq 0x50e4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/libft/printf/ft_printf_fd.c
// Function: ft_printf_fd
int			ft_printf_fd(int fd, const char *format, ...)
{
	va_list args;
	int		count;
	int		error;

	va_start(args, format);
	error = replace_conversion((char **)&format, args);
	if (error)
		count = -1;
	else
		count = ft_strlen(format);
	ft_putstr_spec_fd((char *)format, fd);
	free((void*)format);
	va_end(args);
	return (count);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edi, 0x4(%rsp)
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x568c
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rdi, 0x20(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, 0x10(%rsp)
movq %rsi, %rdi
callq 0x58c4
movq %rax, %r14
xorl %eax, %eax
movabsq $0x100000000, %rdx      # imm = 0x100000000
xorl %ecx, %ecx
movzbl (%r14,%rcx), %esi
testl %esi, %esi
je 0x56dc
cmpl $0x25, %esi
je 0x56dc
incq %rcx
addq %rdx, %rax
jmp 0x56c6
movl %ecx, (%rsp)
sarq $0x20, %rax
cmpb $0x0, (%r14,%rax)
je 0x578e
movq %r14, %rdi
addq %rax, %rdi
leaq 0x10(%rsp), %r15
movq %rsp, %r12
leaq 0x8(%rsp), %r13
movq %rdi, 0x8(%rsp)
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x57dc
testq %rax, %rax
je 0x57a1
movq %rax, %rbp
movq %r14, %rdi
movq %rax, %rsi
callq 0x5910
movq %rax, %rbx
movq %rbp, %rdi
callq 0x2040
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5910
movq %rax, %rbp
movq %r14, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movslq (%rsp), %rax
movq %rax, %rcx
addq %rbp, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x5773
cmpl $0x25, %edx
je 0x5773
incl %eax
incq %rcx
jmp 0x5760
movl %eax, (%rsp)
cltq
movq %rbp, %rdi
addq %rax, %rdi
cmpb $0x0, (%rbp,%rax)
movq %rbp, %r14
jne 0x5701
jmp 0x5791
movq %r14, %rbp
movq %rbp, %rdi
callq 0x58a8
movq %rax, %r15
movq %rbp, %r14
jmp 0x57b0
movslq (%rsp), %rax
movb $0x0, (%r14,%rax)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x5a1c
movq %r14, %rdi
callq 0x2040
movl %r15d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/cosy/cosy.c
// Function: compressCard
int compressCard(
  FILE *dest
)
{
  int i, spcount = 0, len = strlen(card);

  for (i = 0; i < len; i++) {
    if (!VALID(card[i]))
      return 4;

    if (card[i] != ' ') {
      if (spcount != 0) {
        size_t l = strlen(compr[spcount]);

        if (fwrite(compr[spcount], sizeof(char), l, dest) != l)
          return 3;
        outcount += l;
        spcount = 0;
      }
      if (fputc(card[i], dest) == EOF)
        return 3;
      outcount++;
    } else {
      if (++spcount == MAXSPACES) {
        size_t l = strlen(compr[spcount]);

        if (fwrite(compr[spcount], sizeof(char), l, dest) != l)
          return 3;
        outcount += l;
        spcount = 0;
      }
    }
  }
  /*
   * Terminate the card image.
   */
  fwrite("\x5F\x5E", sizeof(char), 2, dest);
  outcount += 2;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x305f(%rip), %r14      # 0x42d0
movq %r14, %rdi
callq 0x1070
movq %rax, %r15
testl %r15d, %r15d
jle 0x1367
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
xorl %ecx, %ecx
movb (%rbp,%r14), %dl
movl $0x4, %eax
cmpb $0x26, %dl
je 0x1390
leal -0x5f(%rdx), %esi
cmpb $-0x3f, %sil
jb 0x1390
cmpb $0x20, %dl
jne 0x12f7
incl %ecx
cmpl $0x3e, %ecx
jne 0x135b
movq 0x2fd9(%rip), %r13      # 0x42a0
movq %r13, %rdi
callq 0x1070
movq %rax, %r12
movl $0x1, %esi
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x1110
cmpq %r12, %rax
jne 0x138b
addl 0x2fcf(%rip), %r12d     # 0x42c4
jmp 0x1352
testl %ecx, %ecx
je 0x1338
movslq %ecx, %rax
leaq 0x2dab(%rip), %rcx      # 0x40b0
movq (%rcx,%rax,8), %r13
movq %r13, %rdi
callq 0x1070
movq %rax, %r12
movl $0x1, %esi
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x1110
cmpq %r12, %rax
jne 0x138b
addl %r12d, 0x2f91(%rip)     # 0x42c4
movb (%rbp,%r14), %dl
movsbl %dl, %edi
movq %rbx, %rsi
callq 0x10a0
cmpl $-0x1, %eax
je 0x138b
movl 0x2f75(%rip), %r12d     # 0x42c4
incl %r12d
movl %r12d, 0x2f6b(%rip)     # 0x42c4
xorl %ecx, %ecx
incq %rbp
cmpq %rbp, %r15
jne 0x1290
leaq 0xd65(%rip), %rdi       # 0x20d3
movl $0x1, %esi
movl $0x2, %edx
movq %rbx, %rcx
callq 0x1110
addl $0x2, 0x2f3d(%rip)      # 0x42c4
xorl %eax, %eax
jmp 0x1390
movl $0x3, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/cosy/cosy.c
// Function: decompressCard
int decompressCard(
  FILE *src
)
{
  int ch, i, spcount;

  idx = 0;

  while ((ch = fgetc(src)) != -1) {
    if (ch == 0)
      continue;

    if (ch == PREFIX) {
      if ((ch = fgetc(src)) == -1)
        break;

      switch (ch) {
        case 0x21: case 0x22: case 0x23: case 0x24: case 0x25:
          spcount = ch - 0x21 + 3;
          goto fill;

        case 0x27: case 0x28: case 0x29: case 0x2A: case 0x2B:
        case 0x2C: case 0x2D: case 0x2E: case 0x2F: case 0x30:
        case 0x31: case 0x32: case 0x33: case 0x34: case 0x35:
        case 0x36: case 0x37: case 0x38: case 0x39: case 0x3A:
        case 0x3B: case 0x3C: case 0x3D: case 0x3E: case 0x3F:
        case 0x40: case 0x41: case 0x42: case 0x43: case 0x44:
        case 0x45: case 0x46: case 0x47: case 0x48: case 0x49:
        case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E:
        case 0x4F: case 0x50: case 0x51: case 0x52: case 0x53:
        case 0x54: case 0x55: case 0x56: case 0x57: case 0x58:
        case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D:
          spcount = ch - 0x27 + 8;
      fill:
          for (i = 0; i< spcount; i++) {
            if (idx != CARDLEN)
              card[idx++] = ' ';
          }
          break;

        case 0x5E:
          card[idx] = '\0';
          return 0;

        case 0x5F:
          card[idx] = '\0';
          return -2;
      }
    } else {
      if (idx != CARDLEN)
        card[idx++] = ch;
    }
  }
  card[idx] = '\0';
  return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, 0x2f10(%rip)      # 0x42c0
leaq 0x2f19(%rip), %r14      # 0x42d0
movq %rbx, %rdi
callq 0x1090
testl %eax, %eax
je 0x13b7
cmpl $0x5f, %eax
je 0x13ed
cmpl $-0x1, %eax
je 0x1461
movslq 0x2ee8(%rip), %rcx      # 0x42c0
cmpq $0x50, %rcx
je 0x13b7
leal 0x1(%rcx), %edx
movl %edx, 0x2ed9(%rip)      # 0x42c0
movb %al, (%rcx,%r14)
jmp 0x13b7
movq %rbx, %rdi
callq 0x1090
leal -0x27(%rax), %ecx
cmpl $0x37, %ecx
jae 0x142d
movl $0xffffffe1, %ecx       # imm = 0xFFFFFFE1
addl %ecx, %eax
movl 0x2eb6(%rip), %ecx      # 0x42c0
movl $0x50, %edx
cmpl $0x50, %ecx
je 0x1425
leal 0x1(%rcx), %edx
movl %edx, 0x2ea3(%rip)      # 0x42c0
movslq %ecx, %rcx
movb $0x20, (%rcx,%r14)
movl %edx, %ecx
decl %eax
jne 0x140a
jmp 0x13b7
cmpl $0x5d, %eax
jg 0x144a
movl $0xffffffe2, %ecx       # imm = 0xFFFFFFE2
leal -0x21(%rax), %edx
cmpl $0x5, %edx
jb 0x1402
cmpl $-0x1, %eax
jne 0x13b7
jmp 0x1461
cmpl $0x5e, %eax
je 0x145f
cmpl $0x5f, %eax
jne 0x13b7
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x1461
xorl %eax, %eax
movslq 0x2e58(%rip), %rcx      # 0x42c0
movb $0x0, (%rcx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/cosy/cosy.c
// Function: writeCard
int writeCard(
  FILE *dest
)
{
  /*
   * Remove trailing spaces.
   */
  while (idx && (card[idx - 1] == ' '))
    card[--idx] = '\0';

  if (fprintf(dest, "%s\n", card) < 0)
    return -1;
  return 0;
}

// Assembly:
movslq 0x2e44(%rip), %rax      # 0x42c0
testq %rax, %rax
je 0x14a7
leal -0x1(%rax), %ecx
leaq 0x2e45(%rip), %rdx      # 0x42d0
cmpb $0x20, -0x1(%rax,%rdx)
jne 0x14a7
movl %ecx, 0x2e28(%rip)      # 0x42c0
movb $0x0, -0x1(%rax,%rdx)
decq %rax
decl %ecx
testq %rax, %rax
jne 0x148b
pushq %rax
leaq 0xcf3(%rip), %rsi       # 0x21a2
leaq 0x2e1a(%rip), %rdx      # 0x42d0
xorl %eax, %eax
callq 0x10c0
sarl $0x1f, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/cosy/cosy.c
// Function: usage
void usage(void)
{
  fprintf(stderr,
          "Usage: cosy [-cd] <cosyfile> [file ...]\n");
  fprintf(stderr,
          "   Compress/decompress a COSY file\n");
  fprintf(stderr, "\nSwitches:\n\n");
  fprintf(stderr, " -c   Perform COSY compression\n");
  fprintf(stderr, " -d   Perform COSY decompression (the default)\n");
  exit(1);
}

// Assembly:
pushq %rbx
movq 0x2b2e(%rip), %rbx      # 0x3ff8
movq (%rbx), %rcx
leaq 0xc02(%rip), %rdi       # 0x20d6
movl $0x28, %esi
movl $0x1, %edx
callq 0x1110
movq (%rbx), %rcx
leaq 0xc12(%rip), %rdi       # 0x20ff
movl $0x23, %esi
movl $0x1, %edx
callq 0x1110
movq (%rbx), %rcx
leaq 0xc1d(%rip), %rdi       # 0x2123
movl $0xc, %esi
movl $0x1, %edx
callq 0x1110
movq (%rbx), %rcx
leaq 0xc11(%rip), %rdi       # 0x2130
movl $0x1f, %esi
movl $0x1, %edx
callq 0x1110
movq (%rbx), %rcx
leaq 0xc18(%rip), %rdi       # 0x2150
movl $0x2f, %esi
movl $0x1, %edx
callq 0x1110
movl $0x1, %edi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/cosy/cosy.c
// Function: main
int main(
  int argc,
  char *argv[]
)
{
  int ch;
  FILE *cosy;

  while ((ch = getopt(argc, argv, "cd")) != -1) {
    switch (ch) {
      case 'c':
        compress = 1;
        break;

      case 'd':
        compress = 0;
        break;

      default:
        usage();
    }
  }
  argc -= optind;
  argv += optind;

  if (argc < (compress ? 2 : 1))
    usage();

  /*
   * Open the COSY file.
   */
  if ((cosy = fopen(argv[0], compress ? "w" : "r")) == NULL) {
    fprintf(stderr, "Failed to open COSY file - %s\n", argv[0]);
    return 2;
  }
  argc--, argv++;

  if (compress) {
    return doCompress(cosy, argc, argv);
  }
  return doDecompress(cosy);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
leaq 0xc1e(%rip), %r15       # 0x2180
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x10e0
movl $0x1, %ecx
cmpl $0x63, %eax
je 0x1580
cmpl $0x64, %eax
jne 0x1588
xorl %ecx, %ecx
movl %ecx, 0x2d42(%rip)      # 0x42c8
jmp 0x1562
cmpl $-0x1, %eax
jne 0x1618
movq 0x2a40(%rip), %rax      # 0x3fd8
movslq (%rax), %rax
subl %eax, %ebx
movl 0x2d25(%rip), %ecx      # 0x42c8
cmpl $0x1, %ecx
movl $0x2, %edx
sbbl $0x0, %edx
cmpl %edx, %ebx
jl 0x1618
leaq (%r14,%rax,8), %r14
testl %ecx, %ecx
movq (%r14), %rdi
leaq 0xbc3(%rip), %rax       # 0x2185
leaq 0xbba(%rip), %rsi       # 0x2183
cmoveq %rax, %rsi
callq 0x10d0
testq %rax, %rax
je 0x1605
cmpl $0x0, 0x2cea(%rip)      # 0x42c8
je 0x15f8
addq $0x8, %r14
decl %ebx
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x161d
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x182b
movq %r14, %rdi
callq 0x1130
movl $0x2, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x14c2
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: xmalloc
SOLOCAL void *xmalloc(size_t size)
{
    void *m = malloc(size);
    if (!m)
    {
        logmsg(L_FATAL, "memory allocation failed.");
        abort();
    }
    return m;
}

// Assembly:
pushq %rax
callq 0x54c0
testq %rax, %rax
je 0x5869
popq %rcx
retq
leaq 0x93b2(%rip), %rsi      # 0xec22
xorl %edi, %edi
callq 0x591c
callq 0x50a0
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: xrealloc
SOLOCAL void *xrealloc(void *ptr, size_t size)
{
    void *m = realloc(ptr, size);
    if (!m)
    {
        logmsg(L_FATAL, "memory allocation failed.");
        abort();
    }
    return m;
}

// Assembly:
pushq %rax
callq 0x5590
testq %rax, %rax
je 0x5889
popq %rcx
retq
leaq 0x9392(%rip), %rsi      # 0xec22
xorl %edi, %edi
callq 0x591c
callq 0x50a0
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: upperstr
SOLOCAL char *upperstr(const char *src)
{
    if (!src) return 0;
    char *upper = xmalloc(strlen(src) +1);
    const char *r = src;
    char *w = upper;
    while (*r)
    {
	*w++ = toupper(*r++);
    }
    *w = 0;
    return upper;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x5911
movq %rdi, %rbx
callq 0x5250
leaq 0x1(%rax), %rdi
callq 0x585c
movq %rax, %r14
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x590c
callq 0x5050
movq (%rax), %rcx
incq %rbx
movq %r14, %rax
movsbq %bpl, %rdx
movb (%rcx,%rdx,4), %dl
movb %dl, (%rax)
incq %rax
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x58f5
movb $0x0, (%rax)
jmp 0x5914
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/log.c
// Function: logfmt
SOLOCAL void logfmt(LogLevel level, const char *format, ...)
{
    if (logsilent && level > L_ERROR) return;
    if (level > maxlevel) return;
    char buf[8192];
    va_list ap;
    va_start(ap, format);
    vsnprintf(buf, 8192, format, ap);
    va_end(ap);
    logmsg(level, buf);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
testb %al, %al
je 0x598d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
cmpl $0x0, 0xea40(%rip)      # 0x143e8
setne %al
cmpl $0x2, %edi
setae %cl
testb %al, %cl
jne 0x5a31
movl %edi, %ebx
cmpl %edi, 0xea13(%rip)      # 0x143d0
jb 0x5a31
movq %rsi, %r10
cmpl $0x2, %ebx
setae %bpl
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x20f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
movq %r10, %rdx
callq 0x5160
cmpl $0x0, 0xe9de(%rip)      # 0x143e8
setne %al
testb %al, %bpl
jne 0x5a31
cmpl %ebx, 0xe9b8(%rip)      # 0x143d0
jb 0x5a31
movq 0xe9cf(%rip), %rdx      # 0x143f0
leaq 0xd0(%rsp), %rsi
movl %ebx, %edi
callq *0xe9a7(%rip)           # 0x143d8
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/log.c
// Function: writeFile
static void writeFile(LogLevel level, const char *message, void *data)
{
    FILE *target = data;
    fputs(levels[level], target);
    fputs(message, target);
    fputc('\n', target);
    fflush(target);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %eax
leaq 0x8595(%rip), %rcx      # 0xe000
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq %rdx, %rsi
callq 0x52e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52e0
movl $0xa, %edi
movq %rbx, %rsi
callq 0x53b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x54d0
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/sector.c
// Function: Sector_createAt
SOEXPORT Sector *Sector_createAt(uint8_t tracknum, uint8_t sectornum)
{
    Sector *self = Sector_create();
    Sector_setTrackNum(self, tracknum);
    Sector_setSectorNum(self, sectornum);
    return self;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl $0x102, %edi            # imm = 0x102
callq 0x585c
movq %rax, %r14
leaq 0x2(%rax), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x5320
movb %bpl, (%r14)
movb %bl, 0x1(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_create
SOEXPORT Track *Track_create(uint8_t tracknum)
{
    uint8_t sectors = getsectors(tracknum);
    if (!sectors)
    {
        logfmt(L_ERROR, "Track: invalid track number %hhu.", tracknum);
        return 0;
    }
    Track *self = xmalloc(sizeof *self + sectors * sizeof *self->sector);
    for (uint8_t sectornum = 0; sectornum < sectors; ++sectornum)
    {
	self->sector[sectornum] = Sector_createAt(tracknum, sectornum);
    }
    self->tracknum = tracknum;
    self->sectors = sectors;
    return self;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
leal -0x2b(%rbx), %eax
cmpb $-0x2a, %al
jae 0x5b54
movzbl %bl, %edx
leaq 0x8503(%rip), %rsi      # 0xe046
xorl %r14d, %r14d
movl $0x1, %edi
xorl %eax, %eax
callq 0x5949
jmp 0x5ba5
movb $0x15, %al
cmpb $0x12, %bl
jb 0x5b69
movb $0x13, %al
cmpb $0x19, %bl
jb 0x5b69
xorl %eax, %eax
cmpb $0x1f, %bl
adcb $0x11, %al
movzbl %al, %r15d
movl %r15d, %eax
shlb $0x3, %al
addb $0x8, %al
movzbl %al, %edi
callq 0x585c
movq %rax, %r14
xorl %r12d, %r12d
movzbl %bl, %ebp
movzbl %r12b, %esi
movl %ebp, %edi
callq 0x5700
movq %rax, 0x8(%r14,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x5b86
movb %bl, (%r14)
movb %r15b, 0x1(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_rsector
SOEXPORT const Sector *Track_rsector(const Track *self, uint8_t sectornum)
{
    if (sectornum >= self->sectors)
    {
        logfmt(L_WARNING, "Track_rsector: invalid sector number %hhu "
		"requested.", sectornum);
        return 0;
    }
    return self->sector[sectornum];
}

// Assembly:
pushq %rbx
cmpb %sil, 0x1(%rdi)
jbe 0x5bc3
movzbl %sil, %eax
movq 0x8(%rdi,%rax,8), %rbx
jmp 0x5bdc
movzbl %sil, %edx
leaq 0x849a(%rip), %rsi      # 0xe068
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x5949
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_sector
SOEXPORT Sector *Track_sector(Track *self, uint8_t sectornum)
{
    if (sectornum >= self->sectors)
    {
        logfmt(L_WARNING, "Track_sector: invalid sector number %hhu requested.",
                sectornum);
        return 0;
    }
    return self->sector[sectornum];
}

// Assembly:
pushq %rbx
cmpb %sil, 0x1(%rdi)
jbe 0x5bf3
movzbl %sil, %eax
movq 0x8(%rdi,%rax,8), %rbx
jmp 0x5c0c
movzbl %sil, %edx
leaq 0x849f(%rip), %rsi      # 0xe09d
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x5949
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_destroy
SOEXPORT void Track_destroy(Track *self)
{
    if (!self) return;
    for (uint8_t sectornum = 0; sectornum < self->sectors; ++sectornum)
    {
	Sector_destroy(self->sector[sectornum]);
    }
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x5c52
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x1(%rdi)
je 0x5c43
xorl %r14d, %r14d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x51a0
incq %r14
movzbl 0x1(%rbx), %eax
cmpq %rax, %r14
jb 0x5c2d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5080
retq
nop
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/d64.c
// Function: D64_create
SOEXPORT D64 *D64_create(D64Type type)
{
    if (type < 0 || type > 2)
    {
        logmsg(L_ERROR, "D64: invalid type argument.");
        return 0;
    }
    D64 *self = xmalloc(sizeof *self + tracks[type] * sizeof *self->track);
    for (uint8_t tracknum = 0; tracknum < tracks[type]; ++tracknum)
    {
	self->track[tracknum] = Track_create(tracknum+1);
    }
    self->type = type;
    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jb 0x5c77
leaq 0x8469(%rip), %rsi      # 0xe0d1
movl $0x1, %edi
callq 0x591c
xorl %r14d, %r14d
jmp 0x5ccc
movl %edi, %ebx
movl %edi, %eax
leaq 0x84cc(%rip), %rcx      # 0xe14e
movzbl (%rax,%rcx), %r15d
leaq 0x8(,%r15,8), %rdi
callq 0x585c
cmpb $0x1, %r15b
adcl $0x0, %r15d
movq %rax, %r14
movzbl %r15b, %r15d
negq %r15
movl $0x1, %r12d
movzbl %r12b, %edi
callq 0x51b0
movq %rax, (%r14,%r12,8)
leaq (%r15,%r12), %rax
incq %rax
incq %r12
cmpq $0x1, %rax
jne 0x5cac
movl %ebx, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq