// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/repl.c
// Function: main
int main(int argc, char **argv) {
    int ret_value = SUCCESS;
    int i;
    s7_scheme *sc;
    sc = s7_init();

    manage_directories(sc, argv[0]);
    // fprintf(stderr, "s7_home: <%s>\n", s7_home);
    for (i=1; i<argc && *(argv[i]) == '-' && ret_value==SUCCESS; i++) {
        char *current_arg = argv[i] + 1;
        while (*current_arg != 0) {
            switch (*current_arg) {
                case 'h':
                    dohelp(SUCCESS);
                    break;
                case 'v':
                    do_VERSION(SUCCESS);
                    break;
                case 'b':
                    is_batch = true;
                    is_quiet = true;
                    break;
                case 'q':
                    is_quiet = true;
                    break;
                case 'L':
                    i++;
                    if (i >= argc) {
                        fprintf(stderr, "-L flag needs a directory name\n");
                        dohelp(FAILURE);
                    } else if (!is_read_dir(argv[i])) {
                        fprintf(stderr,
                                "%s is not a directory or you don't have read access\n",
                                argv[i]);
                        dohelp(FAILURE);
                    } else {
                        add_lib_dir(sc, argv[i]);
                    }
                    break;
                default:
                    fprintf(stderr, "unknown flag (-%c)\n", *current_arg);
                    dohelp(FAILURE);
                    break;
            }
            current_arg++;
        }
    }
    add_lib_dir(sc, s7_home);
    add_lib_dir(sc, s7_libs);
    load_scm(sc, concat(s7_libs, "basic-lib.scm"));
    set_scm_configuration(sc);
    set_scm_environment(sc);
    if (ret_value == SUCCESS) {
        ret_value = load_base_lib(sc);
        if (ret_value == SUCCESS && !is_batch) {
            if ((ret_value = ensure_user_conf_exists()) == SUCCESS) {
                ret_value = load_ui_lib(sc);
            }
        }
        for (; i<argc && ret_value==SUCCESS; i++) {
            ret_value = load_scm(sc, argv[i]);
        }
        if (ret_value == SUCCESS && !is_batch) {
            if (!is_quiet) {
                show_VERSION();
            }
            s7_eval_c_string(sc, "((*repl* 'run))");
        }
    }
    return ret_value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movl %edi, 0x4(%rsp)
callq 0x46675
movq %rax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq (%rbx), %r14
movq %r14, %rdi
callq 0x8400
movq %rax, 0x516f3(%rip)     # 0x156178
movq %r14, %rdi
callq 0x8230
movq %rax, 0x516d4(%rip)     # 0x156168
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x104ad4
cmpl $0x2e, %ecx
jne 0x104ade
movb 0x1(%rax), %bl
xorl %edi, %edi
xorl %esi, %esi
callq 0x8280
cmpb $0x2e, %bl
movl 0x4(%rsp), %r14d
movq %rax, %rdi
jne 0x104afd
callq 0x8230
movq %rax, %rdi
callq 0x86a0
movq 0x5169a(%rip), %rsi     # 0x156168
addq $0x2, %rsi
jmp 0x104b0c
movq %rax, %rdi
callq 0x86a0
jmp 0x104af6
xorl %edi, %edi
xorl %esi, %esi
callq 0x8280
movq 0x5167a(%rip), %rsi     # 0x156168
movq %rax, %rdi
callq 0x1050ba
movl 0x4(%rsp), %r14d
jmp 0x104b14
callq 0x86a0
movq 0x5165f(%rip), %rsi     # 0x156168
incq %rsi
movq %rax, %rdi
callq 0x1050ba
movq %rax, 0x5164d(%rip)     # 0x156168
leaq 0x177b6(%rip), %rsi     # 0x11c2d8
movq %rax, %rdi
callq 0x1050ba
movq %rax, 0x5163f(%rip)     # 0x156170
leaq 0x61a(%rip), %rdi       # 0x105152
callq 0x105740
movl $0x1, %ebx
cmpl $0x2, %r14d
jl 0x104c20
leaq 0x18(%rsp), %r15
leaq 0x51628(%rip), %r12     # 0x156180
leaq 0x1785a(%rip), %r13     # 0x11c3b9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x104c20
incq %rbp
movzbl (%rbp), %edi
cmpl $0x67, %edi
jg 0x104b8f
cmpl $0x62, %edi
jne 0x104ba1
movb $0x1, 0x515d3(%rip)     # 0x156160
jmp 0x104b98
cmpl $0x71, %edi
jne 0x104f75
movb $0x1, 0x515c2(%rip)     # 0x156161
jmp 0x104b75
testl %edi, %edi
je 0x104c15
cmpl $0x4c, %edi
jne 0x104f86
incl %ebx
cmpl %r14d, %ebx
jge 0x104f9f
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %r14
movq (%r14), %rdi
movq %r15, %rsi
callq 0x83d0
testl %eax, %eax
jne 0x104f97
movl 0x30(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x104f97
movq (%r14), %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8640
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x37222
movl 0x4(%rsp), %r14d
jmp 0x104b75
incl %ebx
cmpl %r14d, %ebx
jl 0x104b5f
movq 0x51541(%rip), %rdx     # 0x156168
leaq 0x51552(%rip), %rbp     # 0x156180
leaq 0x17784(%rip), %r14     # 0x11c3b9
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x8640
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x37222
movq 0x51517(%rip), %rdx     # 0x156170
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x8640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x37222
movq 0x514f8(%rip), %rdi     # 0x156170
leaq 0x1763b(%rip), %rsi     # 0x11c2ba
callq 0x1050ba
movq %r13, %rdi
movq %rax, %rsi
callq 0x10504d
leaq 0x68a6(%rip), %r15      # 0x10b53c
cmpb $0x0, 0x514c4(%rip)     # 0x156161
leaq 0x7017(%rip), %r14      # 0x10bcbb
movq %r14, %rcx
cmovneq %r15, %rcx
leaq 0x17752(%rip), %r12     # 0x11c404
leaq 0x1773b(%rip), %rdx     # 0x11c3f4
movq %rbp, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x8640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x37222
cmpb $0x0, 0x51488(%rip)     # 0x156160
cmovneq %r15, %r14
leaq 0x17719(%rip), %rdx     # 0x11c3fc
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x8640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x37222
leaq 0x17717(%rip), %rsi     # 0x11c41c
leaq 0x11b19(%rip), %rdx     # 0x116825
movq %r13, %rdi
callq 0x10518d
leaq 0x17708(%rip), %rsi     # 0x11c423
leaq 0x1770d(%rip), %rdx     # 0x11c42f
movq %r13, %rdi
callq 0x10518d
leaq 0x17703(%rip), %rsi     # 0x11c434
leaq 0x17705(%rip), %rdx     # 0x11c43d
movq %r13, %rdi
callq 0x10518d
leaq 0x176fd(%rip), %rsi     # 0x11c444
leaq 0x176fd(%rip), %rdx     # 0x11c44b
movq %r13, %rdi
callq 0x10518d
leaq 0xf95b(%rip), %rbp      # 0x1146b8
leaq 0x41044(%rip), %r15     # 0x145da8
movq %rbp, %rdi
callq 0x86a0
movq %rax, %r14
movq %rax, %rdi
callq 0x8400
movq %rax, %r13
cmpb $0x0, 0x513e0(%rip)     # 0x156161
jne 0x104d9e
movq 0x41246(%rip), %rax     # 0x145fd0
movq (%rax), %rdi
leaq 0x176d6(%rip), %rsi     # 0x11c46a
movq %rbp, %rdx
xorl %eax, %eax
callq 0x8390
leaq 0x513db(%rip), %r12     # 0x156180
movq %r12, %rdi
leaq 0x176ce(%rip), %rsi     # 0x11c47d
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x8640
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x37222
movq %r14, %rdi
callq 0x8050
movq (%r15), %rbp
addq $0x8, %r15
testq %rbp, %rbp
jne 0x104d64
cmpb $0x0, 0x5137c(%rip)     # 0x156160
je 0x104e8a
movl 0x4(%rsp), %eax
cmpl %eax, %ebx
jge 0x104e28
movslq %ebx, %rbx
movslq %eax, %r14
incq %rbx
movq 0x10(%rsp), %rax
movq -0x8(%rax,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x10504d
cmpq %r14, %rbx
jge 0x104e1b
incq %rbx
testl %eax, %eax
je 0x104dfb
movl $0x1, %ebp
testl %eax, %eax
jne 0x104f61
xorl %ebp, %ebp
cmpb $0x0, 0x5132f(%rip)     # 0x156160
jne 0x104f61
cmpb $0x0, 0x51323(%rip)     # 0x156161
jne 0x104e74
movq 0x41189(%rip), %rax     # 0x145fd0
movq (%rax), %rdi
movq 0x51327(%rip), %rdx     # 0x156178
leaq 0x176ac(%rip), %rsi     # 0x11c504
leaq 0x176be(%rip), %rcx     # 0x11c51d
leaq 0x17669(%rip), %r8      # 0x11c4cf
leaq 0x1766e(%rip), %r9      # 0x11c4db
xorl %eax, %eax
callq 0x8390
leaq 0x1744d(%rip), %rsi     # 0x11c2c8
movq 0x8(%rsp), %rdi
callq 0x37222
jmp 0x104f61
leaq 0x11994(%rip), %rdi     # 0x116825
callq 0x8030
leaq 0x510c3(%rip), %r14     # 0x155f60
leaq 0x175fe(%rip), %rsi     # 0x11c4a2
leaq 0x175fd(%rip), %rcx     # 0x11c4a8
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8640
movq %r14, 0x41871(%rip)     # 0x146730
leaq 0x15681(%rip), %rsi     # 0x11a547
movq %r14, %rdi
callq 0x85b0
movq %rax, %r15
testq %rax, %rax
jne 0x104f2f
leaq 0x51083(%rip), %rdi     # 0x155f60
leaq 0x16f96(%rip), %rsi     # 0x11be7a
callq 0x85b0
testq %rax, %rax
je 0x104f5c
movq %rax, %r15
leaq 0x175ba(%rip), %rsi     # 0x11c4b2
leaq 0x51061(%rip), %rdx     # 0x155f60
leaq 0x175c9(%rip), %rcx     # 0x11c4cf
leaq 0x175ce(%rip), %r8      # 0x11c4db
movq %rax, %rdi
xorl %eax, %eax
callq 0x8390
leaq 0x175c6(%rip), %rsi     # 0x11c4e4
leaq 0x17583(%rip), %rdx     # 0x11c4a8
movq %r15, %rdi
xorl %eax, %eax
callq 0x8390
movq %r15, %rdi
callq 0x8180
leaq 0x417f2(%rip), %r14     # 0x146730
movq (%r14), %rsi
testq %rsi, %rsi
je 0x104dea
movq 0x8(%rsp), %rdi
callq 0x10504d
addq $0x8, %r14
testl %eax, %eax
je 0x104f3e
movl $0x1, %ebp
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %edi
je 0x104f8b
cmpl $0x68, %edi
jne 0x104f86
xorl %edi, %edi
callq 0x104fa4
callq 0x889f
callq 0x10511e
xorl %edi, %edi
callq 0x8650
movq %r14, %rdi
callq 0x8878
callq 0x8853