// File: /workspace/github_c_makefile_star2_O3/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:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $0x7ffc000000000001, %r15 # imm = 0x7FFC000000000001
movq %r15, %rsi
xorl %edx, %edx
callq 0x4998
movq %rax, %r14
movq %rax, 0x60(%rbx)
leaq 0x4ca0(%rip), %rsi      # 0x60a3
movl $0x2, %edx
movq %rbx, %rdi
callq 0x49da
movabsq $0x400921fb54442d18, %rcx # imm = 0x400921FB54442D18
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x518d
leaq 0x4c77(%rip), %rdx      # 0x60a6
leaq 0x63d(%rip), %r8        # 0x1a73
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4c62(%rip), %rdx      # 0x60af
leaq 0x6c7(%rip), %r8        # 0x1b1b
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4c4d(%rip), %rdx      # 0x60b8
leaq 0x751(%rip), %r8        # 0x1bc3
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4c38(%rip), %rdx      # 0x60c1
leaq 0x7db(%rip), %r8        # 0x1c6b
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4c23(%rip), %rdx      # 0x60ca
leaq 0x865(%rip), %r8        # 0x1d13
movl $0x9, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4c0f(%rip), %rdx      # 0x60d4
leaq 0x8f3(%rip), %r8        # 0x1dbf
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4bfa(%rip), %rdx      # 0x60dd
leaq 0x984(%rip), %r8        # 0x1e6e
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4be5(%rip), %rdx      # 0x60e6
leaq 0xa15(%rip), %r8        # 0x1f1d
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4bd0(%rip), %rdx      # 0x60ef
leaq 0xaaa(%rip), %r8        # 0x1fd0
movl $0x3, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4bb6(%rip), %rdx      # 0x60f3
leaq 0xaf3(%rip), %r8        # 0x2037
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b9f(%rip), %rdx      # 0x60fa
leaq 0xb49(%rip), %r8        # 0x20ab
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b87(%rip), %rdx      # 0x6100
leaq 0xba7(%rip), %r8        # 0x2127
movl $0x8, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b72(%rip), %rdx      # 0x6109
leaq 0xc20(%rip), %r8        # 0x21be
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b5c(%rip), %rdx      # 0x6111
leaq 0xc73(%rip), %r8        # 0x222f
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b46(%rip), %rdx      # 0x6119
leaq 0xcd1(%rip), %r8        # 0x22ab
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b30(%rip), %rdx      # 0x6121
leaq 0xd2f(%rip), %r8        # 0x2327
movl $0xa, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b1d(%rip), %rdx      # 0x612c
leaq 0xd99(%rip), %r8        # 0x23af
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4b07(%rip), %rdx      # 0x6134
leaq 0xdf7(%rip), %r8        # 0x242b
movl $0xc, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4af6(%rip), %rdx      # 0x6141
leaq 0xe55(%rip), %r8        # 0x24a7
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4add(%rip), %rdx      # 0x6146
leaq 0xe42(%rip), %r8        # 0x24b2
movl $0x9, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4ac9(%rip), %rsi      # 0x6150
movl $0x3, %edx
movq %rbx, %rdi
callq 0x49da
addq $0x5, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x518d
leaq 0x4aa4(%rip), %rdx      # 0x6154
leaq 0x4186(%rip), %r8       # 0x583d
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a8c(%rip), %rdx      # 0x615a
leaq 0xde8(%rip), %r8        # 0x24bd
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a75(%rip), %rdx      # 0x6161
leaq 0xebe(%rip), %r8        # 0x25b1
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a5e(%rip), %rdx      # 0x6168
leaq 0xf50(%rip), %r8        # 0x2661
movl $0x2, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4acf(%rip), %rdx      # 0x61f7
leaq 0xfea(%rip), %r8        # 0x2719
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a25(%rip), %rdx      # 0x616b
leaq 0x10a7(%rip), %r8       # 0x27f4
movl $0x3, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a0b(%rip), %rdx      # 0x616f
leaq 0x1291(%rip), %r8       # 0x29fc
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x49f3(%rip), %rdx      # 0x6175
leaq 0x12e1(%rip), %r8       # 0x2a6a
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x49dd(%rip), %rdx      # 0x617d
leaq 0x1331(%rip), %r8       # 0x2ad8
movl $0x7, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x49c7(%rip), %rdx      # 0x6185
leaq 0x1360(%rip), %r8       # 0x2b25
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
cmpq $0x0, 0x30(%rbx)
je 0x17fa
leaq 0x49a7(%rip), %rdx      # 0x618a
leaq 0x13ab(%rip), %r8       # 0x2b95
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4a0a(%rip), %rdx      # 0x620b
leaq 0x1435(%rip), %r8       # 0x2c3d
movl $0x2, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x498b(%rip), %rdx      # 0x61aa
leaq 0x14a9(%rip), %r8       # 0x2ccf
movl $0x3, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4952(%rip), %rdx      # 0x618f
leaq 0x151a(%rip), %r8       # 0x2d5e
movl $0xc, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4941(%rip), %rdx      # 0x619c
leaq 0x1598(%rip), %r8       # 0x2dfa
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4928(%rip), %rdx      # 0x61a1
leaq 0x160a(%rip), %r8       # 0x2e8a
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4910(%rip), %rdx      # 0x61a7
leaq 0x165e(%rip), %r8       # 0x2efc
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x48f9(%rip), %rdx      # 0x61ae
leaq 0x169c(%rip), %r8       # 0x2f58
movl $0x6, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x48e2(%rip), %rdx      # 0x61b5
leaq 0x16f8(%rip), %r8       # 0x2fd2
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x48ca(%rip), %rdx      # 0x61bb
leaq 0x172a(%rip), %r8       # 0x3022
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x48b1(%rip), %rdx      # 0x61c0
leaq 0x1794(%rip), %r8       # 0x30aa
movl $0x3, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4897(%rip), %rdx      # 0x61c4
leaq 0x17f8(%rip), %r8       # 0x312c
movl $0x3, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x487d(%rip), %rdx      # 0x61c8
leaq 0x185c(%rip), %r8       # 0x31ae
movl $0xe, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x486e(%rip), %rdx      # 0x61d7
leaq 0x18a1(%rip), %r8       # 0x3211
movl $0xd, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x485e(%rip), %rdx      # 0x61e5
leaq 0x1919(%rip), %r8       # 0x32a7
movl $0xa, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x484b(%rip), %rdx      # 0x61f0
leaq 0x19e6(%rip), %r8       # 0x3392
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4839(%rip), %rdx      # 0x61fc
leaq 0x1ac2(%rip), %r8       # 0x348c
movl $0xb, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x4827(%rip), %rdx      # 0x6208
leaq 0x1c23(%rip), %r8       # 0x360b
movl $0x5, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x480f(%rip), %rdx      # 0x620e
leaq 0x1ca5(%rip), %r8       # 0x36ab
movl $0xc, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x47fe(%rip), %rdx      # 0x621b
leaq 0x1ccd(%rip), %r8       # 0x36f1
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
leaq 0x47e5(%rip), %rdx      # 0x6220
leaq 0x1d67(%rip), %r8       # 0x37a9
movl $0x4, %ecx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x52ae
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x1a6a
leaq 0x47c3(%rip), %rdx      # 0x6225
movq %rbx, %rdi
movq %r14, %rsi
callq *%rax
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq