// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %r14
cmpb $0x13, (%r14)
jne 0x82cf3
movq 0x8(%r14), %rdx
testq %rdx, %rdx
je 0x82eaf
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x9d9f
movq %rax, %r14
cmpb $0xa, (%r14)
jne 0x82d4b
testb $-0x80, 0x6(%r14)
jne 0x82e9f
movq 0x10(%r15), %rax
movq 0x8(%rax), %r12
movzbl (%r12), %eax
leal -0x28(%rax), %ecx
cmpl $0x2, %ecx
jae 0x82edb
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41fac
testb %al, %al
je 0x82fba
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x38a6a
movq %r12, %r15
jmp 0x8303a
movb $0x1, %bpl
testb $0x40, 0x3(%r14)
je 0x82e86
cmpb $0x1, 0x24c(%rbx)
jne 0x82e86
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a55
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x82e86
cmpb $0x1, (%r15)
jne 0x8304c
movq %rax, 0x10(%rsp)
movq %r15, 0x4c8(%rbx)
movq 0x8(%r15), %rbp
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x82dc9
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %rbp, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %rax, 0x8(%rsp)
movq %rax, 0x4e8(%rbx)
movq 0x10(%r15), %r15
cmpb $0x1, (%r15)
jne 0x82e62
movq 0x8(%rsp), %rbp
movq 0x8(%r15), %r12
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x82e2c
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %rax
movq $0x200001, (%rax)       # imm = 0x200001
movq %r12, 0x8(%rax)
movq %r13, 0x10(%rax)
movq %rax, 0x10(%rbp)
movq 0x10(%r15), %r15
cmpb $0x1, (%r15)
movq %rax, %rbp
je 0x82e09
movq 0x110(%rbx), %rax
movq %rax, 0x4e8(%rbx)
movq %rax, 0x4c8(%rbx)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rdx
jmp 0x83053
testb %bpl, %bpl
je 0x8303a
leaq 0x99269(%rip), %rsi     # 0x11c0ff
leaq 0xa1e29(%rip), %r8      # 0x124cc6
jmp 0x82ebd
leaq 0x99259(%rip), %rsi     # 0x11c0ff
leaq 0xa1e3c(%rip), %r8      # 0x124ce9
jmp 0x82ebd
leaq 0x99249(%rip), %rsi     # 0x11c0ff
leaq 0xa1def(%rip), %r8      # 0x124cac
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe25f
cmpl $0x13, %eax
jne 0x82fba
movq 0x8(%r12), %r13
movq 0x10(%r12), %r12
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x82f06
movq %rbx, %rdi
callq 0xb389
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r15
movq $0x200013, (%r15)       # imm = 0x200013
leaq 0x1(%r13), %rsi
movq %rbx, %rdi
callq 0xa305
movq %rax, 0x20(%r15)
movq (%rax), %rdi
movq %rdi, 0x10(%r15)
testq %r13, %r13
jle 0x82f4a
movq %r12, %rsi
movq %r13, %rdx
callq 0x93e0
movq 0x10(%r15), %rax
movb $0x0, (%rax,%r13)
movq %r13, 0x8(%r15)
movq $0x0, 0x18(%r15)
movq 0x738(%rbx), %r12
movq 0x8(%r12), %rsi
cmpq %rsi, 0x10(%r12)
jne 0x82f8c
leaq (%rsi,%rsi), %rax
movq %rax, 0x8(%r12)
movq (%r12), %rdi
shlq $0x4, %rsi
callq 0x9510
movq %rax, (%r12)
movq (%r12), %rax
movq 0x10(%r12), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x10(%r12)
movq %r15, (%rax,%rcx,8)
orb $0x1, 0x3(%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x38a6a
jmp 0x8303a
movb $0x1, %bpl
testb $0x40, 0x3(%r12)
je 0x83017
cmpb $0x1, 0x24c(%rbx)
jne 0x83017
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9a55
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x99ef
cmpq 0x128(%rbx), %rax
je 0x83017
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45a8d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0xbd41
movq %rax, %r15
xorl %ebp, %ebp
jmp 0x83017
testb %bpl, %bpl
je 0x8303a
leaq 0x990dc(%rip), %rsi     # 0x11c0ff
leaq 0xa1cec(%rip), %r8      # 0x124d16
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rcx
jmp 0x82ec8
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x110(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xbd41
movq %rax, %r15
xorl %ebp, %ebp
jmp 0x82e86