LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl (%rdi), %ebp
movl %ebp, %edi
callq 0x327e
movq %rax, %rcx
xorl %eax, %eax
leaq 0x3436(%rip), %rdx      # 0x6630
movslq (%rdx,%rcx,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movb 0x3(%rbx), %dl
andb $-0x40, %dl
negb %dl
jno 0x3255
movb 0x2(%rbx), %dl
andb $-0x40, %dl
negb %dl
jno 0x3255
movzbl 0x1(%rbx), %edx
movl %edx, %esi
andb $-0x40, %sil
negb %sil
jno 0x3255
andl $0x3f, %edx
cmpq $0x2, %rcx
je 0x324b
cmpq $0x3, %rcx
jne 0x325c
andl $0xf, %ebp
shll $0xc, %ebp
shll $0x6, %edx
orl %ebp, %edx
movzbl 0x2(%rbx), %eax
andl $0x3f, %eax
orl %edx, %eax
jmp 0x3255
andl $0x1f, %ebp
shll $0x6, %ebp
orl %edx, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
andl $0x7, %ebp
shll $0x12, %ebp
shll $0xc, %edx
orl %ebp, %edx
movzbl 0x2(%rbx), %ecx
andl $0x3f, %ecx
shll $0x6, %ecx
orl %edx, %ecx
movzbl 0x3(%rbx), %eax
andl $0x3f, %eax
orl %ecx, %eax
jmp 0x3255
// File: /workspace/github_c_makefile_star2_O2/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:
testb %dil, %dil
js 0x3287
pushq $0x1
jmp 0x32a5
movl %edi, %eax
andl $-0x20, %eax
cmpl $0xc0, %eax
jne 0x3297
pushq $0x2
jmp 0x32a5
movl %edi, %eax
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0x32a7
pushq $0x3
popq %rax
retq
movl %edi, %eax
andl $-0x8, %eax
cmpl $0xf0, %eax
sete %al
cmpb $-0xb, %dil
setb %cl
andb %al, %cl
movzbl %cl, %eax
shll $0x2, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
addl (%rdi), %esi
addl 0x4(%rdi), %edx
cmpl $0x50, %esi
setb %al
cmpl $0x18, %edx
setb %r8b
andb %al, %r8b
cmpb $0x1, %r8b
jne 0x35a8
movl %esi, %eax
imulq $0xc0, %rax, %rax
addq %rax, %rdi
movl %edx, %eax
movb $0x0, 0x12(%rdi,%rax,8)
movl %ecx, 0x13(%rdi,%rax,8)
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %rbp
movl 0x8(%r14), %eax
decl %eax
cmpl %eax, %ebp
jge 0x366f
movq %r14, %rdi
movl %ebp, %esi
xorl %edx, %edx
movl %ebx, %ecx
movl $0x2500, %r8d           # imm = 0x2500
callq 0x2ea2
movl 0xc(%r14), %edx
decl %edx
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %ecx
movl $0x2500, %r8d           # imm = 0x2500
callq 0x2ea2
incl %ebp
jmp 0x3635
pushq $0x1
popq %rbp
movl 0xc(%r14), %eax
decl %eax
movq %r14, %rdi
xorl %esi, %esi
cmpl %eax, %ebp
jge 0x36ac
movl %ebp, %edx
movl %ebx, %ecx
movl $0x2502, %r8d           # imm = 0x2502
callq 0x2ea2
movl 0x8(%r14), %esi
decl %esi
movq %r14, %rdi
movl %ebp, %edx
movl %ebx, %ecx
movl $0x2502, %r8d           # imm = 0x2502
callq 0x2ea2
incl %ebp
jmp 0x3672
xorl %edx, %edx
movl %ebx, %ecx
movl $0x250c, %r8d           # imm = 0x250C
callq 0x2ea2
movl 0x8(%r14), %esi
decl %esi
movq %r14, %rdi
xorl %edx, %edx
movl %ebx, %ecx
movl $0x2510, %r8d           # imm = 0x2510
callq 0x2ea2
movl 0xc(%r14), %edx
decl %edx
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %ecx
movl $0x2514, %r8d           # imm = 0x2514
callq 0x2ea2
movl 0x8(%r14), %esi
movl 0xc(%r14), %edx
decl %esi
decl %edx
movq %r14, %rdi
movl %ebx, %ecx
movl $0x2518, %r8d           # imm = 0x2518
popq %rbx
popq %r14
popq %rbp
jmp 0x2ea2
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %ebx, %ebx
movb (%r14), %bpl
testb %bpl, %bpl
je 0x3755
movq %r14, %rdi
callq 0x352b
cmpb $0x7d, %bpl
setne %cl
movzbl %al, %edx
xorb $0x1, %al
andb %cl, %al
movzbl %al, %eax
addq %rax, %rbx
leaq (%rdx,%rdx,2), %rax
leaq (%r14,%rax), %r15
movzbl (%r14,%rax), %edi
callq 0x327e
movq %rax, %r14
addq %r15, %r14
jmp 0x3717
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0x3ee1
cvtsi2ss %r15d, %xmm0
divss 0x2a87(%rip), %xmm0     # 0x67c8
addss 0x2a6b(%rip), %xmm0     # 0x67b4
mulss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
xorl %r12d, %r12d
cmpq $0x3c, %r12
je 0x3ed0
movzwl (%r14), %ebp
xorl %r13d, %r13d
cmpl $0x2663, %ebp           # imm = 0x2663
je 0x3db4
cmpl $0x2e, %ebp
je 0x3db4
cmpl $0x3a, %ebp
je 0x3e95
cmpl $0x2229, %ebp           # imm = 0x2229
je 0x3dc5
cmpl $0x2248, %ebp           # imm = 0x2248
je 0x3de3
cmpl $0x25b2, %ebp           # imm = 0x25B2
je 0x3dd6
cmpl $0x20, %ebp
jne 0x3e8d
movl $0x10000, %eax          # imm = 0x10000
movl $0x400, %edx            # imm = 0x400
pushq $0x4
jmp 0x3ea7
movl $0x10000, %eax          # imm = 0x10000
movl $0x200, %edx            # imm = 0x200
pushq $0x2
jmp 0x3ea7
movl $0x10000, %eax          # imm = 0x10000
movl $0x200, %edx            # imm = 0x200
xorl %ecx, %ecx
jmp 0x3ea8
movl $0x200, %edx            # imm = 0x200
pushq $0x7
popq %rcx
jmp 0x3e91
cvtsi2ss %r12d, %xmm0
divss 0x29dc(%rip), %xmm0     # 0x67cc
addss 0x29bc(%rip), %xmm0     # 0x67b4
cvtss2sd %xmm0, %xmm0
mulsd 0x2a04(%rip), %xmm0     # 0x6808
cvtsd2ss %xmm0, %xmm0
mulss %xmm0, %xmm0
addss 0x8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
sqrtsd %xmm0, %xmm0
mulsd 0x29ee(%rip), %xmm0     # 0x6810
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x55de
movq %rax, %xmm1
punpckldq 0x29f2(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x29fa(%rip), %xmm1     # 0x6840
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x29be(%rip), %xmm0     # 0x6818
movsd 0x29be(%rip), %xmm1     # 0x6820
callq 0x1130
cvtsd2ss %xmm0, %xmm0
addss 0xc(%rsp), %xmm0
callq 0x1100
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
seta %al
shll $0x10, %eax
movl $0x400, %edx            # imm = 0x400
pushq $0x7
jmp 0x3ea7
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
jmp 0x3ea8
movl $0x1000000, %r13d       # imm = 0x1000000
movl $0x10000, %eax          # imm = 0x10000
movl $0x300, %edx            # imm = 0x300
pushq $0x3
popq %rcx
orl %r13d, %eax
orl %edx, %ecx
orl %eax, %ecx
movzwl %bp, %r8d
movq %rbx, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x2ea2
incq %r12
addq $0x180, %r14            # imm = 0x180
jmp 0x3d5b
incq %r15
movq 0x10(%rsp), %r14
addq $0x10, %r14
jmp 0x3d2a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x8, %r14
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0x3f62
movq %r14, %r13
xorl %r12d, %r12d
cmpq $0x3c, %r12
je 0x3f59
movzwl -0x6(%r13), %eax
testl %eax, %eax
je 0x3f4d
cmpq $0x0, (%r13)
js 0x3f2f
movl $0x10003, %ecx          # imm = 0x10003
jmp 0x3f3b
movl %eax, %edi
callq 0x11b0
movl $0x10006, %ecx          # imm = 0x10006
movzwl %ax, %r8d
movq %rbx, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x2ea2
incq %r12
addq $0x180, %r13            # imm = 0x180
jmp 0x3f12
incq %r15
addq $0x10, %r14
jmp 0x3f06
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andl $0x0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movb $0x1, (%rdi)
incq %rdi
pushq $0x10
popq %rsi
callq 0x5232
pushq $0xa
popq %rbp
pushq $0x14
popq %r14
movl %ebp, %edi
movl %r14d, %esi
callq 0x5222
movl %eax, 0x18(%rbx)
movl %eax, 0x14(%rbx)
pushq $0x28
popq %rsi
movl %r14d, %edi
callq 0x5222
movl %eax, 0x20(%rbx)
movl %eax, 0x1c(%rbx)
pushq $0x12
popq %r14
movl %ebp, %edi
movl %r14d, %esi
callq 0x5222
movl %eax, 0x24(%rbx)
movl %ebp, %edi
movl %r14d, %esi
callq 0x5222
movl %eax, 0x28(%rbx)
movl %ebp, %edi
movl %r14d, %esi
callq 0x5222
movl %eax, 0x2c(%rbx)
orl $-0x1, 0x30(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/game.c
// Function: game_create
game_t *
game_create(uint64_t map_seed)
{
    game_t *game = calloc(sizeof(*game), 1);
    game->map_seed = map_seed;
    game->time = 0;
    game->speed = 1;
    game->gold = INIT_GOLD;
    game->wood = INIT_WOOD;
    game->food = INIT_FOOD;
    game->population = INIT_POPULATION;
    game->spawn_rate = INVADER_SPAWN_RATE;
    game->map = map_generate(map_seed);
    game->map->high[CASTLE_X][CASTLE_Y].building = C_CASTLE;
    game->max_hero = MAX_HERO_INIT;
    for (int i = 0; i < (int)countof(game->squads); i++) {
        game->squads[i].x = CASTLE_X;
        game->squads[i].y = CASTLE_Y;
        game->squads[i].target = -1;
    }
    for (int i = 0; i < HERO_INIT; i++) {
        game->heroes[i] = game_hero_generate();
        game->heroes[i].squad = 0;
    }
    game->squads[0].member_count = HERO_INIT;
    return game;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
pushq $0x1
popq %rsi
movl $0x1df0, %edi           # imm = 0x1DF0
callq 0x1160
movq %rax, %rbx
movq %r14, (%rax)
movl $0x1, 0x10(%rax)
movaps 0x27f9(%rip), %xmm0     # 0x6870
movups %xmm0, 0x18(%rax)
movaps 0x27fe(%rip), %xmm0     # 0x6880
movups %xmm0, 0x28(%rax)
movl $0x3f800000, 0x40(%rax) # imm = 0x3F800000
movq %r14, %rdi
callq 0x3764
movq %rax, 0x38(%rbx)
movw $0x43, 0x2dc2(%rax)
movl $0x4, 0x3c8(%rbx)
movl $0x2d0, %eax            # imm = 0x2D0
movsd 0x27d7(%rip), %xmm0     # 0x6890
cmpq $0x3d0, %rax            # imm = 0x3D0
je 0x40d1
movsd %xmm0, -0x8(%rbx,%rax)
orl $-0x1, (%rbx,%rax)
addq $0x10, %rax
jmp 0x40b9
movl $0x3cc, %r15d           # imm = 0x3CC
leaq 0xc(%rsp), %r14
cmpq $0x434, %r15            # imm = 0x434
je 0x4119
movq %r14, %rdi
callq 0x3fc4
movups 0xc(%rsp), %xmm0
movups 0x1c(%rsp), %xmm1
movups 0x2c(%rsp), %xmm2
movups %xmm2, 0x20(%rbx,%r15)
movups %xmm1, 0x10(%rbx,%r15)
movups %xmm0, (%rbx,%r15)
andl $0x0, 0x30(%rbx,%r15)
addq $0x34, %r15
jmp 0x40dc
movl $0x2, 0x2d4(%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1df0, %edi           # imm = 0x1DF0
callq 0x11c0
movq %rax, %rbx
pushq $0x1
popq %rdx
movl $0x1df0, %esi           # imm = 0x1DF0
movq %rax, %rdi
movq %r14, %rcx
callq 0x1080
cmpq $0x1, %rax
jne 0x41c9
movq (%rbx), %rdi
callq 0x3764
movq %rax, 0x38(%rbx)
pushq $0x1
popq %rdx
movl $0x5a00, %esi           # imm = 0x5A00
movq %rax, %rdi
movq %r14, %rcx
callq 0x1080
cmpq $0x1, %rax
je 0x41cb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
movsd 0x30(%rdi), %xmm1
cvttsd2si %xmm1, %rax
cvtsi2sd %rsi, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rdi)
cmpq $0x3e7, %rax            # imm = 0x3E7
jg 0x4415
ucomisd 0x24ed(%rip), %xmm0     # 0x68f0
jb 0x4415
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x48cc
movsd 0x30(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x4421
popq %rbx
retq
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x48cc
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
callq 0x3f99
cmpw $0x43, %ax
je 0x44f6
movzwl %ax, %eax
cmpl $0x53, %eax
je 0x44cf
cmpl $0x48, %eax
jne 0x44d6
movq %rbx, %rdi
movq $-0xc8, %rsi
callq 0x43d7
jmp 0x44d6
addl $-0x2, 0x3c8(%rbx)
movslq %r14d, %rax
movslq %ebp, %rcx
imulq $0x180, %rax, %rax      # imm = 0x180
addq 0x38(%rbx), %rax
shlq $0x4, %rcx
andw $0x0, 0x2(%rcx,%rax)
popq %rbx
popq %r14
popq %rbp
retq
pushq $-0x32
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x43d7
// File: /workspace/github_c_makefile_star2_O2/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:
cvtsi2sdq 0x8(%rdi), %xmm0
movq %rsi, %rdi
movsd 0x23e2(%rip), %xmm1     # 0x68f8
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvttsd2si %xmm2, %rdx
cvtsi2sd %rdx, %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm0
movsd 0x23be(%rip), %xmm1     # 0x6900
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
testq %rax, %rax
pushq $0xc
popq %rsi
cmovneq %rax, %rsi
leaq -0xc(%rsi), %rcx
cmpq $0xd, %rsi
cmovlq %rsi, %rcx
cmpq $0xc, %rax
leaq 0x23f8(%rip), %rsi      # 0x6968
leaq 0x23f4(%rip), %r9       # 0x696b
cmovlq %rsi, %r9
cvtsi2sd %rax, %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
cvtsi2sd %rax, %xmm0
divsd 0x236e(%rip), %xmm0     # 0x6908
cvttsd2si %xmm0, %r8
leaq 0x23c8(%rip), %rsi      # 0x696e
xorl %eax, %eax
jmp 0x1230
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl %ebx, %r12d
testl %ebx, %ebx
je 0x45fe
pushq $0x1
popq %r13
leaq 0x23bd(%rip), %r8       # 0x6992
leaq 0x2427(%rip), %rdx      # 0x6a03
testb %bpl, %bpl
cmoveq %rdx, %r8
leaq 0x2399(%rip), %rsi      # 0x6983
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x1230
cltq
addq %rax, %r14
jmp 0x4601
xorl %r13d, %r13d
shrq $0x20, %rbx
testl %r15d, %r15d
je 0x464a
testl %r12d, %r12d
leaq 0x23ef(%rip), %rax      # 0x6a03
leaq 0x2374(%rip), %rdx      # 0x698f
cmoveq %rax, %rdx
leaq 0x236c(%rip), %r8       # 0x6992
testb %bpl, %bpl
cmoveq %rax, %r8
leaq 0x2363(%rip), %rsi      # 0x6997
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1230
cltq
addq %rax, %r14
pushq $0x1
popq %r13
testq %rbx, %rbx
jne 0x465e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r13d, %r13d
leaq 0x239b(%rip), %rax      # 0x6a03
leaq 0x2320(%rip), %rdx      # 0x698f
cmoveq %rax, %rdx
leaq 0x2318(%rip), %r8       # 0x6992
testb %bpl, %bpl
cmoveq %rax, %r8
leaq 0x231b(%rip), %rsi      # 0x69a3
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1230
// File: /workspace/github_c_makefile_star2_O2/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:
leaq 0x8(%rsp), %rcx
movslq 0x3c8(%rdi), %rax
xorl %r8d, %r8d
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
addq $0x398, %rdi            # imm = 0x398
movq %r8, %rdx
cmpq %r8, %rsi
je 0x46fb
leaq 0x34(%rdi), %r9
leaq 0x1(%rdx), %r8
cmpb $0x0, 0x34(%rdi)
movq %r9, %rdi
jne 0x46c2
movl 0x30(%rcx), %esi
movl %esi, 0x30(%r9)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%r9)
movups %xmm1, 0x10(%r9)
movups %xmm0, (%r9)
cmpq %rax, %rdx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x7
popq %rcx
testl %ecx, %ecx
js 0x4721
movl %ecx, %edx
movl 0x1dcc(%rdi,%rdx,4), %eax
decl %ecx
testl %eax, %eax
je 0x4705
andl $0x0, 0x1dcc(%rdi,%rdx,4)
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
cmpl $0x2b, %edi
je 0x4e65
pushq $0x2
popq %rax
cmpl $0x43, %edi
je 0x4e86
cmpl $0x46, %edi
je 0x4e74
cmpl $0x48, %edi
je 0x4e3f
cmpl $0x4d, %edi
je 0x4e5b
cmpl $0x53, %edi
je 0x4e4d
cmpl $0x57, %edi
jne 0x4e6e
pushq $0x5
popq %rdx
xorl %eax, %eax
jmp 0x4e61
xorl %edx, %edx
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
jmp 0x4e82
xorl %eax, %eax
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
jmp 0x4e80
pushq $-0x1
popq %rdx
pushq $0x5
popq %rax
xorl %ecx, %ecx
jmp 0x4e82
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4e80
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x4e80
xorl %eax, %eax
movabsq $0x400000000, %rcx      # imm = 0x400000000
xorl %edx, %edx
orq %rcx, %rax
retq
pushq $0x2
popq %rdx
movabsq $0x200000000, %rcx      # imm = 0x200000000
jmp 0x4e82
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movw $0x41, %r15w
xorl %r12d, %r12d
movl $0x301, %r13d           # imm = 0x301
cmpq $0x280, %r12            # imm = 0x280
je 0x4f07
cmpb $0x1, 0x48(%r14,%r12)
jne 0x4efe
cmpb $0x0, 0x68(%r14,%r12)
movl $0x10001, %ecx          # imm = 0x10001
cmovnel %r13d, %ecx
movl %r15d, %eax
testb %bpl, %bpl
jne 0x4ee4
movzwl 0x5c(%r14,%r12), %eax
cvttss2si 0x4c(%r14,%r12), %esi
cvttss2si 0x50(%r14,%r12), %edx
movzwl %ax, %r8d
movq %rbx, %rdi
callq 0x2ea2
incl %r15d
addq $0x28, %r12
jmp 0x4eb6
movw $0x41, %bp
xorl %r15d, %r15d
movdqa 0x19ca(%rip), %xmm2     # 0x68e0
cmpq $0x100, %r15            # imm = 0x100
je 0x4f78
cmpl $0x0, 0x2d4(%r14,%r15)
je 0x4f70
movsd 0x2c8(%r14,%r15), %xmm0
cvttps2dq %xmm0, %xmm0
pshufd $0x50, %xmm0, %xmm1     # xmm1 = xmm0[0,0,1,1]
pcmpeqd %xmm2, %xmm1
movmskpd %xmm1, %eax
cmpl $0x3, %eax
je 0x4f70
movd %xmm0, %esi
pshufd $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movd %xmm0, %edx
movzwl %bp, %r8d
movq %rbx, %rdi
movl $0x1000500, %ecx        # imm = 0x1000500
callq 0x2ea2
movdqa 0x1970(%rip), %xmm2     # 0x68e0
incl %ebp
addq $0x10, %r15
jmp 0x4f16
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq %rsi, 0x40(%rsp)
movsd 0x4(%rsi), %xmm0
cvttps2dq %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movss 0x19ad(%rip), %xmm0     # 0x6960
movss 0x19a1(%rip), %xmm1     # 0x695c
callq 0x51f5
movaps %xmm0, 0x20(%rsp)
cvtdq2ps 0x30(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movss 0x1989(%rip), %xmm0     # 0x6960
movss 0x197d(%rip), %xmm1     # 0x695c
callq 0x51f5
movaps 0x20(%rsp), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
addps 0x10(%rsp), %xmm1
cvttps2dq %xmm1, %xmm0
movaps %xmm0, 0x10(%rsp)
movdqa 0x30(%rsp), %xmm1
pshufd $0x55, %xmm1, %xmm0     # xmm0 = xmm1[1,1,1,1]
movd %xmm0, %eax
movq %rax, 0x48(%rsp)
movd %xmm1, %r13d
movd 0x1949(%rip), %xmm0     # 0x6964
movd %xmm0, 0x20(%rsp)
pushq $-0xa
popq %rax
movl %eax, %ebx
cmpl $0xb, %ebx
je 0x50f1
movq 0x48(%rsp), %rax
addl %ebx, %eax
cvtsi2ss %eax, %xmm0
cvttss2si %xmm0, %ebp
mulss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movd %ebp, %xmm0
movdqa %xmm0, 0x50(%rsp)
pushq $-0xa
popq %rax
movl %eax, %r12d
cmpl $0xb, %r12d
je 0x50ea
leal (%r12,%r13), %eax
cvtsi2ss %eax, %xmm0
movq 0x38(%r14), %rdi
movss %xmm0, 0x30(%rsp)
cvttss2si %xmm0, %r15d
movl %r15d, %esi
movl %ebp, %edx
callq 0x3f99
testw %ax, %ax
je 0x50e2
movss 0x30(%rsp), %xmm2
mulss %xmm2, %xmm2
addss 0xc(%rsp), %xmm2
xorl %eax, %eax
movss 0x20(%rsp), %xmm0
ucomiss %xmm2, %xmm0
seta %al
minss %xmm0, %xmm2
movd %eax, %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
pslld $0x1f, %xmm0
psrad $0x1f, %xmm0
movd %r15d, %xmm1
punpckldq 0x50(%rsp), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
pand %xmm0, %xmm1
pandn 0x10(%rsp), %xmm0
por %xmm1, %xmm0
movss %xmm2, 0x20(%rsp)
movdqa %xmm0, 0x10(%rsp)
incl %r12d
jmp 0x5058
incl %ebx
jmp 0x5026
cvtdq2ps 0x10(%rsp), %xmm0
movq 0x40(%rsp), %rax
movlps %xmm0, 0xc(%rax)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x8
popq %rbp
movq %rsp, %r12
testq %rbx, %rbx
je 0x518f
movq %r15, %rdi
callq 0x5110
movq %rax, (%rsp)
cmpq $0x8, %rbx
movq %rbp, %r13
cmovbq %rbx, %r13
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1180
subq %r13, %rbx
addq %r13, %r14
jmp 0x515d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/rand.c
// Function: rand_name
void
rand_name(char *name, size_t max)
{
    /* This thing sucks ... */
    const char *vowels = "aeiou";
    const char *consonants = "bcdfghjklmnpqrstvwxyz";
    int length = rand_range(6, max);
    int spaces = 0;
    int letters = 0;
    for (int i = 0; i < length; i++) {
        float spacep = letters / 3.0f * powf(0.1f, 1.0f / (10 * spaces + 1));
        if (i > 0 && rand_uniform(0, 1.0) < spacep) {
            name[i] = ' ';
            letters = 0;
        } else {
            if (i % 2)
                name[i] = consonants[rand_range(0, strlen(consonants))];
            else
                name[i] = vowels[rand_range(0, strlen(vowels))];
            if (letters == 0)
                name[i] = toupper((int)name[i]);
            letters++;
        }
    }
    name[length] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x6
popq %rdi
callq 0x5222
xorl %r14d, %r14d
testl %eax, %eax
movl $0x0, %r15d
movl %eax, (%rsp)
cmovgl %eax, %r15d
pushq $0x5
popq %r13
xorl %ebp, %ebp
cmpq %r14, %r15
je 0x52ef
testq %r14, %r14
je 0x52bc
cvtsi2ss %ebp, %xmm0
divss 0x173e(%rip), %xmm0     # 0x69b8
mulss 0x173a(%rip), %xmm0     # 0x69bc
movss %xmm0, 0x4(%rsp)
xorps %xmm0, %xmm0
movss 0x1519(%rip), %xmm1     # 0x67ac
callq 0x51f5
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x52ac
movb $0x20, (%rbx,%r14)
xorl %ebp, %ebp
jmp 0x52e7
pushq $0x15
popq %rsi
leaq 0x1710(%rip), %r12      # 0x69c6
testb $0x1, %r14b
jne 0x52c6
movl %r13d, %esi
leaq 0x16fa(%rip), %r12      # 0x69c0
xorl %edi, %edi
callq 0x5222
cltq
movsbl (%r12,%rax), %edi
movb %dil, (%rbx,%r14)
testl %ebp, %ebp
jne 0x52e5
callq 0x1050
movb %al, (%rbx,%r14)
incl %ebp
incq %r14
jmp 0x5260
movslq (%rsp), %rax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_init
void
device_init(void)
{
    printf("\e[2J");
    tcgetattr(STDIN_FILENO, &termios_orig);
    struct termios raw;
    memcpy(&raw, &termios_orig, sizeof(raw));
    raw.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
    raw.c_oflag &= ~OPOST;
    raw.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
    raw.c_cflag &= ~(CSIZE|PARENB);
    raw.c_cflag |= CS8;
    tcsetattr(STDIN_FILENO, TCSANOW, &raw);
    fputs("\e[?25l", stdout);
}

// Assembly:
subq $0x48, %rsp
leaq 0x16c9(%rip), %rdi      # 0x69dc
xorl %eax, %eax
callq 0x10c0
leaq 0xdecf(%rip), %rsi      # 0x131f0
xorl %edi, %edi
callq 0x11f0
movups 0xdec1(%rip), %xmm0     # 0x131f0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movups 0xdee0(%rip), %xmm0     # 0x1321c
movups %xmm0, 0x2c(%rdx)
movups 0xdec9(%rip), %xmm0     # 0x13210
movaps %xmm0, 0x20(%rdx)
movups 0xdeae(%rip), %xmm0     # 0x13200
movaps %xmm0, 0x10(%rdx)
movabsq $-0x1000005ec, %rax     # imm = 0xFFFFFFFEFFFFFA14
andq %rax, (%rdx)
andl $0xffff7fb4, 0xc(%rdx)  # imm = 0xFFFF7FB4
movl $0xfffffecf, %eax       # imm = 0xFFFFFECF
andl 0x8(%rdx), %eax
orl $0x30, %eax
movl %eax, 0x8(%rdx)
xorl %edi, %edi
xorl %esi, %esi
callq 0x1200
movq 0x4c58(%rip), %rax      # 0x9fe0
movq (%rax), %rsi
leaq 0x164f(%rip), %rdi      # 0x69e1
callq 0x10f0
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_move
void
device_move(int x, int y)
{
    cursor_x = x;
    cursor_y = y;
    device_font_last = (font_t)FONT_INVALID;
    printf("\e[%d;%dH", y + 1, x + 1);
}

// Assembly:
movl %edi, 0xde6c(%rip)      # 0x1322c
movl %esi, 0xde6a(%rip)      # 0x13230
movl $0x101ffff, 0x7490(%rip) # imm = 0x101FFFF
incl %esi
leal 0x1(%rdi), %edx
leaq 0x160c(%rip), %rdi      # 0x69e8
xorl %eax, %eax
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_cursor_get
void
device_cursor_get(int *x, int *y)
{
    if (x)
        *x = cursor_x;
    if (y)
        *y = cursor_y;
}

// Assembly:
testq %rdi, %rdi
je 0x53f0
movl 0xde3e(%rip), %eax      # 0x1322c
movl %eax, (%rdi)
testq %rsi, %rsi
je 0x53fd
movl 0xde35(%rip), %eax      # 0x13230
movl %eax, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_putc
void
device_putc(font_t font, uint16_t c)
{
    uint8_t utf8[7];
    utf8[utf32_to_8(c, utf8)] = '\0';
    if (font_equal(device_font_last, font))
        fputs((char *)utf8, stdout);
    else
        printf("\e[%d;%dm%s",
               font.fore + 30 + (font.fore_bright ? 60 : 0),
               font.back + 40 + (font.back_bright ? 60 : 0),
               (char *)utf8);
    device_font_last = font;
    cursor_x++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %ebp
shrl $0x8, %ebp
cmpw $0x7f, %si
ja 0x5419
leaq 0x2(%rsp), %rax
jmp 0x5456
cmpw $0x7ff, %si             # imm = 0x7FF
ja 0x542f
leaq 0x3(%rsp), %rax
movl %esi, %ecx
shrl $0x6, %ecx
orb $-0x40, %cl
jmp 0x544b
leaq 0x4(%rsp), %rax
movzwl %si, %ecx
movl %ecx, %edx
shrl $0xc, %edx
orb $-0x20, %dl
movb %dl, -0x3(%rax)
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, -0x2(%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, -0x1(%rax)
movl %ebx, %r14d
shrl $0x10, %r14d
movl %ebx, %r15d
shrl $0x18, %r15d
movb $0x0, (%rax)
movl 0x73ef(%rip), %edx      # 0xc860
movl %ebx, %edi
andl $0xffff0000, %edi       # imm = 0xFFFF0000
movl $0xff, %ecx
movl %ebp, %eax
andl %ecx, %eax
movl %eax, %esi
shll $0x8, %esi
orl %edi, %esi
andl %ebx, %ecx
orl %ecx, %esi
xorl %edx, %esi
testw %si, %si
je 0x54ed
leal 0x3c(%rcx), %esi
testb $0x1, %r14b
cmovel %ecx, %esi
addl $0x1e, %esi
leal 0x3c(%rax), %edx
testb $0x1, %r15b
cmovel %eax, %edx
addl $0x28, %edx
leaq 0x153c(%rip), %rdi      # 0x69f1
leaq 0x1(%rsp), %rcx
xorl %eax, %eax
callq 0x10c0
movb %bl, 0x7399(%rip)       # 0xc860
movb %bpl, 0x7393(%rip)      # 0xc861
movb %r14b, 0x738d(%rip)     # 0xc862
movb %r15b, 0x7387(%rip)     # 0xc863
incl 0xdd4a(%rip)            # 0x1322c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
andl %ebx, %edx
btl $0x18, %edx
jae 0x5494
andl $0x10000, %esi          # imm = 0x10000
jne 0x5494
movq 0x4adc(%rip), %rax      # 0x9fe0
movq (%rax), %rsi
leaq 0x1(%rsp), %rdi
callq 0x10f0
jmp 0x54c1
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_getch
int
device_getch(void)
{
    int r;
    unsigned char c;
    if ((r = read(STDIN_FILENO, &c, sizeof(c))) < 0) {
        return r;
    } else if (c == '\e') {
        if (!device_kbhit(0))
            return c;
        unsigned char code[2];
        read(STDIN_FILENO, code, sizeof(code));
        return code[1] + 256;
    } else {
        if (c == 3) {
            /* SIGINT */
            device_free();
            exit(EXIT_FAILURE);
        }
        return c;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xd(%rsp), %rsi
pushq $0x1
popq %rdx
xorl %edi, %edi
callq 0x1150
testl %eax, %eax
js 0x5581
movzbl 0xd(%rsp), %eax
cmpl $0x1b, %eax
je 0x5556
cmpl $0x3, %eax
jne 0x5581
callq 0x539c
pushq $0x1
popq %rdi
callq 0x1240
xorl %edi, %edi
callq 0x5587
testb %al, %al
je 0x557e
leaq 0xe(%rsp), %rbx
pushq $0x2
popq %rdx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x1150
movzbl 0x1(%rbx), %eax
orl $0x100, %eax            # imm = 0x100
jmp 0x5581
pushq $0x1b
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_kbhit
bool
device_kbhit(uint64_t useconds)
{
    struct timeval tv = {useconds / 1000000, useconds % 1000000};
    fd_set fds;
    FD_ZERO(&fds);
    FD_SET(STDIN_FILENO, &fds);
    return select(1, &fds, NULL, NULL, &tv) > 0;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, %rax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
xorl %ecx, %ecx
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
cmpq $0x10, %rcx
je 0x55b8
andq $0x0, 0x18(%rsp,%rcx,8)
incq %rcx
jmp 0x55a7
leaq 0x18(%rsp), %rsi
orb $0x1, (%rsi)
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1190
testl %eax, %eax
setg %al
addq $0x98, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]goblin-com/src/device_unix.c
// Function: device_entropy
void
device_entropy(void *buffer, size_t size)
{
    FILE *in = fopen("/dev/urandom", "r");
    if (in == NULL || fread(buffer, size, 1, in) != 1) {
        /* Fallback */
        uint32_t pid = getpid();
        uint64_t state = device_uepoch() ^ (pid < 32);
        xorshift_fill(&state, buffer, size);
    }
    if (in)
        fclose(in);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x13a0(%rip), %rdi      # 0x6a04
leaq 0xdb8(%rip), %rsi       # 0x6423
callq 0x1210
testq %rax, %rax
je 0x56c1
movq %rax, %r15
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rcx
callq 0x1080
cmpq $0x1, %rax
je 0x56b7
callq 0x10a0
movl %eax, %ebp
callq 0x55de
xorl %ecx, %ecx
cmpl $0x20, %ebp
setb %cl
xorq %rax, %rcx
movq %rsp, %rdi
movq %rcx, (%rdi)
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5143
movq %r15, %rdi
callq 0x10b0
jmp 0x56e9
callq 0x10a0
movl %eax, %ebp
callq 0x55de
xorl %ecx, %ecx
cmpl $0x20, %ebp
setb %cl
xorq %rax, %rcx
movq %rsp, %rdi
movq %rcx, (%rdi)
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5143
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/aes_round_6.h
// Function: AES_set_encrypt_key_6
int AES_set_encrypt_key_6(const unsigned char *userKey, const int bits,
			AES_KEY *key) {

	u32 *rk;
   	int i = 0;
	u32 temp;

	if (!userKey || !key)
		return -1;
	if (bits != 128 )
		return -2;

	rk = key->rd_key;

	key->rounds = 6;
	
	rk[0] = GETU32(userKey     );
	rk[1] = GETU32(userKey +  4);
	rk[2] = GETU32(userKey +  8);
	rk[3] = GETU32(userKey + 12);
	while (1) {
		temp  = rk[3];
		rk[4] = rk[0] ^
			(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
			(Te3[(temp >>  8) & 0xff] & 0x00ff0000) ^
			(Te0[(temp      ) & 0xff] & 0x0000ff00) ^
			(Te1[(temp >> 24)       ] & 0x000000ff) ^
			rcon[i];
		rk[5] = rk[1] ^ rk[4];
		rk[6] = rk[2] ^ rk[5];
		rk[7] = rk[3] ^ rk[6];
		if (++i == 6) {
			return 0;
		}
		rk += 4;
	}
	
	return 0;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x1258
cmpl $0x80, %esi
jne 0x125e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl $0x6, 0xf0(%rdx)
movl (%rdi), %ebx
movbel %ebx, (%rdx)
movl 0x4(%rdi), %eax
movbel %eax, 0x4(%rdx)
bswapl %ebx
movl 0x8(%rdi), %eax
movbel %eax, 0x8(%rdx)
movl 0xc(%rdi), %eax
movbel %eax, 0xc(%rdx)
xorl %eax, %eax
leaq 0x1e5b(%rip), %rcx      # 0x3000
movl $0xff, %esi
leaq 0x224f(%rip), %rdi      # 0x3400
leaq 0x2648(%rip), %r8       # 0x3800
leaq 0x2a41(%rip), %r9       # 0x3c00
leaq 0x2e3a(%rip), %r10      # 0x4000
xorl %r11d, %r11d
movl 0xc(%rdx,%r11,4), %ebp
movl %ebp, %r14d
shrl $0xe, %r14d
andl $0x3fc, %r14d           # imm = 0x3FC
movzbl 0x3(%r14,%rcx), %r14d
shll $0x18, %r14d
xorl %ebx, %r14d
movl %ebp, %ebx
shrl $0x8, %ebx
andl %esi, %ebx
movzbl 0x2(%rdi,%rbx,4), %ebx
shll $0x10, %ebx
movl %ebp, %r15d
andl %esi, %r15d
movzbl 0x1(%r8,%r15,4), %r15d
shll $0x8, %r15d
xorl %ebx, %r15d
xorl %r14d, %r15d
movl %ebp, %ebx
shrl $0x18, %ebx
movzbl (%r9,%rbx,4), %ebx
xorl %r15d, %ebx
xorl (%r11,%r10), %ebx
movl %ebx, 0x10(%rdx,%r11,4)
movl 0x4(%rdx,%r11,4), %r14d
xorl %ebx, %r14d
movl %r14d, 0x14(%rdx,%r11,4)
xorl 0x8(%rdx,%r11,4), %r14d
movl %r14d, 0x18(%rdx,%r11,4)
xorl %ebp, %r14d
movl %r14d, 0x1c(%rdx,%r11,4)
addq $0x4, %r11
cmpq $0x18, %r11
jne 0x11c9
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/module.h
// Function: is_equal_block
int is_equal_block(block blk1, block blk2){
	int i; 
	for(i=0; i<16; i++){
		if(blk1[i] != blk2[i]) return -1;
	} 
	return 0;
}

// Assembly:
xorl %eax, %eax
pushq $-0x1
popq %rcx
xorl %edx, %edx
cmpq $0x10, %rdx
je 0x2219
movb (%rdi,%rdx), %r8b
leaq 0x1(%rdx), %r9
cmpb (%rsi,%rdx), %r8b
movq %r9, %rdx
je 0x2200
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/module.h
// Function: mult_inv2
static void mult_inv2(block b, block s) {int i; block d; unsigned char temp = s[15]&1;
   	for (i=1; i<16; i++)	{d[i] = (s[i-1] << 7) | (s[i] >> 1) ;}
   	d[0] = (s[0] >> 1); if(temp==1){d[15] ^= 0x43; d[0] ^= 0x80;}
	copy_block(b,d);}

// Assembly:
subq $0x18, %rsp
movb 0xf(%rsi), %al
pushq $0x1
popq %rcx
cmpq $0x10, %rcx
je 0x25a6
movb -0x1(%rsi,%rcx), %dl
movb (%rsi,%rcx), %r8b
shrb %r8b
shlb $0x7, %dl
orb %r8b, %dl
movb %dl, (%rsp,%rcx)
incq %rcx
jmp 0x2587
movb (%rsi), %cl
shrb %cl
movb %cl, (%rsp)
testb $0x1, %al
je 0x25bc
xorb $0x43, 0xf(%rsp)
orb $-0x80, %cl
movb %cl, (%rsp)
movq %rsp, %rsi
callq 0x2701
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/encrypt.c
// Function: process_AD
static void process_AD(
	block W, block Delta_1, const block npub, block param, 
	const u8 *ad, u64 adlen) {	

	block Delta_2, blk, result;
	u8 Is_complete = 1, ozs[16];
	int i; for(i=1; i<16; i++){ozs[i]=0x00;} ozs[0] = 0x80; 

	

	/* ===== make the first block blk based on npub and param ===== */
	load_block(blk, npub, param, 8, 8);
	
	while(1){ 
		
		/* ============= Process the current Block ==================== */
		process_block(Delta_1, Delta_2, result, blk, W, Is_complete, ENCRYPT, 0, AD);
				
		/* === Compute the next Block and updating the pointers and counters ===*/
		if(adlen==0) break; 
		
		else if(adlen <= 16) {
			load_block(blk, ad, ozs, adlen, 16-adlen); 
			if(adlen != 16) Is_complete = 0;
			adlen = 0; 
		}

		else {load_block(blk, ad, ozs, 16, 0); ad +=16; adlen -=16;}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r12
movq %r8, %rbx
movq %rsi, 0x18(%rsp)
movq %rdi, %r15
pushq $0x1
popq %rax
cmpq $0x10, %rax
je 0x25f7
movb $0x0, (%rsp,%rax)
incq %rax
jmp 0x25e8
movq %rsp, %rax
movb $-0x80, (%rax)
leaq 0x30(%rsp), %rbp
pushq $0x8
popq %r8
movq %rbp, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movl %r8d, %ecx
callq 0x26b4
movb $0x1, %r14b
subq $0x8, %rsp
movzbl %r14b, %r13d
movq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbp, %rcx
movq %r15, %r8
movl %r13d, %r9d
pushq $0x0
pushq $0x0
pushq $0x1
callq 0x2715
addq $0x20, %rsp
testq %r12, %r12
je 0x26a5
cmpq $0x10, %r12
ja 0x2684
movb $0x10, %al
subb %r12b, %al
movzbl %al, %r8d
movzbl %r12b, %ecx
movq %rbp, %rdi
movq %rbx, %rsi
movq %rsp, %rdx
callq 0x26b4
cmpq $0x10, %r12
movl $0x0, %eax
cmovnel %eax, %r13d
xorl %r12d, %r12d
movl %r13d, %r14d
jmp 0x261a
movq %rbp, %rdi
movq %rbx, %rsi
movq %rsp, %rdx
pushq $0x10
popq %rcx
xorl %r8d, %r8d
callq 0x26b4
addq $0x10, %rbx
addq $-0x10, %r12
jmp 0x261a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/module.h
// Function: process_block
static void process_block(
	block Delta_1, block Delta_2, 
	block result, const block in_blk, block W,
	u8 Is_complete, u8 Is_Encrypt, u8 Is_final,  u8 type_block) {

	block YY, XX, Y, X; 
	int i;
	
	/* ==============   Mask  ================= */
	if(type_block == AD || type_block == MESSAGE)
		mask(Delta_1, XX, in_blk, Is_complete);	
	else
		mask(Delta_1, XX, in_blk, 1);	

	/* ==============  AES Encrypt =============== */
	if(type_block == AD)  { AES(rd, ENCRYPT, X, XX, &aes_key1); } 
	if(type_block == MESSAGE) { AES(rd, ENCRYPT, X, XX, &aes_key1); }				
	if(type_block == CIPHERTEXT){  AES(rd, ENCRYPT, X, XX, &aes_key1); } 

	/* ============= Linear Mixing =============== */
	linear_mix(W, Y, X, Is_Encrypt, Is_final);
	
	/* ============= AES Decrypt ================== */
	if(type_block == MESSAGE) {  AES(rd, DECRYPT, YY, Y, &aes_key2); }   
	if(type_block == CIPHERTEXT){  AES(rd, DECRYPT, YY, Y, &aes_key2); }
	
	/* =============== Mask ======================= */
	if(type_block == MESSAGE)
		mask(Delta_2, result, YY, 1);	
	if(type_block == CIPHERTEXT)
		mask(Delta_2, result, YY, Is_complete);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r15
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movb 0xb0(%rsp), %r13b
movb 0xa8(%rsp), %r14b
movb 0xa0(%rsp), %bl
movzbl %r9b, %ebp
cmpb $0x2, %r13b
setae %r12b
leaq 0x40(%rsp), %rsi
jb 0x2772
pushq $0x1
popq %rax
movq %rcx, %rdx
movl %eax, %ecx
callq 0x2cd4
cmpb $0x2, %r13b
je 0x277c
xorl %r12d, %r12d
jmp 0x2792
movq %rcx, %rdx
movl %ebp, %ecx
callq 0x2cd4
movq 0x484d(%rip), %rdx      # 0x6fd0
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1050
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x2540
movq %rsp, %rdi
movq %r15, %rsi
callq 0x2c85
xorb $0x1, %r14b
movl %ebx, %eax
orb %r14b, %al
jne 0x27ba
xorb $0x1, 0x2f(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x289a
movl %ebx, %eax
xorb $0x1, %al
orb %r14b, %al
jne 0x27de
xorb $0x1, 0x3f(%rsp)
jmp 0x27e7
cmpb $0x1, %bl
jne 0x286d
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rdi
callq 0x289a
cmpb $0x1, %r13b
jne 0x2811
movq 0x47dc(%rip), %rdx      # 0x6fe0
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x1040
testb %r12b, %r12b
je 0x282a
movq 0x47c3(%rip), %rdx      # 0x6fe0
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x1040
cmpb $0x1, %r13b
jne 0x2845
movq %rsp, %rdx
pushq $0x1
popq %rcx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x2cd4
testb %r12b, %r12b
je 0x285e
movq %rsp, %rdx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl %ebp, %ecx
callq 0x2cd4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %bl, %bl
jne 0x27f7
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
movq %r15, %rdx
jmp 0x27f2
// File: /workspace/github_c_makefile_star2_O2/mjosaarinen[P]brutus/crypto_aead/elmd1001v2/ref/module.h
// Function: mult_2
static void mult_2(block b, block s) {int i; block d; unsigned char temp = s[0]>>7;
   	for (i=0; i<15; i++)	{d[i] = (s[i] << 1) | (s[i+1] >> 7);}
 	d[15] = (s[15] << 1); if(temp==1){d[15] ^= alpha_128;} 
	copy_block(b,d);}

// Assembly:
subq $0x18, %rsp
movb (%rsi), %al
xorl %ecx, %ecx
movl %eax, %edx
cmpq $0xf, %rcx
je 0x2cb1
movb 0x1(%rsi,%rcx), %r8b
movl %r8d, %r9d
shrb $0x7, %r9b
addb %dl, %dl
orb %r9b, %dl
movb %dl, (%rsp,%rcx)
incq %rcx
movl %r8d, %edx
jmp 0x2c8f
movb 0xf(%rsi), %cl
addb %cl, %cl
movzbl %cl, %edx
xorb $-0x79, %cl
testb %al, %al
movzbl %cl, %eax
cmovnsl %edx, %eax
movq %rsp, %rsi
movb %al, 0xf(%rsi)
callq 0x2701
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/sh.c
// Function: hashmap_standalone_hash
size_t hashmap_standalone_hash(char *inp){
    size_t output = 0;
    size_t i = 0;
    size_t l = strlen(inp);
    while((i + 1) <= l){
        output = output*17 + inp[i++];
    }
    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1090
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rax, %rdx
jae 0x12b4
imulq $0x11, %rcx, %rsi
movsbq (%rbx,%rdx), %rcx
incq %rdx
addq %rsi, %rcx
jmp 0x129e
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/sh.c
// Function: hashmap_hash
size_t hashmap_hash(hashmap_t *hm, char *inp){
    size_t output = 0;
    size_t i = 0;
    size_t l = strlen(inp);
    while((i + 1) <= l){
        output = output*17 + inp[i++];
    }
    return output % hm->size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x1090
xorl %edx, %edx
xorl %ecx, %ecx
cmpq %rax, %rdx
jae 0x12ed
imulq $0x11, %rcx, %rsi
movsbq (%r14,%rdx), %rcx
incq %rdx
addq %rsi, %rcx
jmp 0x12d7
movq %rcx, %rax
xorl %edx, %edx
divq (%rbx)
movq %rdx, %rax
popq %rbx
popq %r14
popq %rbp
retq