// File: /workspace/github_c_makefile_star2_O0/BernardTatin[P]s7sh/s7.c
// Function: g_autoload
static s7_pointer g_autoload(s7_scheme *sc, s7_pointer args)
    {
#define H_autoload "(autoload symbol file-or-function) adds the symbol to its table of autoloadable symbols. \
        If that symbol is encountered as an unbound variable, s7 either loads the file (following *load-path*), or calls \
        the function.  The function takes one argument, the calling environment.  Presumably the symbol is defined \
        in the file, or by the function."
#define Q_autoload s7_make_signature(sc, 3, sc->T, sc->is_symbol_symbol, sc->T)

        s7_pointer sym, value;

        sym = car(args);
        if (is_string(sym))
        {
            if (string_length(sym) == 0)                   /* (autoload "" ...) */
                return(s7_wrong_type_arg_error(sc, "autoload", 1, sym, "a symbol-name or a symbol"));
            sym = make_symbol_with_length(sc, string_value(sym), string_length(sym));
        }
        if (!is_symbol(sym))
        {
            check_method(sc, sym, sc->autoload_symbol, args);
            return(s7_wrong_type_arg_error(sc, "autoload", 1, sym, "a string (symbol-name) or a symbol"));
        }
        if (is_keyword(sym))
            return(s7_wrong_type_arg_error(sc, "autoload", 1, sym, "a normal symbol (a keyword is never unbound)"));

        value = cadr(args);
        if (is_string(value))
            return(s7_autoload(sc, sym, s7_immutable(make_string_with_length(sc, string_value(value), string_length(value)))));
        if (((is_closure(value)) || (is_closure_star(value))) &&
                (s7_is_aritable(sc, value, 1)))
            return(s7_autoload(sc, sym, value));

        check_method(sc, value, sc->autoload_symbol, args);
        return(s7_wrong_type_arg_error(sc, "autoload", 2, value, "a string (file-name) or a thunk"));
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
jne 0x9da52
movq 0x58(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x9da31
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x14d2ce(%rip), %rsi    # 0x1eace4
movl $0x1, %edx
leaq 0x1562f5(%rip), %r8     # 0x1f3d17
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0xa2b0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0xa, %eax
je 0x9db3d
movq 0x58(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x9db11
movq 0x68(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x9db11
movq 0x68(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x9a10
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq 0xc18(%rax), %rdx
callq 0x98d0
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x9db11
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x44270
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %rax, %rdx
callq 0xda50
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x14d1c2(%rip), %rsi    # 0x1eace4
movl $0x1, %edx
leaq 0x156203(%rip), %r8     # 0x1f3d31
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x58(%rsp), %rax
movzwl 0x6(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9db7c
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rcx
leaq 0x14d183(%rip), %rsi    # 0x1eace4
movl $0x1, %edx
leaq 0x1561e7(%rip), %r8     # 0x1f3d54
callq 0x12540
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x60(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x13, %eax
jne 0x9dbef
movq 0x68(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rdx
callq 0x144d0
movq %rax, %rdi
callq 0x9c90
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x2a340
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x28, %eax
je 0x9dc09
movq 0x50(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x29, %eax
jne 0x9dc41
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl $0x1, %edx
callq 0x3cbf0
testb $0x1, %al
jne 0x9dc23
jmp 0x9dc41
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x2a340
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x50(%rsp), %rax
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x9dce6
movq 0x68(%rsp), %rax
testb $0x1, 0x24c(%rax)
je 0x9dce6
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x9a10
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x68(%rsp), %rax
movq 0xc18(%rax), %rdx
callq 0x98d0
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rcx
cmpq 0x128(%rcx), %rax
je 0x9dce6
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x44270
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0xda50
movq %rax, 0x70(%rsp)
jmp 0x9dd0d
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rcx
leaq 0x14cfed(%rip), %rsi    # 0x1eace4
movl $0x2, %edx
leaq 0x15607e(%rip), %r8     # 0x1f3d81
callq 0x12540
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)