// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r15
movb (%r15), %al
cmpb $0x13, %al
jne 0x7cba8
movq 0x8(%r15), %r12
testq %r12, %r12
je 0x7cae5
movq 0x10(%r15), %r15
movq $0x0, 0x8(%rsp)
movabsq $-0x7fecfd2d94c4151b, %rbp # imm = 0x801302D26B3BEAE5
cmpq $0x8, %r12
jg 0x7caf8
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x83e0
movq (%r13), %r13
movq %r13, %rax
mulq %rbp
shrq $0xe, %rdx
imulq $0x7fed, %rdx, %rax     # imm = 0x7FED
movq %r13, %rbp
subq %rax, %rbp
movq 0x148(%rbx), %rax
movq 0x10(%rax), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rax
cmpb $0x1, (%rax)
jne 0x7cb8e
cmpq 0x18(%rax), %r13
jne 0x7cadf
movl 0x2c(%rax), %ecx
cmpq %rcx, %r12
je 0x7ced3
movq 0x10(%rax), %rax
jmp 0x7cac4
leaq 0x96723(%rip), %rsi     # 0x11320f
leaq 0x9f2c9(%rip), %r8      # 0x11bdbc
jmp 0x7cd39
movq %r14, (%rsp)
movq (%r15), %r13
movq %rbp, %r14
leaq 0x10(%rsp), %rbp
movq $0x0, (%rbp)
leaq 0x8(%r15), %rsi
cmpq $0x10, %r12
movl $0x10, %edx
cmovbq %r12, %rdx
addq $-0x8, %rdx
movq %rbp, %rdi
callq 0x83e0
addq (%rbp), %r13
movq %r13, %rax
mulq %r14
shrq $0xe, %rdx
imulq $0x7fed, %rdx, %rax     # imm = 0x7FED
movq %r13, %rbp
subq %rax, %rbp
movq 0x148(%rbx), %rax
movq 0x10(%rax), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %r14
cmpb $0x1, (%r14)
jne 0x7cb8a
cmpq 0x18(%r14), %r13
jne 0x7cb84
movl 0x2c(%r14), %eax
cmpq %rax, %r12
jne 0x7cb84
movq 0x20(%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x8c146
testb %al, %al
jne 0x7cedc
movq 0x10(%r14), %r14
jmp 0x7cb58
movq (%rsp), %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl %ebp, %r8d
callq 0x9632
movq %rax, %r15
movb (%r15), %al
cmpb $0xa, %al
jne 0x7cbed
testb $-0x80, 0x6(%r15)
jne 0x7cd2b
movq 0x10(%r14), %rax
movq 0x8(%rax), %r12
movzbl (%r12), %eax
leal -0x28(%rax), %ecx
cmpl $0x2, %ecx
jae 0x7cd57
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3f86f
testb %al, %al
jne 0x7ce22
jmp 0x7ce42
testb $0x40, 0x3(%r15)
je 0x7cd1b
cmpb $0x1, 0x24c(%rbx)
jne 0x7cd1b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8a63
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89ff
cmpq 0x128(%rbx), %rax
je 0x7cd1b
cmpb $0x1, (%r14)
jne 0x7ceb0
movq %rax, (%rsp)
movq %r14, 0x4c8(%rbx)
movq %r14, %r12
movq 0x8(%r14), %r14
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r13
cmpq 0x98(%rbx), %rax
ja 0x7cc71
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r15
movq $0x200001, (%r15)       # imm = 0x200001
movq %r14, 0x8(%r15)
movq %r13, 0x10(%r15)
movq %r15, 0x4e8(%rbx)
movq 0x10(%r12), %r14
cmpb $0x1, (%r14)
jne 0x7ccfd
movq %r15, %r13
movq 0x8(%r14), %rbp
movq 0x90(%rbx), %rax
movq 0x110(%rbx), %r12
cmpq 0x98(%rbx), %rax
ja 0x7ccce
movq %rbx, %rdi
callq 0xa550
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, 0x10(%r13)
movq 0x10(%r14), %r14
cmpb $0x1, (%r14)
movq %rax, %r13
je 0x7cca4
movq 0x110(%rbx), %rax
movq %rax, 0x4e8(%rbx)
movq %rax, 0x4c8(%rbx)
movq (%rsp), %rax
jmp 0x7ceb7
leaq 0x964ed(%rip), %rsi     # 0x11320f
leaq 0x9f0ad(%rip), %r8      # 0x11bdd6
jmp 0x7cd39
leaq 0x964dd(%rip), %rsi     # 0x11320f
leaq 0x9f0c0(%rip), %r8      # 0x11bdf9
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd4e5
cmpl $0x13, %eax
jne 0x7ce42
movq 0x8(%r12), %r14
movq 0x10(%r12), %r13
movq 0x90(%rbx), %rax
cmpq 0x98(%rbx), %rax
ja 0x7cd89
movq %rbx, %rdi
callq 0xa550
movq 0x90(%rbx), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x90(%rbx)
movq -0x8(%rax), %r12
movq $0x200013, (%r12)       # imm = 0x200013
leaq 0x1(%r14), %rsi
movq %rbx, %rdi
callq 0x9357
movq %rax, 0x20(%r12)
movq (%rax), %rdi
movq %rdi, 0x10(%r12)
testq %r14, %r14
jle 0x7cdce
movq %r13, %rsi
movq %r14, %rdx
callq 0x83e0
movq 0x10(%r12), %rdi
movb $0x0, (%rdi,%r14)
movq %r14, 0x8(%r12)
movq $0x0, 0x18(%r12)
movq 0x738(%rbx), %r14
movq (%r14), %rax
movq 0x10(%r14), %rsi
cmpq 0x8(%r14), %rsi
jne 0x7ce10
leaq (%rsi,%rsi), %rcx
movq %rcx, 0x8(%r14)
shlq $0x4, %rsi
movq %rax, %rdi
callq 0x8510
movq %rax, (%r14)
movq 0x10(%r14), %rsi
leaq 0x1(%rsi), %rcx
movq %rcx, 0x10(%r14)
movq %r12, (%rax,%rsi,8)
orb $0x1, 0x3(%r12)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x36663
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x40, 0x3(%r12)
je 0x7ce92
cmpb $0x1, 0x24c(%rbx)
jne 0x7ce92
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8a63
movq 0xc18(%rbx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x89ff
cmpq 0x128(%rbx), %rax
je 0x7ce92
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x42f69
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
jmp 0x7cec0
leaq 0x96376(%rip), %rsi     # 0x11320f
leaq 0x9ef86(%rip), %r8      # 0x11be26
movl $0x2, %edx
movq %rbx, %rdi
movq %r12, %rcx
jmp 0x7cd44
movq 0x110(%rbx), %r15
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xaee6
movq 0x8(%rax), %r15
jmp 0x7cba5
movq 0x8(%r14), %r15
movq (%rsp), %r14
jmp 0x7cba5