// File: /workspace/github_c_makefile_star2_O0/jiribenes[P]scheme/src/core.c
// Function: scm_env_default
env_t *scm_env_default(vm_t *vm) {
    env_t *env = env_new(vm, NIL_VAL, NULL);
    vm->top_env = env;

    /* numeric functions */
    symbol_t *pi_sym = symbol_intern(vm, "pi", 2);
    variable_add(vm, env, pi_sym, NUM_VAL(3.14159265358979323846));
    primitive_add(vm, env, "builtin+", 8, builtin_add);
    primitive_add(vm, env, "builtin*", 8, builtin_mul);
    primitive_add(vm, env, "builtin-", 8, builtin_sub);
    primitive_add(vm, env, "builtin/", 8, builtin_div);
    primitive_add(vm, env, "remainder", 9, builtin_rem);

    primitive_add(vm, env, "builtin>", 8, builtin_num_gt);
    primitive_add(vm, env, "builtin<", 8, builtin_num_lt);
    primitive_add(vm, env, "builtin=", 8, builtin_num_eq);

    /* types and predicates */
    primitive_add(vm, env, "eq?", 3, eq);
    primitive_add(vm, env, "equal?", 6, equal);

    primitive_add(vm, env, "cons?", 5, builtin_is_cons);
    primitive_add(vm, env, "integer?", 8, builtin_is_integer);
    primitive_add(vm, env, "number?", 7, builtin_is_number);
    primitive_add(vm, env, "string?", 7, builtin_is_string);
    primitive_add(vm, env, "symbol?", 7, builtin_is_symbol);
    primitive_add(vm, env, "procedure?", 10, builtin_is_procedure);
    primitive_add(vm, env, "vector?", 7, builtin_is_vector);
    primitive_add(vm, env, "environment?", 12, builtin_is_environment);
    primitive_add(vm, env, "void", 4, builtin_void);
    primitive_add(vm, env, "undefined", 9, builtin_undefined);
    symbol_t *eof_sym = symbol_intern(vm, "eof", 3);
    variable_add(vm, env, eof_sym, EOF_VAL);

    /* special constructs - flow control */
    primitive_add(vm, env, "begin", 5, begin);
    primitive_add(vm, env, "define", 6, builtin_define);
    primitive_add(vm, env, "lambda", 6, lambda);
    primitive_add(vm, env, "if", 2, builtin_if);
    primitive_add(vm, env, "set!", 4, builtin_set);
    primitive_add(vm, env, "let", 3, builtin_let);

    /* I/O */
    primitive_add(vm, env, "write", 5, builtin_write);
    primitive_add(vm, env, "display", 7, builtin_display);
    primitive_add(vm, env, "newline", 7, builtin_newline);
    primitive_add(vm, env, "read", 4, builtin_read);
    if (vm->config.load_fn != NULL) {
        primitive_add(vm, env, "load", 4, builtin_load);
    }

    /* or/and */
    primitive_add(vm, env, "or", 2, builtin_or);
    primitive_add(vm, env, "and", 3, builtin_and);

    /* macros, eval */
    primitive_add(vm, env, "define-macro", 12, define_macro);
    primitive_add(vm, env, "eval", 4, builtin_eval);
    primitive_add(vm, env, "apply", 5, builtin_apply);
    primitive_add(vm, env, "expand", 6, builtin_expand);
    primitive_add(vm, env, "gensym", 6, builtin_gensym);
    primitive_add(vm, env, "quote", 5, quote);

    /* list functions */
    primitive_add(vm, env, "cons", 4, builtin_cons);
    primitive_add(vm, env, "car", 3, builtin_car);
    primitive_add(vm, env, "cdr", 3, builtin_cdr);
    primitive_add(vm, env, "builtin-length", 14, builtin_length);

    /* vector functions */
    primitive_add(vm, env, "vector-length", 13, builtin_vec_length);
    primitive_add(vm, env, "vector-ref", 10, builtin_vec_ref);
    primitive_add(vm, env, "vector-set!", 11, builtin_vec_set);
    primitive_add(vm, env, "make-vector", 11, builtin_vec_make);

    /* other library functions */
    primitive_add(vm, env, "error", 5, builtin_error);
    primitive_add(vm, env, "current-time", 12, builtin_time);
    primitive_add(vm, env, "exit", 4, builtin_exit);
    primitive_add(vm, env, "hash", 4, builtin_hash);

#ifdef DEBUG
    primitive_add(vm, env, "current-environment", 19, builtin_env_cur);
    primitive_add(vm, env, "top-level-environment", 21, builtin_env_top);
    primitive_add(vm, env, "environment-variables", 21, builtin_env_vars);
    primitive_add(vm, env, "environment-parent", 18, builtin_env_up);

    primitive_add(vm, env, "gc", 2, builtin_gc);
#endif

    // Automatically loads the stdlib if a load function is present
    if (vm->config.load_fn != NULL) {
        vm->config.load_fn(vm, env, "src/stdlib.scm");
    }

    return env;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movabsq $0x7ffc000000000001, %rsi # imm = 0x7FFC000000000001
xorl %eax, %eax
movl %eax, %edx
callq 0x6bb0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x30(%rsp), %rdi
leaq 0x8ce3(%rip), %rsi      # 0xa073
movl $0x2, %edx
callq 0x6c30
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x8c44(%rip), %xmm0     # 0xa008
callq 0x1b20
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
callq 0x7c70
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c86(%rip), %rdx      # 0xa076
movl $0x8, %ecx
leaq 0x744(%rip), %r8        # 0x1b40
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c6d(%rip), %rdx      # 0xa07f
movl $0x8, %ecx
leaq 0x852(%rip), %r8        # 0x1c70
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c54(%rip), %rdx      # 0xa088
movl $0x8, %ecx
leaq 0x960(%rip), %r8        # 0x1da0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c3b(%rip), %rdx      # 0xa091
movl $0x8, %ecx
leaq 0xa6e(%rip), %r8        # 0x1ed0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c22(%rip), %rdx      # 0xa09a
movl $0x9, %ecx
leaq 0xb7c(%rip), %r8        # 0x2000
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8c0a(%rip), %rdx      # 0xa0a4
movl $0x8, %ecx
leaq 0xc8a(%rip), %r8        # 0x2130
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8bf1(%rip), %rdx      # 0xa0ad
movl $0x8, %ecx
leaq 0xda8(%rip), %r8        # 0x2270
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8bd8(%rip), %rdx      # 0xa0b6
movl $0x8, %ecx
leaq 0xec6(%rip), %r8        # 0x23b0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8bbf(%rip), %rdx      # 0xa0bf
movl $0x3, %ecx
leaq 0xfe4(%rip), %r8        # 0x24f0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8ba1(%rip), %rdx      # 0xa0c3
movl $0x6, %ecx
leaq 0x10f2(%rip), %r8       # 0x2620
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b86(%rip), %rdx      # 0xa0ca
movl $0x5, %ecx
leaq 0x1200(%rip), %r8       # 0x2750
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b6a(%rip), %rdx      # 0xa0d0
movl $0x8, %ecx
leaq 0x126e(%rip), %r8       # 0x27e0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b51(%rip), %rdx      # 0xa0d9
movl $0x7, %ecx
leaq 0x132c(%rip), %r8       # 0x28c0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b37(%rip), %rdx      # 0xa0e1
movl $0x7, %ecx
leaq 0x13aa(%rip), %r8       # 0x2960
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b1d(%rip), %rdx      # 0xa0e9
movl $0x7, %ecx
leaq 0x1428(%rip), %r8       # 0x2a00
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8b03(%rip), %rdx      # 0xa0f1
movl $0xa, %ecx
leaq 0x14a6(%rip), %r8       # 0x2aa0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8aec(%rip), %rdx      # 0xa0fc
movl $0x7, %ecx
leaq 0x1544(%rip), %r8       # 0x2b60
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8ad2(%rip), %rdx      # 0xa104
movl $0xc, %ecx
leaq 0x15c2(%rip), %r8       # 0x2c00
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8abd(%rip), %rdx      # 0xa111
movl $0x4, %ecx
leaq 0x1640(%rip), %r8       # 0x2ca0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8aa0(%rip), %rdx      # 0xa116
movl $0x9, %ecx
leaq 0x163e(%rip), %r8       # 0x2cc0
callq 0x7ed0
movq 0x30(%rsp), %rdi
leaq 0x8a8d(%rip), %rsi      # 0xa120
movl $0x3, %edx
callq 0x6c30
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rdx
movabsq $0x7ffc000000000006, %rcx # imm = 0x7FFC000000000006
callq 0x7c70
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8a53(%rip), %rdx      # 0xa124
movl $0x5, %ecx
leaq 0x7283(%rip), %r8       # 0x8960
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8a37(%rip), %rdx      # 0xa12a
movl $0x6, %ecx
leaq 0x15e1(%rip), %r8       # 0x2ce0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8a1c(%rip), %rdx      # 0xa131
movl $0x6, %ecx
leaq 0x183f(%rip), %r8       # 0x2f60
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8a01(%rip), %rdx      # 0xa138
movl $0x2, %ecx
leaq 0x1a6d(%rip), %r8       # 0x31b0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8a6e(%rip), %rdx      # 0xa1c7
movl $0x4, %ecx
leaq 0x1b9b(%rip), %r8       # 0x3300
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x89c0(%rip), %rdx      # 0xa13b
movl $0x3, %ecx
leaq 0x1cb9(%rip), %r8       # 0x3440
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x89a2(%rip), %rdx      # 0xa13f
movl $0x5, %ecx
leaq 0x1fc7(%rip), %r8       # 0x3770
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8986(%rip), %rdx      # 0xa145
movl $0x7, %ecx
leaq 0x2025(%rip), %r8       # 0x37f0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x896c(%rip), %rdx      # 0xa14d
movl $0x7, %ecx
leaq 0x2083(%rip), %r8       # 0x3870
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8952(%rip), %rdx      # 0xa155
movl $0x4, %ecx
leaq 0x20c1(%rip), %r8       # 0x38d0
callq 0x7ed0
movq 0x30(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x1842
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8929(%rip), %rdx      # 0xa15a
movl $0x4, %ecx
leaq 0x2133(%rip), %r8       # 0x3970
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8988(%rip), %rdx      # 0xa1db
movl $0x2, %ecx
leaq 0x2201(%rip), %r8       # 0x3a60
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8905(%rip), %rdx      # 0xa17a
movl $0x3, %ecx
leaq 0x232f(%rip), %r8       # 0x3bb0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x88c8(%rip), %rdx      # 0xa15f
movl $0xc, %ecx
leaq 0x245d(%rip), %r8       # 0x3d00
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x88b3(%rip), %rdx      # 0xa16c
movl $0x4, %ecx
leaq 0x25ab(%rip), %r8       # 0x3e70
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8896(%rip), %rdx      # 0xa171
movl $0x5, %ecx
leaq 0x2669(%rip), %r8       # 0x3f50
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x887a(%rip), %rdx      # 0xa177
movl $0x6, %ecx
leaq 0x26f7(%rip), %r8       # 0x4000
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x885f(%rip), %rdx      # 0xa17e
movl $0x6, %ecx
leaq 0x2735(%rip), %r8       # 0x4060
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8844(%rip), %rdx      # 0xa185
movl $0x5, %ecx
leaq 0x2793(%rip), %r8       # 0x40e0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8828(%rip), %rdx      # 0xa18b
movl $0x4, %ecx
leaq 0x27c1(%rip), %r8       # 0x4130
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x880b(%rip), %rdx      # 0xa190
movl $0x3, %ecx
leaq 0x284f(%rip), %r8       # 0x41e0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x87ed(%rip), %rdx      # 0xa194
movl $0x3, %ecx
leaq 0x28cd(%rip), %r8       # 0x4280
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x87cf(%rip), %rdx      # 0xa198
movl $0xe, %ecx
leaq 0x294b(%rip), %r8       # 0x4320
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x87bc(%rip), %rdx      # 0xa1a7
movl $0xd, %ecx
leaq 0x2999(%rip), %r8       # 0x4390
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x87a8(%rip), %rdx      # 0xa1b5
movl $0xa, %ecx
leaq 0x2a47(%rip), %r8       # 0x4460
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8791(%rip), %rdx      # 0xa1c0
movl $0xb, %ecx
leaq 0x2be5(%rip), %r8       # 0x4620
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x877b(%rip), %rdx      # 0xa1cc
movl $0xb, %ecx
leaq 0x2dd3(%rip), %r8       # 0x4830
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8765(%rip), %rdx      # 0xa1d8
movl $0x5, %ecx
leaq 0x2f41(%rip), %r8       # 0x49c0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8749(%rip), %rdx      # 0xa1de
movl $0xc, %ecx
leaq 0x2fff(%rip), %r8       # 0x4aa0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8734(%rip), %rdx      # 0xa1eb
movl $0x4, %ecx
leaq 0x302d(%rip), %r8       # 0x4af0
callq 0x7ed0
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x8717(%rip), %rdx      # 0xa1f0
movl $0x4, %ecx
leaq 0x310b(%rip), %r8       # 0x4bf0
callq 0x7ed0
movq 0x30(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x1b12
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x86e5(%rip), %rdx      # 0xa1f5
callq *%rax
movq 0x28(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)