// File: /workspace/github_c_makefile_star2_O1/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 0x4969a
movq %rax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq (%rbx), %r14
movq %r14, %rdi
callq 0x9400
movq %rax, 0x50173(%rip)     # 0x15e178
movq %r14, %rdi
callq 0x9230
movq %rax, 0x50154(%rip)     # 0x15e168
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x10e04f
cmpl $0x2e, %ecx
jne 0x10e059
movb 0x1(%rax), %bl
xorl %edi, %edi
xorl %esi, %esi
callq 0x9280
movq %rax, %rdi
cmpb $0x2e, %bl
jne 0x10e06b
callq 0x9230
movq %rax, %rdi
callq 0x96a0
movq 0x5011f(%rip), %rsi     # 0x15e168
addq $0x2, %rsi
jmp 0x10e07a
movq %rax, %rdi
callq 0x96a0
jmp 0x10e082
xorl %edi, %edi
xorl %esi, %esi
callq 0x9280
movq 0x500ff(%rip), %rsi     # 0x15e168
jmp 0x10e07a
callq 0x96a0
movq 0x500f1(%rip), %rsi     # 0x15e168
incq %rsi
movq %rax, %rdi
callq 0x10e64a
movq %rax, 0x500df(%rip)     # 0x15e168
leaq 0x17138(%rip), %rsi     # 0x1251c8
movq %rax, %rdi
callq 0x10e64a
movq %rax, 0x500d1(%rip)     # 0x15e170
leaq 0x63c(%rip), %rdi       # 0x10e6e2
callq 0x10ecd0
movl $0x1, %ebx
cmpl $0x2, 0x4(%rsp)
jl 0x10e18c
leaq 0x18(%rsp), %r15
leaq 0x500b9(%rip), %r12     # 0x15e180
leaq 0x171db(%rip), %r13     # 0x1252a9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x10e18c
incq %rbp
movzbl (%rbp), %edi
cmpl $0x67, %edi
jg 0x10e0fe
cmpl $0x62, %edi
jne 0x10e110
movb $0x1, 0x50064(%rip)     # 0x15e160
jmp 0x10e107
cmpl $0x71, %edi
jne 0x10e505
movb $0x1, 0x50053(%rip)     # 0x15e161
jmp 0x10e0e4
testl %edi, %edi
je 0x10e180
cmpl $0x4c, %edi
jne 0x10e516
incl %ebx
cmpl 0x4(%rsp), %ebx
jge 0x10e52f
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax,8), %r14
movq (%r14), %rdi
movq %r15, %rsi
callq 0x93d0
testl %eax, %eax
jne 0x10e527
movl 0x30(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x10e527
movq (%r14), %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x9640
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x396c0
jmp 0x10e0e4
incl %ebx
cmpl 0x4(%rsp), %ebx
jl 0x10e0ce
movq 0x4ffd5(%rip), %rdx     # 0x15e168
leaq 0x4ffe6(%rip), %rbp     # 0x15e180
leaq 0x17108(%rip), %r14     # 0x1252a9
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x9640
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x396c0
movq 0x4ffab(%rip), %rdx     # 0x15e170
movq %rbp, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x9640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x396c0
movq 0x4ff8c(%rip), %rdi     # 0x15e170
leaq 0x16fbf(%rip), %rsi     # 0x1251aa
callq 0x10e64a
movq %r13, %rdi
movq %rax, %rsi
callq 0x10e5dd
leaq 0x622a(%rip), %r15      # 0x11442c
cmpb $0x0, 0x4ff58(%rip)     # 0x15e161
leaq 0x699b(%rip), %r14      # 0x114bab
movq %r14, %rcx
cmovneq %r15, %rcx
leaq 0x170d6(%rip), %r12     # 0x1252f4
leaq 0x170bf(%rip), %rdx     # 0x1252e4
movq %rbp, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x9640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x396c0
cmpb $0x0, 0x4ff1c(%rip)     # 0x15e160
cmovneq %r15, %r14
leaq 0x1709d(%rip), %rdx     # 0x1252ec
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x9640
movq %r13, %rdi
movq %rbp, %rsi
callq 0x396c0
leaq 0x1709b(%rip), %rsi     # 0x12530c
leaq 0x1149d(%rip), %rdx     # 0x11f715
movq %r13, %rdi
callq 0x10e71d
leaq 0x1708c(%rip), %rsi     # 0x125313
leaq 0x17091(%rip), %rdx     # 0x12531f
movq %r13, %rdi
callq 0x10e71d
leaq 0x17087(%rip), %rsi     # 0x125324
leaq 0x17089(%rip), %rdx     # 0x12532d
movq %r13, %rdi
callq 0x10e71d
leaq 0x17081(%rip), %rsi     # 0x125334
leaq 0x17081(%rip), %rdx     # 0x12533b
movq %r13, %rdi
callq 0x10e71d
leaq 0xf2df(%rip), %rbp      # 0x11d5a8
leaq 0x3fad8(%rip), %r15     # 0x14dda8
movq %rbp, %rdi
callq 0x96a0
movq %rax, %r14
movq %rax, %rdi
callq 0x9400
movq %rax, %r13
cmpb $0x0, 0x4fe74(%rip)     # 0x15e161
jne 0x10e30a
movq 0x3fcda(%rip), %rax     # 0x14dfd0
movq (%rax), %rdi
leaq 0x1705a(%rip), %rsi     # 0x12535a
movq %rbp, %rdx
xorl %eax, %eax
callq 0x9390
leaq 0x4fe6f(%rip), %r12     # 0x15e180
movq %r12, %rdi
leaq 0x17052(%rip), %rsi     # 0x12536d
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x9640
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x396c0
movq %r14, %rdi
callq 0x9050
movq (%r15), %rbp
addq $0x8, %r15
testq %rbp, %rbp
jne 0x10e2d0
xorl %r15d, %r15d
cmpb $0x0, 0x4fe0d(%rip)     # 0x15e160
jne 0x10e44d
leaq 0x113b5(%rip), %rdi     # 0x11f715
callq 0x9030
leaq 0x4fbf4(%rip), %r12     # 0x15df60
leaq 0x1701f(%rip), %rsi     # 0x125392
leaq 0x1701e(%rip), %rcx     # 0x125398
xorl %r15d, %r15d
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x9640
movq %r12, 0x4039f(%rip)     # 0x14e730
leaq 0x1509f(%rip), %rsi     # 0x123437
movq %r12, %rdi
callq 0x95b0
movb $0x1, %r13b
testq %rax, %rax
jne 0x10e414
leaq 0x4fbb1(%rip), %rdi     # 0x15df60
leaq 0x169b4(%rip), %rsi     # 0x124d6a
callq 0x95b0
movq %rax, %r14
xorl %eax, %eax
testq %r14, %r14
je 0x10e40b
leaq 0x16fd6(%rip), %rsi     # 0x1253a2
leaq 0x4fb8d(%rip), %rdx     # 0x15df60
leaq 0x16fe5(%rip), %rcx     # 0x1253bf
leaq 0x16fea(%rip), %r8      # 0x1253cb
movq %r14, %rdi
xorl %eax, %eax
callq 0x9390
leaq 0x16fe2(%rip), %rsi     # 0x1253d4
leaq 0x16f9f(%rip), %rdx     # 0x125398
movq %r14, %rdi
xorl %eax, %eax
callq 0x9390
xorl %r15d, %r15d
movq %r14, %rax
jmp 0x10e414
movl $0x1, %r15d
xorl %r13d, %r13d
testq %rax, %rax
je 0x10e421
movq %rax, %rdi
callq 0x9180
testb %r13b, %r13b
je 0x10e44d
leaq 0x4030b(%rip), %r14     # 0x14e738
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x10e5dd
movl %eax, %r15d
testl %eax, %eax
jne 0x10e44d
movq (%r14), %r12
addq $0x8, %r14
testq %r12, %r12
jne 0x10e42d
testl %r15d, %r15d
sete %al
cmpl 0x4(%rsp), %ebx
jge 0x10e492
testl %r15d, %r15d
jne 0x10e492
movslq %ebx, %rbx
movslq 0x4(%rsp), %r14
incq %rbx
movq 0x10(%rsp), %rax
movq -0x8(%rax,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x10e5dd
movl %eax, %r15d
testl %eax, %eax
sete %al
cmpq %r14, %rbx
jge 0x10e492
incq %rbx
testl %r15d, %r15d
je 0x10e469
testb %al, %al
je 0x10e4f0
xorl %r15d, %r15d
cmpb $0x0, 0x4fcc0(%rip)     # 0x15e160
jne 0x10e4f0
cmpb $0x0, 0x4fcb8(%rip)     # 0x15e161
jne 0x10e4df
movq 0x3fb1e(%rip), %rax     # 0x14dfd0
movq (%rax), %rdi
movq 0x4fcbc(%rip), %rdx     # 0x15e178
leaq 0x16f31(%rip), %rsi     # 0x1253f4
leaq 0x16f43(%rip), %rcx     # 0x12540d
leaq 0x16eee(%rip), %r8      # 0x1253bf
leaq 0x16ef3(%rip), %r9      # 0x1253cb
xorl %eax, %eax
callq 0x9390
leaq 0x16cd2(%rip), %rsi     # 0x1251b8
movq 0x8(%rsp), %rdi
callq 0x396c0
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %edi
je 0x10e51b
cmpl $0x68, %edi
jne 0x10e516
xorl %edi, %edi
callq 0x10e534
callq 0x989a
callq 0x10e6ae
xorl %edi, %edi
callq 0x9650
movq %r14, %rdi
callq 0x9873
callq 0x984e