// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
movb (%r15), %al
cmpb $0x13, %al
jne 0x644f5
movq 0x8(%r15), %rdx
testq %rdx, %rdx
je 0x645be
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x8c3b
movq %rax, %r15
movb (%rax), %al
cmpb $0xa, %al
jne 0x64541
testb $-0x80, 0x6(%r15)
jne 0x645ae
movq 0x10(%r14), %rax
movq 0x8(%rax), %r12
movzbl (%r12), %eax
leal -0x28(%rax), %ecx
cmpl $0x2, %ecx
jae 0x645e5
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32378
testb %al, %al
je 0x64620
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
jmp 0x6460c
testb $0x40, 0x3(%r15)
je 0x6459e
cmpb $0x1, 0x24c(%rbx)
jne 0x6459e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x88f3
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x6459e
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35492
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa34c
leaq 0x7ac0a(%rip), %rsi     # 0xdf1af
leaq 0x837ca(%rip), %r8      # 0xe7d76
jmp 0x645cc
leaq 0x7abfa(%rip), %rsi     # 0xdf1af
leaq 0x837dd(%rip), %r8      # 0xe7d99
jmp 0x645cc
leaq 0x7abea(%rip), %rsi     # 0xdf1af
leaq 0x83790(%rip), %r8      # 0xe7d5c
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc2b0
cmpl $0x13, %eax
jne 0x64620
movq 0x8(%r12), %rdx
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0xd11d
movq %rax, %r12
orb $0x1, 0x3(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2a552
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testb $0x40, 0x3(%r12)
je 0x64670
cmpb $0x1, 0x24c(%rbx)
jne 0x64670
movq %rbx, %rdi
movq %r12, %rsi
callq 0x88f3
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x888f
cmpq 0x128(%rbx), %rax
je 0x64670
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x35492
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x6458b
leaq 0x7ab38(%rip), %rsi     # 0xdf1af
leaq 0x83748(%rip), %r8      # 0xe7dc6
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %r12, %rcx
jmp 0x645d5