// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_load
static s7_pointer g_load(s7_scheme *sc, s7_pointer args)
    {
#define H_load "(load file (env (rootlet))) loads the scheme file 'file'. The 'env' argument \
        defaults to the rootlet.  To load into the current environment instead, pass (curlet)."
#define Q_load s7_make_signature(sc, 3, sc->values_symbol, sc->is_string_symbol, sc->is_let_symbol)

        FILE *fp = NULL;
        s7_pointer name;
        const char *fname;

        name = car(args);
        if (!is_string(name))
            return(method_or_bust(sc, name, sc->load_symbol, args, T_STRING, 1));

        if (is_pair(cdr(args)))
        {
            s7_pointer e;
            e = cadr(args);
            if (!is_let(e))
                return(wrong_type_argument_with_type(sc, sc->load_symbol, 2, e, a_let_string));
            if (e == sc->s7_let)
                return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_2(sc, wrap_string(sc, "can't load ~S into *s7*", 23), name)));
            if (e == sc->rootlet)
                sc->envir = sc->nil;
            else sc->envir = e;
        }
        else sc->envir = sc->nil;

        fname = string_value(name);
        if ((!fname) || (!(*fname)))                 /* fopen("", "r") returns a file pointer?? */
            return(s7_error(sc, sc->out_of_range_symbol, set_elist_2(sc, wrap_string(sc, "load's first argument, ~S, should be a filename", 47), name)));

        if (is_directory(fname))
            return(s7_error(sc, sc->wrong_type_arg_symbol, set_elist_2(sc, wrap_string(sc, "load argument, ~S, is a directory", 33), name)));

#if WITH_C_LOADER
        if (load_shared_object(sc, fname, (is_null(sc->envir)) ? sc->rootlet : sc->envir))
            return(sc->F);
#endif

        fp = fopen(fname, "r");
#if WITH_GCC
        if (!fp) fp = expand_cwd(sc, fname);
