// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1df0, %edi           # imm = 0x1DF0
movl $0x1, %esi
callq 0x1170
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x10(%rbp), %rax
movsd 0x34c3(%rip), %xmm0     # 0x9940
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rax
movsd 0x34b2(%rip), %xmm0     # 0x9940
movsd %xmm0, 0x20(%rax)
movq -0x10(%rbp), %rax
movsd 0x3541(%rip), %xmm0     # 0x99e0
movsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rax
movsd 0x3528(%rip), %xmm0     # 0x99d8
movsd %xmm0, 0x30(%rax)
movq -0x10(%rbp), %rax
movss 0x3493(%rip), %xmm0     # 0x9954
movss %xmm0, 0x40(%rax)
movq -0x8(%rbp), %rdi
callq 0x53e0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movw $0x43, 0x2dc2(%rax)
movq -0x10(%rbp), %rax
movl $0x4, 0x3c8(%rax)
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0x6570
movq -0x10(%rbp), %rax
addq $0x2c8, %rax            # imm = 0x2C8
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movss 0x3491(%rip), %xmm0     # 0x99b4
movss %xmm0, (%rax)
movq -0x10(%rbp), %rax
addq $0x2c8, %rax            # imm = 0x2C8
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movss 0x346c(%rip), %xmm0     # 0x99b0
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
addq $0x2c8, %rax            # imm = 0x2C8
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6500
movl $0x0, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x65d8
movq -0x10(%rbp), %rax
addq $0x3cc, %rax            # imm = 0x3CC
movslq -0x18(%rbp), %rcx
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x6370
movq -0x58(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
movl $0x34, %edx
callq 0x1190
movq -0x10(%rbp), %rax
addq $0x3cc, %rax            # imm = 0x3CC
movslq -0x18(%rbp), %rcx
imulq $0x34, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x30(%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6577
movq -0x10(%rbp), %rax
movl $0x2, 0x2d4(%rax)
movq -0x10(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq