// File: /workspace/github_c_makefile_star2_O0/pedro-onate[P]eva/eva.c
// Function: env_reserve_loc
static int env_reserve_loc(es_ctx_t* ctx, es_val_t env, es_val_t sym, es_val_t init)
{
  int loc = es_env_loc(env, sym);
  if (loc > -1) {
    if (es_is_unbound(es_env_val_of(env, loc))) {
      env_set_val(env, loc, init);
    }
    return loc;
  }

  int size  = es_env_size(env);
  size_t count = es_env_count(env);

  if (count >= size) {
    int new_size = (size << 1) + size;
    gc_root3(ctx, env, sym, init);

    es_val_t new_env = es_make_env(ctx, new_size);

    for(int i = 0; i < count; i++) {
      es_env_val(new_env)->slots[i].sym = es_env_val(env)->slots[i].sym;
      es_env_val(new_env)->slots[i].val = es_env_val(env)->slots[i].val;
      es_env_val(new_env)->count++;
    }

    gc_unroot(ctx, 3);

    ctx->env = new_env;
    env = new_env;
  }

  es_env_val(env)->slots[es_env_val(env)->count].sym = sym;
  es_env_val(env)->slots[es_env_val(env)->count].val = init;
  return es_env_val(env)->count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x37f0
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jle 0x34b5
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x7190
movq %rax, %rdi
callq 0x3010
cmpl $0x0, %eax
je 0x34aa
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x71c0
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x36d7
movq -0x18(%rbp), %rdi
callq 0x7200
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7220
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpq %rcx, %rax
jb 0x3646
movl -0x30(%rbp), %eax
shll %eax
addl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movl 0x2040(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x2040(%rdx)
movslq %ecx, %rcx
leaq -0x18(%rbp), %rdx
movq %rdx, 0x40(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movl 0x2040(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x2040(%rdx)
movslq %ecx, %rcx
leaq -0x20(%rbp), %rdx
movq %rdx, 0x40(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rdx
movl 0x2040(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x2040(%rdx)
movslq %ecx, %rcx
leaq -0x28(%rbp), %rdx
movq %rdx, 0x40(%rax,%rcx,8)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x33b0
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movslq -0x4c(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x361c
movq -0x18(%rbp), %rdi
callq 0x7240
addq $0x18, %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rdi
callq 0x7240
movq -0x60(%rbp), %rcx
addq $0x18, %rax
movslq -0x4c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x7240
addq $0x18, %rax
movslq -0x4c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rdi
callq 0x7240
movq -0x58(%rbp), %rcx
addq $0x18, %rax
movslq -0x4c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rdi
callq 0x7240
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x3570
movq -0x10(%rbp), %rax
movl 0x2040(%rax), %ecx
subl $0x3, %ecx
movl %ecx, 0x2040(%rax)
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x42080(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7240
addq $0x18, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7240
movq -0x80(%rbp), %rcx
movq %rax, %rdx
movq -0x78(%rbp), %rax
movslq 0x10(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7240
addq $0x18, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7240
movq -0x70(%rbp), %rcx
movq %rax, %rdx
movq -0x68(%rbp), %rax
movslq 0x10(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x7240
movq %rax, %rcx
movl 0x10(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x10(%rcx)
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)