#endif
        if (fp)
        {
            if (hook_has_functions(sc->load_hook))
                s7_apply_function(sc, sc->load_hook, list_1(sc, sc->temp6 = s7_make_string(sc, fname)));
        }
        else
        {
            fp = open_file_with_load_path(sc, fname);
            if (!fp) return(file_error(sc, "load", "can't open", fname));
        }
        read_scheme_file(sc, fp, fname);

        push_stack_op_let(sc, OP_LOAD_CLOSE_AND_POP_IF_EOF);  /* was pushing args and code, but I don't think they're used later */
        push_stack_op_let(sc, OP_READ_INTERNAL);

        return(sc->unspecified);
    }

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xe0(%rsp)
movq 0xe0(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
je 0x9d2ac
movq 0xf8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0xf8(%rsp), %rax
movq 0x1288(%rax), %rdx
movq 0xf0(%rsp), %rcx
movl $0x13, %r8d
movl $0x1, %r9d
callq 0x13c50
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xf0(%rsp), %rax
movq 0x10(%rax), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x9d525
movq 0xf0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x1c, %eax
je 0x9d445
movq 0xf8(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xf8(%rsp), %rax
movq 0x1288(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x88(%rsp)
movq $0x2, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
andq $-0x800, %rax           # imm = 0xF800
cmpq $0x0, %rax
jne 0x9d358
movq 0xc8(%rsp), %rcx
leaq 0x179136(%rip), %rax    # 0x216480
movq (%rax,%rcx,8), %rax
movq %rax, 0x78(%rsp)
jmp 0x9d3f0
jmp 0x9d35a
movq 0xf8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xf8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x9d387
movq 0xf8(%rsp), %rdi
callq 0xc670
movq 0xf8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rax
movq $0xb, (%rax)
movq 0xc8(%rsp), %rcx
movq 0xb8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xb8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdx
movq 0xd0(%rsp), %rcx
movq 0xf8(%rsp), %rax
movq 0x140(%rax), %r8
movq 0x17d055(%rip), %r9     # 0x21a488
callq 0xc560
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xd0(%rsp), %rax
movq 0xf8(%rsp), %rcx
cmpq 0x2150(%rcx), %rax
jne 0x9d4d9
movq 0xf8(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xf8(%rsp), %rax
movq 0x1940(%rax), %rax
movq %rax, 0x70(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xf8(%rsp), %rdi
leaq 0x156807(%rip), %rsi    # 0x1f3ca2
movl $0x17, %edx
callq 0xb880
movq 0x60(%rsp), %rdi
movq %rax, %rsi
movq 0xe0(%rsp), %rdx
callq 0xb830
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xd0(%rsp), %rax
movq 0xf8(%rsp), %rcx
cmpq 0x150(%rcx), %rax
jne 0x9d50f
movq 0xf8(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0xf8(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x9d523
movq 0xd0(%rsp), %rcx
movq 0xf8(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x9d540
movq 0xf8(%rsp), %rax
movq 0x110(%rax), %rcx
movq 0xf8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0xe0(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xd8(%rsp)
cmpq $0x0, 0xd8(%rsp)
je 0x9d56c
movq 0xd8(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x9d5e7
movq 0xf8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xf8(%rsp), %rax
movq 0x1948(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xf8(%rsp), %rdi
leaq 0x156711(%rip), %rsi    # 0x1f3cba
movl $0x2f, %edx
callq 0xb880
movq 0x48(%rsp), %rdi
movq %rax, %rsi
movq 0xe0(%rsp), %rdx
callq 0xb830
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xd8(%rsp), %rdi
callq 0x27dd0
testb $0x1, %al
jne 0x9d5fa
jmp 0x9d675
movq 0xf8(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xf8(%rsp), %rax
movq 0x1940(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xf8(%rsp), %rdi
leaq 0x1566b3(%rip), %rsi    # 0x1f3cea
movl $0x21, %edx
callq 0xb880
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movq 0xe0(%rsp), %rdx
callq 0xb830
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rax, %rdx
callq 0x2f940
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xf8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xf8(%rsp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x9d6c2
movq 0xf8(%rsp), %rax
movq 0x150(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x9d6d3
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0x27a70
testb $0x1, %al
jne 0x9d6ed
jmp 0x9d709
movq 0xf8(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
movq 0xd8(%rsp), %rdi
leaq 0x154d55(%rip), %rsi    # 0x1f246d
callq 0x95b0
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x9d74d
movq 0xf8(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x27e30
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0x9d89e
movq 0xf8(%rsp), %rdi
movq 0xf8(%rsp), %rax
movq 0x1e8(%rax), %rsi
callq 0xba20
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x9d89c
movq 0xf8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xf8(%rsp), %rax
movq 0x1e8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0xf8(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x14630
movq 0xf8(%rsp), %rcx
movq %rax, 0x520(%rcx)
movq %rax, 0xa0(%rsp)
movq 0xf8(%rsp), %rax
movq 0x110(%rax), %rax
movq %rax, 0x98(%rsp)
movq 0xf8(%rsp), %rax
movq 0x90(%rax), %rax
movq 0xf8(%rsp), %rcx
cmpq 0x98(%rcx), %rax
ja 0x9d815
movq 0xf8(%rsp), %rdi
callq 0xc670
movq 0xf8(%rsp), %rcx
movq 0x90(%rcx), %rax
movq %rax, %rdx
addq $-0x8, %rdx
movq %rdx, 0x90(%rcx)
movq -0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0xa0(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x98(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0xa8(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdx
callq 0xda50
jmp 0x9d8f8
movq 0xf8(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x27f40
movq %rax, 0xe8(%rsp)
cmpq $0x0, 0xe8(%rsp)
jne 0x9d8f6
movq 0xf8(%rsp), %rdi
movq 0xd8(%rsp), %rcx
leaq 0x14d40b(%rip), %rsi    # 0x1eace8
leaq 0x156428(%rip), %rdx    # 0x1f3d0c
callq 0x154a0
movq %rax, 0x100(%rsp)
jmp 0x9d9b8
jmp 0x9d8f8
movq 0xf8(%rsp), %rdi
movq 0xe8(%rsp), %rsi
movq 0xd8(%rsp), %rdx
callq 0x280c0
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x1de, %ecx            # imm = 0x1DE
movq %rcx, 0x18(%rax)
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
jmp 0x9d95c
movq 0xf8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rax
movl $0x190, %ecx            # imm = 0x190
movq %rcx, 0x18(%rax)
movq 0xf8(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x50(%rax)
movq 0xf8(%rsp), %rax
movq 0x130(%rax), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nopl (%rax,%rax)