LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: panel_center_init
void
panel_center_init(panel_t *p, int w, int h)
{
    int x = DISPLAY_WIDTH / 2 - w / 2;
    int y = DISPLAY_HEIGHT / 2 - h / 2;
    panel_init(p, x, y, w, h);
    panel_fill(p, FONT_DEFAULT, ' ');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl $0x28, %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl $0xc, %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
callq 0x4340
movq -0x8(%rbp), %rdi
movb $0x7, -0x1c(%rbp)
movb $0x0, -0x1b(%rbp)
movb $0x1, -0x1a(%rbp)
movb $0x0, -0x19(%rbp)
movl -0x1c(%rbp), %esi
movl $0x20, %edx
callq 0x4960
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: panel_puts
void
panel_puts(panel_t *p, int x, int y, font_t font, const char *s)
{
    for (uint8_t *s8 = (uint8_t *)s; *s8; s8 += utf8_charlen(*s8), x++) {
        uint32_t c = utf8_to_32(s8);
        assert(c <= UINT16_MAX);
        panel_putc(p, x, y, font, c);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %ecx, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x4a78
movq -0x28(%rbp), %rdi
callq 0x4a80
movl %eax, -0x2c(%rbp)
cmpl $0xffff, -0x2c(%rbp)    # imm = 0xFFFF
ja 0x4a21
jmp 0x4a40
leaq 0x4e13(%rip), %rdi      # 0x983b
leaq 0x4d69(%rip), %rsi      # 0x9798
movl $0x9a, %edx
leaq 0x4e10(%rip), %rcx      # 0x984b
callq 0x1100
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x2c(%rbp), %eax
movl -0x4(%rbp), %ecx
movzwl %ax, %r8d
callq 0x4440
movq -0x28(%rbp), %rax
movzbl (%rax), %edi
callq 0x4b80
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4a01
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/utf.h
// Function: utf8_to_32
static inline uint32_t
utf8_to_32(const uint8_t *c)
{
    switch(utf8_valid(c)) {
    case 0: return 0;  /* invalid utf8 */
    case 1: return *c; /* no work, just promote size */
    case 2: return ((c[0] & 0x1f) << 6) | (c[1] & 0x3f);
    case 3: return ((c[0] & 0x0f) << 12) | ((c[1] & 0x3f) << 6) | (c[2] & 0x3f);
    case 4: return ((c[0] & 0x07) << 18) | ((c[1] & 0x3f) << 12) | ((c[2] & 0x3f) << 6) | (c[3] & 0x3f);
    }
    return 0; /* no complaints gcc */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5310
movq %rax, %rcx
movq %rcx, -0x18(%rbp)
subq $0x4, %rax
ja 0x4b62
movq -0x18(%rbp), %rax
leaq 0x4c9f(%rip), %rcx      # 0x9750
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x4(%rbp)
jmp 0x4b69
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x4b69
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0x1f, %eax
shll $0x6, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
andl $0x3f, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x4b69
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
shll $0xc, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
andl $0x3f, %ecx
shll $0x6, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
andl $0x3f, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x4b69
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0x7, %eax
shll $0x12, %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
andl $0x3f, %ecx
shll $0xc, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
andl $0x3f, %ecx
shll $0x6, %ecx
orl %ecx, %eax
movq -0x10(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
andl $0x3f, %ecx
orl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x4b69
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/utf.h
// Function: utf8_charlen
static inline
size_t utf8_charlen(uint8_t c)
{
    if (c < 0x80) return 1;         /* 0xxxxxxx */
    if ((c & 0xe0)==0xc0) return 2; /* 110xxxxx */
    if ((c & 0xf0)==0xe0) return 3; /* 1110xxxx */
    if ((c & 0xf8)==0xf0 && (c <= 0xf4)) return 4; /* 11110xxx */
    else return 0; /* invalid UTF8 */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dil, %al
movb %al, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x80, %eax
jge 0x4b9f
movq $0x1, -0x8(%rbp)
jmp 0x4c00
movzbl -0x9(%rbp), %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0x4bb9
movq $0x2, -0x8(%rbp)
jmp 0x4c00
movzbl -0x9(%rbp), %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0x4bd3
movq $0x3, -0x8(%rbp)
jmp 0x4c00
movzbl -0x9(%rbp), %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0x4bf8
movzbl -0x9(%rbp), %eax
cmpl $0xf4, %eax
jg 0x4bf8
movq $0x4, -0x8(%rbp)
jmp 0x4c00
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: font_decode
static inline font_t
font_decode(const char *s)
{
    font_t font;
    const char *colors = "krgybmcw";
    font.fore = strchr(colors, tolower((int)s[0])) - colors;
    font.back = strchr(colors, tolower((int)s[1])) - colors;
    font.fore_bright = isupper((int)s[0]);
    font.back_bright = isupper((int)s[1]);
    return font;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x499e(%rip), %rax      # 0x98d1
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x11b0
movq -0x28(%rbp), %rdi
movl %eax, %esi
callq 0x10d0
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movb %al, -0x4(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x11b0
movq -0x20(%rbp), %rdi
movl %eax, %esi
callq 0x10d0
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movb %al, -0x3(%rbp)
callq 0x1280
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x2(%rbp)
callq 0x1280
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: panel_attr
void
panel_attr(panel_t *p, int x, int y, font_t font)
{
    x += p->x;
    y += p->y;
    if (x >= 0 && x < DISPLAY_WIDTH && y >= 0 && y < DISPLAY_HEIGHT) {
        p->tiles[x][y].transparent = false;
        p->tiles[x][y].font = font;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %ecx, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x5062
cmpl $0x50, -0x14(%rbp)
jge 0x5062
cmpl $0x0, -0x18(%rbp)
jl 0x5062
cmpl $0x18, -0x18(%rbp)
jge 0x5062
movq -0x10(%rbp), %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movb $0x0, 0x2(%rax,%rcx,8)
movq -0x10(%rbp), %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0xc0, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movl -0x4(%rbp), %edx
movl %edx, 0x3(%rax,%rcx,8)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: panel_border
void
panel_border(panel_t *p, font_t font)
{
    for (int x = 1; x < p->w - 1; x++) {
        panel_putc(p, x, 0,        font, 0x2500);
        panel_putc(p, x, p->h - 1, font, 0x2500);
    }
    for (int y = 1; y < p->h - 1; y++) {
        panel_putc(p, 0,        y, font, 0x2502);
        panel_putc(p, p->w - 1, y, font, 0x2502);
    }
    panel_putc(p, 0,        0,        font, 0x250C);
    panel_putc(p, p->w - 1, 0,        font, 0x2510);
    panel_putc(p, 0,        p->h - 1, font, 0x2514);
    panel_putc(p, p->w - 1, p->h - 1, font, 0x2518);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %esi, -0x4(%rbp)
movq %rdi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x51b8
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x4(%rbp), %ecx
xorl %edx, %edx
movl $0x2500, %r8d           # imm = 0x2500
callq 0x4440
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
subl $0x1, %edx
movl -0x4(%rbp), %ecx
movl $0x2500, %r8d           # imm = 0x2500
callq 0x4440
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5166
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5211
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
xorl %esi, %esi
movl $0x2502, %r8d           # imm = 0x2502
callq 0x4440
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
subl $0x1, %esi
movl -0x18(%rbp), %edx
movl -0x4(%rbp), %ecx
movl $0x2502, %r8d           # imm = 0x2502
callq 0x4440
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x51bf
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %ecx
xorl %edx, %edx
movl $0x250c, %r8d           # imm = 0x250C
movl %edx, %esi
callq 0x4440
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
subl $0x1, %esi
movl -0x4(%rbp), %ecx
xorl %edx, %edx
movl $0x2510, %r8d           # imm = 0x2510
callq 0x4440
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
subl $0x1, %edx
movl -0x4(%rbp), %ecx
xorl %esi, %esi
movl $0x2514, %r8d           # imm = 0x2514
callq 0x4440
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
subl $0x1, %esi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
subl $0x1, %edx
movl -0x4(%rbp), %ecx
movl $0x2518, %r8d           # imm = 0x2518
callq 0x4440
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/display.c
// Function: panel_strlen
size_t
panel_strlen(const char *s)
{
    size_t count = 0;
    for (const char *p = s; *p; p += utf8_charlen((uint8_t) *p)) {
        if (is_color_directive(p))
            p += 3;
        else if (*p != '}')
            count++;
    }
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x5304
movq -0x18(%rbp), %rdi
callq 0x4e90
testb $0x1, %al
jne 0x52c4
jmp 0x52d2
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x52ec
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
je 0x52ea
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x52ec
jmp 0x52ee
movq -0x18(%rbp), %rax
movzbl (%rax), %edi
callq 0x4b80
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x52ac
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/utf.h
// Function: utf8_valid
static inline
size_t utf8_valid(const uint8_t *c)
{
    size_t clen = utf8_charlen(*c);
    switch(clen) { /* use fall through */
    case 4: if ((c[3] & 0xc0) != 0x80) return 0;
    case 3: if ((c[2] & 0xc0) != 0x80) return 0;
    case 2: if ((c[1] & 0xc0) != 0x80) return 0;
    case 1: return clen;  /* no trailing bytes to validate */
    case 0: return 0;     /* invalid utf8 */
    }
    return clen; /* don't complain, gcc */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %edi
callq 0x4b80
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
subq $0x4, %rax
ja 0x53c6
movq -0x20(%rbp), %rax
leaq 0x441b(%rip), %rcx      # 0x9764
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
je 0x5370
movq $0x0, -0x8(%rbp)
jmp 0x53ce
jmp 0x5372
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
je 0x5390
movq $0x0, -0x8(%rbp)
jmp 0x53ce
jmp 0x5392
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
je 0x53b0
movq $0x0, -0x8(%rbp)
jmp 0x53ce
jmp 0x53b2
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x53ce
movq $0x0, -0x8(%rbp)
jmp 0x53ce
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/map.c
// Function: map_draw_terrain
void
map_draw_terrain(map_t *map, panel_t *p)
{
    for (size_t y = 0; y < MAP_HEIGHT; y++) {
        for (size_t x = 0; x < MAP_WIDTH; x++) {
            uint16_t c = map->high[x][y].base;
            font_t font = base_font(c, x, y);
            panel_putc(p, x, y, font, c);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x18, -0x18(%rbp)
jae 0x5f1c
movq $0x0, -0x20(%rbp)
cmpq $0x3c, -0x20(%rbp)
jae 0x5f09
movq -0x8(%rbp), %rax
imulq $0x180, -0x20(%rbp), %rcx # imm = 0x180
addq %rcx, %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw (%rax), %ax
movw %ax, -0x22(%rbp)
movzwl -0x22(%rbp), %edi
movq -0x20(%rbp), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movl %eax, %edx
callq 0x5f30
movl %eax, -0x26(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movl %eax, %edx
movw -0x22(%rbp), %ax
movl -0x26(%rbp), %ecx
movzwl %ax, %r8d
callq 0x4440
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5e9b
jmp 0x5f0b
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x5e88
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/map.c
// Function: map_draw_buildings
void
map_draw_buildings(map_t *map, panel_t *p)
{
    for (size_t y = 0; y < MAP_HEIGHT; y++) {
        for (size_t x = 0; x < MAP_WIDTH; x++) {
            enum building building = map->high[x][y].building;
            if (building != C_NONE) {
                uint16_t c = building;
                font_t font = FONT(Y, k);
                if (map->high[x][y].building_age < 0) {
                    font.fore = COLOR_CYAN;
                    c = tolower(c);
                }
                panel_putc(p, x, y, font, c);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x18, -0x18(%rbp)
jae 0x6265
movq $0x0, -0x20(%rbp)
cmpq $0x3c, -0x20(%rbp)
jae 0x6252
movq -0x8(%rbp), %rax
imulq $0x180, -0x20(%rbp), %rcx # imm = 0x180
addq %rcx, %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x623f
movl -0x24(%rbp), %eax
movw %ax, -0x26(%rbp)
movl 0x377e(%rip), %eax      # 0x9968
movl %eax, -0x2a(%rbp)
movq -0x8(%rbp), %rax
imulq $0x180, -0x20(%rbp), %rcx # imm = 0x180
addq %rcx, %rax
movq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jge 0x621f
movb $0x6, -0x2a(%rbp)
movzwl -0x26(%rbp), %edi
callq 0x11b0
movw %ax, -0x26(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movl %eax, %edx
movw -0x26(%rbp), %ax
movl -0x2a(%rbp), %ecx
movzwl %ax, %r8d
callq 0x4440
jmp 0x6241
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x61ab
jmp 0x6254
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6198
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_hero_generate
hero_t
game_hero_generate(void)
{
    hero_t hero;
    memset(&hero, 0, sizeof(hero));
    hero.active = true;
    rand_name(hero.name, sizeof(hero.name));
    hero.hp = hero.hp_max = rand_range(10, 20);
    hero.ap = hero.ap_max = rand_range(20, 40);
    hero.str = rand_range(10, 18);
    hero.dex = rand_range(10, 18);
    hero.mind = rand_range(10, 18);
    hero.squad = -1;
    return hero;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq %rdi, %rax
movq %rax, -0x8(%rbp)
xorl %esi, %esi
movl $0x34, %edx
callq 0x1130
movq -0x10(%rbp), %rdi
movb $0x1, (%rdi)
addq $0x1, %rdi
movl $0x10, %esi
callq 0x85b0
movl $0xa, %edi
movl $0x14, %esi
callq 0x8580
movq -0x10(%rbp), %rdi
movl %eax, 0x18(%rdi)
movl %eax, 0x14(%rdi)
movl $0x14, %edi
movl $0x28, %esi
callq 0x8580
movq -0x10(%rbp), %rdi
movl %eax, 0x20(%rdi)
movl %eax, 0x1c(%rdi)
movl $0xa, %edi
movl $0x12, %esi
callq 0x8580
movq -0x10(%rbp), %rdi
movl %eax, 0x24(%rdi)
movl $0xa, %edi
movl $0x12, %esi
callq 0x8580
movq -0x10(%rbp), %rdi
movl %eax, 0x28(%rdi)
movl $0xa, %edi
movl $0x12, %esi
callq 0x8580
movq -0x10(%rbp), %rdi
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rdi)
movl $0xffffffff, 0x30(%rdi) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_save
bool
game_save(game_t *game, FILE *out)
{
    if (fwrite(game, sizeof(*game), 1, out) != 1)
        return false;
    if (fwrite(game->map->high, sizeof(game->map->high), 1, out) != 1)
        return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1df0, %esi           # imm = 0x1DF0
movl $0x1, %edx
callq 0x1260
cmpq $0x1, %rax
je 0x6623
movb $0x0, -0x1(%rbp)
jmp 0x664e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rcx
movl $0x5a00, %esi           # imm = 0x5A00
movl $0x1, %edx
callq 0x1260
cmpq $0x1, %rax
je 0x664a
movb $0x0, -0x1(%rbp)
jmp 0x664e
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_load
game_t *
game_load(FILE *out)
{
    game_t *game = malloc(sizeof(*game));
    if (fread(game, sizeof(*game), 1, out) == 1) {
        game->map = map_generate(game->map_seed);
        if (fread(game->map->high, sizeof(game->map->high), 1, out) == 1)
            return game;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1df0, %edi           # imm = 0x1DF0
callq 0x11c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1df0, %esi           # imm = 0x1DF0
movl $0x1, %edx
callq 0x1080
cmpq $0x1, %rax
jne 0x66db
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x53e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rcx
movl $0x5a00, %esi           # imm = 0x5A00
movl $0x1, %edx
callq 0x1080
cmpq $0x1, %rax
jne 0x66d9
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x66e3
jmp 0x66db
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: add_population
static void
add_population(game_t *game, long amount)
{
    long start_population = game->population;
    game->population += amount;
    if (start_population < GAME_WIN_POP / 4 &&
        game->population >= GAME_WIN_POP / 4) {
        game_event_push(game, EVENT_PROGRESS_1);
    }
    if (game->population <= 0)
        game_event_push(game, EVENT_LOSE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
cvttsd2si 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
cvtsi2sdq -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
addsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
cmpq $0x3e8, -0x18(%rbp)     # imm = 0x3E8
jge 0x6bc1
movq -0x8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd 0x2e3b(%rip), %xmm1     # 0x99e8
ucomisd %xmm1, %xmm0
jb 0x6bc1
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x74c0
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomisd 0x30(%rax), %xmm0
jb 0x6bdd
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x74c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: building_cost
yield_t
building_cost(uint16_t building)
{
    switch (building) {
    case C_CASTLE:
        return COST_CASTLE;
    case C_LUMBERYARD:
        return COST_LUMBERYARD;
    case C_FARM:
        return COST_FARM;
    case C_STABLE:
        return COST_STABLE;
    case C_MINE:
        return COST_MINE;
    case C_ROAD:
        return COST_ROAD;
    case C_HAMLET:
        return COST_HAMLET;
    case C_NONE:
        break;
    }
    return (yield_t){0, 0, 0};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0xe(%rbp)
movzwl -0xe(%rbp), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x6d04
jmp 0x6c0c
movl -0x24(%rbp), %eax
subl $0x2b, %eax
je 0x6cd6
jmp 0x6c1a
movl -0x24(%rbp), %eax
subl $0x43, %eax
je 0x6c5d
jmp 0x6c24
movl -0x24(%rbp), %eax
subl $0x46, %eax
je 0x6c91
jmp 0x6c2e
movl -0x24(%rbp), %eax
subl $0x48, %eax
je 0x6ced
jmp 0x6c3c
movl -0x24(%rbp), %eax
subl $0x4d, %eax
je 0x6cbf
jmp 0x6c46
movl -0x24(%rbp), %eax
subl $0x53, %eax
je 0x6ca8
jmp 0x6c50
movl -0x24(%rbp), %eax
subl $0x57, %eax
je 0x6c77
jmp 0x6d06
movl $0x3e8, -0xc(%rbp)      # imm = 0x3E8
movl $0x3e8, -0x8(%rbp)      # imm = 0x3E8
movl $0x3e8, -0x4(%rbp)      # imm = 0x3E8
jmp 0x6d1b
movl $0x19, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x6d1b
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x14, -0x4(%rbp)
jmp 0x6d1b
movl $0x46, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x46, -0x4(%rbp)
jmp 0x6d1b
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x64, -0x4(%rbp)
jmp 0x6d1b
movl $0x1, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x6d1b
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x1e, -0x4(%rbp)
jmp 0x6d1b
jmp 0x6d06
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0xc(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %edx
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_unbuild
void
game_unbuild(game_t *game, int x, int y)
{
    uint16_t building = map_building(game->map, x, y);
    switch (building) {
    case C_HAMLET:
        add_population(game, -HAMLET_INC);
        break;
    case C_STABLE:
        game->max_hero -= STABLE_INC;
        break;
    case C_MINE:
    case C_LUMBERYARD:
    case C_ROAD:
    case C_FARM:
        /* Nothing special */
        break;
    case C_CASTLE:
        add_population(game, -50);
        return; // don't destroy
    }
    game->map->high[x][y].building = C_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x6310
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
addl $-0x2b, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x2c, %eax
ja 0x6dca
movq -0x20(%rbp), %rax
leaq 0x2ca2(%rip), %rcx      # 0x9a28
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq $-0xc8, %rsi
callq 0x6b60
jmp 0x6dca
movq -0x8(%rbp), %rax
movl 0x3c8(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x3c8(%rax)
jmp 0x6dca
jmp 0x6dca
movq -0x8(%rbp), %rdi
movq $-0x32, %rsi
callq 0x6b60
jmp 0x6df1
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x180, %rcx, %rcx      # imm = 0x180
addq %rcx, %rax
movslq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw $0x0, 0x2(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_date
void
game_date(game_t *game, char *buffer)
{
    long time = game->time;
    long day = game->time / DAY;
    time -= day * DAY;
    long hour = time / HOUR;
    time -= hour * HOUR;
    long minute = time / MINUTE;
    char *ampm = hour < 12 ? "am" : "pm";
    long hour12 = hour == 0 ? 12 : hour;
    if (hour12 > 12)
        hour12 -= 12;
    sprintf(buffer, "Day %ld, %ld:%02ld%s", day, hour12, minute, ampm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cvtsi2sdq 0x8(%rax), %xmm0
movsd 0x2bd2(%rip), %xmm1     # 0x9a00
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x20(%rbp)
cvtsi2sdq -0x20(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x2b9a(%rip), %xmm2     # 0x9a00
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x18(%rbp)
cvtsi2sdq -0x18(%rbp), %xmm0
movsd 0x2b73(%rip), %xmm1     # 0x99f8
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x28(%rbp)
cvtsi2sdq -0x28(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x2b3b(%rip), %xmm2     # 0x99f8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x18(%rbp)
cvtsi2sdq -0x18(%rbp), %xmm0
movsd 0x2b14(%rip), %xmm1     # 0x99f0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdx
leaq 0x2beb(%rip), %rax      # 0x9adf
leaq 0x2be1(%rip), %rcx      # 0x9adc
cmpq $0xc, %rdx
cmovlq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x6f19
movl $0xc, %eax
movq %rax, -0x48(%rbp)
jmp 0x6f21
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0xc, -0x40(%rbp)
jle 0x6f3c
movq -0x40(%rbp), %rax
subq $0xc, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
leaq 0x2b8b(%rip), %rsi      # 0x9ae2
movb $0x0, %al
callq 0x1240
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: yield_string
void
yield_string(char *b, yield_t yield, bool rate)
{
    char *end = b;
    int count = 0;
    if (yield.gold)
        end += sprintf(end, "%s%d gold%s",
                       count++ > 0 ? ", " : "",
                       yield.gold,
                       rate ? "/day" : "");
    if (yield.wood)
        end += sprintf(end, "%s%d wood%s",
                       count++ > 0 ? ", " : "",
                       yield.wood,
                       rate ? "/day" : "");
    if (yield.food)
        end += sprintf(end, "%s%d food%s",
                       count++ > 0 ? ", " : "",
                       yield.food,
                       rate ? "/day" : "");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rsi, -0x1c(%rbp)
movl %edx, -0x14(%rbp)
movq -0x1c(%rbp), %rcx
movq %rcx, -0xc(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, -0x4(%rbp)
movq %rdi, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x700c
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2bc3(%rip), %rdx      # 0x9b86
leaq 0x2b39(%rip), %rax      # 0x9b03
cmpl $0x0, %ecx
cmovgq %rax, %rdx
movl -0xc(%rbp), %ecx
movb -0x29(%rbp), %sil
leaq 0x2ba7(%rip), %r8       # 0x9b86
leaq 0x2b20(%rip), %rax      # 0x9b06
testb $0x1, %sil
cmovneq %rax, %r8
leaq 0x2b02(%rip), %rsi      # 0x9af7
movb $0x0, %al
callq 0x1240
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x7071
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2b5e(%rip), %rdx      # 0x9b86
leaq 0x2ad4(%rip), %rax      # 0x9b03
cmpl $0x0, %ecx
cmovgq %rax, %rdx
movl -0x4(%rbp), %ecx
movb -0x29(%rbp), %sil
leaq 0x2b42(%rip), %r8       # 0x9b86
leaq 0x2abb(%rip), %rax      # 0x9b06
testb $0x1, %sil
cmovneq %rax, %r8
leaq 0x2ab1(%rip), %rsi      # 0x9b0b
movb $0x0, %al
callq 0x1240
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x70d6
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2af9(%rip), %rdx      # 0x9b86
leaq 0x2a6f(%rip), %rax      # 0x9b03
cmpl $0x0, %ecx
cmovgq %rax, %rdx
movl -0x8(%rbp), %ecx
movb -0x29(%rbp), %sil
leaq 0x2add(%rip), %r8       # 0x9b86
leaq 0x2a56(%rip), %rax      # 0x9b06
testb $0x1, %sil
cmovneq %rax, %r8
leaq 0x2a58(%rip), %rsi      # 0x9b17
movb $0x0, %al
callq 0x1240
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_hero_push
bool
game_hero_push(game_t *game, hero_t hero)
{
    for (int i = 0; i < game->max_hero; i++) {
        if (!game->heroes[i].active) {
            game->heroes[i] = hero;
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x3c8(%rcx), %eax
jge 0x715b
movq -0x10(%rbp), %rax
addq $0x3cc, %rax            # imm = 0x3CC
movslq -0x14(%rbp), %rcx
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
testb $0x1, (%rax)
jne 0x714e
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x3cc, %rdi            # imm = 0x3CC
movslq -0x14(%rbp), %rax
imulq $0x34, %rax, %rax
addq %rax, %rdi
movl $0x34, %edx
callq 0x1190
movb $0x1, -0x1(%rbp)
jmp 0x715f
jmp 0x7150
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x70fb
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_event_pop
enum game_event
game_event_pop(game_t *game)
{
    for (int i = (int)countof(game->events) - 1; i >= 0; i--) {
        if (game->events[i] != EVENT_NONE) {
            enum game_event event = game->events[i];
            game->events[i] = EVENT_NONE;
            return event;
        }
    }
    return EVENT_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl $0x7, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x71d1
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
cmpl $0x0, 0x1dcc(%rax,%rcx,4)
je 0x71c4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x1dcc(%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, 0x1dcc(%rax,%rcx,4)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x71d8
jmp 0x71c6
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x717f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_event_push
static bool
game_event_push(game_t *game, enum game_event event)
{
    for (int i = 0; i < (int)countof(game->events); i++) {
        if (game->events[i] == EVENT_NONE) {
            game->events[i] = event;
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x750f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
cmpl $0x0, 0x1dcc(%rax,%rcx,4)
jne 0x7502
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl %edx, 0x1dcc(%rax,%rcx,4)
movb $0x1, -0x1(%rbp)
jmp 0x7513
jmp 0x7504
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x74d2
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: building_process
static void
building_process(game_t *game, uint16_t building)
{
    yield_t yield = {0, 0, 0};
    switch (building) {
    case C_NONE:
        return;
    case C_CASTLE:
        yield = YIELD_CASTLE;
        break;
    case C_LUMBERYARD:
        yield = YIELD_LUMBERYARD;
        break;
    case C_STABLE:
        yield = YIELD_STABLE;
        break;
    case C_HAMLET:
        yield = YIELD_HAMLET;
        break;
    case C_MINE:
        yield = YIELD_MINE;
        break;
    case C_ROAD:
        yield = YIELD_ROAD;
        break;
    case C_FARM:
        yield = YIELD_FARM;
        break;
    }
    yield_apply(game, yield);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movl $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
movl %eax, -0x80(%rbp)
testl %eax, %eax
je 0x788b
jmp 0x7832
movl -0x80(%rbp), %eax
subl $0x2b, %eax
je 0x7952
jmp 0x7840
movl -0x80(%rbp), %eax
subl $0x43, %eax
je 0x7890
jmp 0x784a
movl -0x80(%rbp), %eax
subl $0x46, %eax
je 0x7977
jmp 0x7858
movl -0x80(%rbp), %eax
subl $0x48, %eax
je 0x7908
jmp 0x7866
movl -0x80(%rbp), %eax
subl $0x4d, %eax
je 0x792d
jmp 0x7874
movl -0x80(%rbp), %eax
subl $0x53, %eax
je 0x78e0
jmp 0x787e
movl -0x80(%rbp), %eax
subl $0x57, %eax
je 0x78b8
jmp 0x799a
jmp 0x79b8
movl $0x2, -0x24(%rbp)
movl $0x2, -0x20(%rbp)
movl $0x2, -0x1c(%rbp)
movq -0x24(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x5, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0x0, -0x3c(%rbp)
movl $0xfffffffe, -0x38(%rbp) # imm = 0xFFFFFFFE
movl $0x0, -0x34(%rbp)
movq -0x3c(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0x2, -0x48(%rbp)
movl $0xfffffffe, -0x44(%rbp) # imm = 0xFFFFFFFE
movl $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0x5, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movq -0x54(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0xffffffff, -0x60(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x799a
movl $0x0, -0x6c(%rbp)
movl $0x4, -0x68(%rbp)
movl $0x0, -0x64(%rbp)
movq -0x6c(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x7c(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x7c(%rbp), %rsi
movl -0x74(%rbp), %edx
callq 0x8110
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: invader_push
static bool
invader_push(game_t *game, invader_t invader)
{
    for (unsigned i = 0; i < countof(game->invaders); i++) {
        if (!game->invaders[i].active) {
            game->invaders[i] = invader;
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpq $0x10, %rax
jae 0x7a3e
movq -0x10(%rbp), %rax
addq $0x48, %rax
movl -0x14(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
testb $0x1, (%rax)
jne 0x7a31
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
movl -0x14(%rbp), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdi
movl $0x28, %edx
callq 0x1190
movb $0x1, -0x1(%rbp)
jmp 0x7a42
jmp 0x7a33
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x79eb
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: invader_generate
static invader_t
invader_generate(void)
{
    float az = rand_uniform(0, 2 * PI);
    invader_t invader = {
        .active = true,
        .type = I_GOBLIN,
        .x = cosf(az) * MAP_WIDTH + CASTLE_X,
        .y = sinf(az) * MAP_HEIGHT + CASTLE_Y,
        .embarked = true
    };
    return invader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, -0x10(%rbp)
xorps %xmm0, %xmm0
movss 0x1f55(%rip), %xmm1     # 0x99c0
callq 0x8510
movq -0x18(%rbp), %rdi
movss %xmm0, -0x4(%rbp)
movb $0x1, (%rdi)
movss -0x4(%rbp), %xmm0
callq 0x1070
movq -0x18(%rbp), %rdi
movss 0x1ece(%rip), %xmm1     # 0x9960
mulss %xmm1, %xmm0
movss 0x1f16(%rip), %xmm1     # 0x99b4
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rdi)
movss -0x4(%rbp), %xmm0
callq 0x1120
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movss 0x1ea3(%rip), %xmm1     # 0x9964
mulss %xmm1, %xmm0
movss 0x1ee3(%rip), %xmm1     # 0x99b0
addss %xmm1, %xmm0
movss %xmm0, 0x8(%rdi)
xorps %xmm0, %xmm0
movss %xmm0, 0xc(%rdi)
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rdi)
movw $0x67, 0x14(%rdi)
movq $0x0, 0x18(%rdi)
movb $0x1, 0x20(%rdi)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: building_yield
yield_t
building_yield(uint16_t building)
{
    switch (building) {
    case C_CASTLE:
        return YIELD_CASTLE;
    case C_LUMBERYARD:
        return YIELD_LUMBERYARD;
    case C_FARM:
        return YIELD_FARM;
    case C_STABLE:
        return YIELD_STABLE;
    case C_MINE:
        return YIELD_MINE;
    case C_ROAD:
        return YIELD_ROAD;
    case C_HAMLET:
        return YIELD_HAMLET;
    case C_NONE:
        break;
    }
    return (yield_t){0, 0, 0};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0xe(%rbp)
movzwl -0xe(%rbp), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x7f54
jmp 0x7e5c
movl -0x24(%rbp), %eax
subl $0x2b, %eax
je 0x7f26
jmp 0x7e6a
movl -0x24(%rbp), %eax
subl $0x43, %eax
je 0x7ead
jmp 0x7e74
movl -0x24(%rbp), %eax
subl $0x46, %eax
je 0x7ee1
jmp 0x7e7e
movl -0x24(%rbp), %eax
subl $0x48, %eax
je 0x7f3d
jmp 0x7e8c
movl -0x24(%rbp), %eax
subl $0x4d, %eax
je 0x7f0f
jmp 0x7e96
movl -0x24(%rbp), %eax
subl $0x53, %eax
je 0x7ef8
jmp 0x7ea0
movl -0x24(%rbp), %eax
subl $0x57, %eax
je 0x7ec7
jmp 0x7f56
movl $0x2, -0xc(%rbp)
movl $0x2, -0x8(%rbp)
movl $0x2, -0x4(%rbp)
jmp 0x7f6b
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x5, -0x4(%rbp)
jmp 0x7f6b
movl $0x0, -0xc(%rbp)
movl $0x4, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x7f6b
movl $0x0, -0xc(%rbp)
movl $0xfffffffe, -0x8(%rbp) # imm = 0xFFFFFFFE
movl $0x0, -0x4(%rbp)
jmp 0x7f6b
movl $0x5, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f6b
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
jmp 0x7f6b
movl $0x2, -0xc(%rbp)
movl $0xfffffffe, -0x8(%rbp) # imm = 0xFFFFFFFE
movl $0x0, -0x4(%rbp)
jmp 0x7f6b
jmp 0x7f56
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0xc(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl -0x18(%rbp), %edx
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: game_draw_units
void
game_draw_units(game_t *game, panel_t *p, bool id)
{
    font_t land = FONT(R, k);
    font_t sea  = FONT(r, y);
    for (int i = 0; i < (int)countof(game->invaders); i++) {
        invader_t *inv = game->invaders + i;
        if (inv->active)
            panel_putc(p, inv->x, inv->y, inv->embarked ? sea : land,
                       id ? i + 'A' : inv->type);
    }
    for (int i = 0; i < (int)countof(game->squads); i++) {
        squad_t *s = game->squads + i;
        if (s->member_count > 0 &&
            !((int)s->x == CASTLE_X && (int)s->y == CASTLE_Y))
            panel_putc(p, s->x, s->y, FONT(k, M), i + 'A');
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl 0x1a23(%rip), %eax      # 0x99d0
movl %eax, -0x15(%rbp)
movl 0x1a1e(%rip), %eax      # 0x99d4
movl %eax, -0x19(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x10, -0x20(%rbp)
jge 0x8067
movq -0x8(%rbp), %rax
addq $0x48, %rax
movslq -0x20(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
testb $0x1, (%rax)
je 0x8057
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
cvttss2si 0x4(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
cvttss2si 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x28(%rbp), %rax
testb $0x1, 0x20(%rax)
je 0x801c
movl -0x19(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x8022
movl -0x15(%rbp), %eax
movl %eax, -0x2c(%rbp)
testb $0x1, -0x11(%rbp)
je 0x8033
movl -0x20(%rbp), %eax
addl $0x41, %eax
movl %eax, -0x54(%rbp)
jmp 0x803e
movq -0x28(%rbp), %rax
movzwl 0x14(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x40(%rbp), %edx
movl -0x44(%rbp), %esi
movq -0x50(%rbp), %rdi
movl -0x54(%rbp), %eax
movl -0x2c(%rbp), %ecx
movzwl %ax, %r8d
callq 0x4440
jmp 0x8059
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7fc0
movl $0x0, -0x30(%rbp)
cmpl $0x10, -0x30(%rbp)
jge 0x80fd
movq -0x8(%rbp), %rax
addq $0x2c8, %rax            # imm = 0x2C8
movslq -0x30(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x80ed
movq -0x38(%rbp), %rax
cvttss2si (%rax), %eax
cmpl $0x1e, %eax
jne 0x80b6
movq -0x38(%rbp), %rax
cvttss2si 0x4(%rax), %eax
cmpl $0xc, %eax
je 0x80ed
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
cvttss2si (%rax), %esi
movq -0x38(%rbp), %rax
cvttss2si 0x4(%rax), %edx
movb $0x0, -0x3c(%rbp)
movb $0x5, -0x3b(%rbp)
movb $0x0, -0x3a(%rbp)
movb $0x1, -0x39(%rbp)
movl -0x30(%rbp), %eax
addl $0x41, %eax
movl -0x3c(%rbp), %ecx
movzwl %ax, %r8d
callq 0x4440
jmp 0x80ef
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x806e
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/game.c
// Function: invader_find_target
static void
invader_find_target(game_t *game, invader_t *i)
{
    int ix = i->x;
    int iy = i->y;
    int best_x = ix + rand_uniform(-INVADER_VISION, INVADER_VISION);
    int best_y = iy + rand_uniform(-INVADER_VISION, INVADER_VISION);
    float best_d = INFINITY;
    for (int y = -INVADER_VISION; y <= INVADER_VISION; y++) {
        for (int x = -INVADER_VISION; x <= INVADER_VISION; x++) {
            float xx = ix + x;
            float yy = iy + y;
            uint16_t building = map_building(game->map, xx, yy);
            if (building != C_NONE) {
                float d = xx * xx + yy * yy;
                if (d < best_d) {
                    best_x = xx;
                    best_y = yy;
                    best_d = d;
                }
            }
        }
    }
    i->tx = best_x;
    i->ty = best_y;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cvttss2si 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cvttss2si 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
cvtsi2ssl -0x14(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movss 0x1782(%rip), %xmm0     # 0x99cc
movss 0x1772(%rip), %xmm1     # 0x99c4
callq 0x8510
movaps %xmm0, %xmm1
movss -0x44(%rbp), %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
cvtsi2ssl -0x18(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss 0x1750(%rip), %xmm0     # 0x99cc
movss 0x1740(%rip), %xmm1     # 0x99c4
callq 0x8510
movaps %xmm0, %xmm1
movss -0x40(%rbp), %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x20(%rbp)
movss 0x1724(%rip), %xmm0     # 0x99c8
movss %xmm0, -0x24(%rbp)
movl $0xfffffff6, -0x28(%rbp) # imm = 0xFFFFFFF6
cmpl $0xa, -0x28(%rbp)
jg 0x8379
movl $0xfffffff6, -0x2c(%rbp) # imm = 0xFFFFFFF6
cmpl $0xa, -0x2c(%rbp)
jg 0x8369
movl -0x14(%rbp), %eax
addl -0x2c(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl -0x28(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
cvttss2si -0x30(%rbp), %esi
cvttss2si -0x34(%rbp), %edx
callq 0x6310
movw %ax, -0x36(%rbp)
movzwl -0x36(%rbp), %eax
cmpl $0x0, %eax
je 0x8359
movss -0x30(%rbp), %xmm0
movss -0x30(%rbp), %xmm2
movss -0x34(%rbp), %xmm1
mulss -0x34(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x3c(%rbp), %xmm1
movss -0x24(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8357
cvttss2si -0x30(%rbp), %eax
movl %eax, -0x1c(%rbp)
cvttss2si -0x34(%rbp), %eax
movl %eax, -0x20(%rbp)
movss -0x3c(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
jmp 0x8359
jmp 0x835b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x82c1
jmp 0x836b
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x82b0
cvtsi2ssl -0x1c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
cvtsi2ssl -0x20(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x10(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/rand.c
// Function: xorshift
uint64_t
xorshift(uint64_t *state) {
    uint64_t x = *state;
    x ^= x >> 12; // a
    x ^= x << 25; // b
    x ^= x >> 27; // c
    *state = x;
    return x * UINT64_C(2685821657736338717);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0xc, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x19, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x1b, %rax
xorq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movabsq $0x2545f4914f6cdd1d, %rax # imm = 0x2545F4914F6CDD1D
imulq -0x10(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/rand.c
// Function: xorshift_fill
void
xorshift_fill(uint64_t *state, void *buffer, size_t size)
{
    char *p = buffer;
    while (size) {
        uint64_t entropy = xorshift(state);
        size_t amount = MIN(size, sizeof(entropy));
        memcpy(p, &entropy, amount);
        size -= amount;
        p += amount;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8484
movq -0x8(%rbp), %rdi
callq 0x83a0
movq %rax, -0x28(%rbp)
movl $0x8, %eax
cmpq -0x18(%rbp), %rax
jae 0x8446
movl $0x8, %eax
movq %rax, -0x38(%rbp)
jmp 0x844e
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rsi
callq 0x1190
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x841c
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)