// File: /workspace/github_c_makefile_star2_O2/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, %r12d
callq 0x39847
movq %rax, %r13
movq %rbx, (%rsp)
movq (%rbx), %r14
movq %r14, %rdi
callq 0x8400
movq %rax, 0x54267(%rip)     # 0x125178
movq %r14, %rdi
callq 0x8230
movq %rax, 0x54248(%rip)     # 0x125168
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0xd0f5b
cmpl $0x2e, %ecx
jne 0xd0f65
movb 0x1(%rax), %bl
xorl %edi, %edi
xorl %esi, %esi
callq 0x8280
movq %rax, %rdi
cmpb $0x2e, %bl
jne 0xd0f77
callq 0x8230
movq %rax, %rdi
callq 0x86a0
movq 0x54213(%rip), %rsi     # 0x125168
addq $0x2, %rsi
jmp 0xd0f86
movq %rax, %rdi
callq 0x86a0
jmp 0xd0f8e
xorl %edi, %edi
xorl %esi, %esi
callq 0x8280
movq 0x541f3(%rip), %rsi     # 0x125168
jmp 0xd0f86
callq 0x86a0
movq 0x541e5(%rip), %rsi     # 0x125168
incq %rsi
movq %rax, %rdi
callq 0xd14dc
movq %rax, 0x541d3(%rip)     # 0x125168
leaq 0x172dc(%rip), %rsi     # 0xe8278
movq %rax, %rdi
callq 0xd14dc
movq %rax, 0x541c5(%rip)     # 0x125170
leaq 0x5c0(%rip), %rdi       # 0xd1572
callq 0xd1bb0
pushq $0x1
popq %rbx
leaq 0x18(%rsp), %r15
cmpl %r12d, %ebx
jge 0xd1069
movslq %ebx, %rax
movq (%rsp), %rcx
movq (%rcx,%rax,8), %r14
cmpb $0x2d, (%r14)
jne 0xd1069
incq %r14
movzbl (%r14), %eax
cmpl $0x62, %eax
je 0xd104f
cmpl $0x71, %eax
je 0xd1056
testl %eax, %eax
je 0xd1062
cmpl $0x4c, %eax
jne 0xd1323
incl %ebx
cmpl %r12d, %ebx
jge 0xd1363
movl %r12d, %ebp
movslq %ebx, %r12
movq (%rsp), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x83d0
testl %eax, %eax
jne 0xd1381
movl 0x30(%rsp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xd1381
movq (%rsp), %rax
movq (%rax,%r12,8), %rsi
movq %r13, %rdi
callq 0xd143d
movl %ebp, %r12d
jmp 0xd0fdd
movb $0x1, 0x5410a(%rip)     # 0x125160
movb $0x1, 0x54104(%rip)     # 0x125161
jmp 0xd0fdd
incl %ebx
jmp 0xd0fbf
movl %r12d, 0x14(%rsp)
movslq %ebx, %rbx
movq 0x540f0(%rip), %rsi     # 0x125168
movq %r13, %rdi
callq 0xd143d
movq 0x540e9(%rip), %rsi     # 0x125170
movq %r13, %rdi
callq 0xd143d
movq 0x540da(%rip), %rdi     # 0x125170
leaq 0x171bd(%rip), %rsi     # 0xe825a
callq 0xd14dc
movq %r13, %rdi
movq %rax, %rsi
callq 0xd1471
movzbl 0x540ad(%rip), %edx     # 0x125161
leaq 0x172d9(%rip), %rsi     # 0xe8394
movq %r13, %rdi
callq 0xd15a7
movzbl 0x54096(%rip), %edx     # 0x125160
leaq 0x172cb(%rip), %rsi     # 0xe839c
movq %r13, %rdi
callq 0xd15a7
leaq 0x172dc(%rip), %rsi     # 0xe83bc
leaq 0x116de(%rip), %rdx     # 0xe27c5
movq %r13, %rdi
callq 0xd15f2
leaq 0x172cd(%rip), %rsi     # 0xe83c3
leaq 0x172d2(%rip), %rdx     # 0xe83cf
movq %r13, %rdi
callq 0xd15f2
leaq 0x172c8(%rip), %rsi     # 0xe83d4
leaq 0x172ca(%rip), %rdx     # 0xe83dd
movq %r13, %rdi
callq 0xd15f2
leaq 0x172c2(%rip), %rsi     # 0xe83e4
leaq 0x172c2(%rip), %rdx     # 0xe83eb
movq %r13, 0x8(%rsp)
movq %r13, %rdi
callq 0xd15f2
leaq 0x43c63(%rip), %r12     # 0x114da0
leaq 0x5403c(%rip), %r15     # 0x125180
movq (%r12), %r13
testq %r13, %r13
je 0xd11b9
movq %r13, %rdi
callq 0x86a0
movq %rax, %rbp
movq %rax, %rdi
callq 0x8400
movq %rax, %r14
cmpb $0x0, 0x53ff7(%rip)     # 0x125161
jne 0xd1187
movq 0x43e5d(%rip), %rax     # 0x114fd0
movq (%rax), %rdi
leaq 0x1728d(%rip), %rsi     # 0xe840a
movq %r13, %rdx
xorl %eax, %eax
callq 0x8390
movq %r15, %rdi
leaq 0x1728c(%rip), %rsi     # 0xe841d
movq %r14, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x8640
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x2af27
movq %rbp, %rdi
callq 0x8050
addq $0x8, %r12
jmp 0xd1144
cmpb $0x0, 0x53fa0(%rip)     # 0x125160
je 0xd11cf
xorl %r12d, %r12d
movq 0x8(%rsp), %r13
jmp 0xd12b6
leaq 0x115ef(%rip), %rdi     # 0xe27c5
callq 0x8030
leaq 0x53d7e(%rip), %r14     # 0x124f60
leaq 0x17259(%rip), %rsi     # 0xe8442
leaq 0x17258(%rip), %rcx     # 0xe8448
xorl %r15d, %r15d
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8640
movq %r14, 0x44529(%rip)     # 0x115730
leaq 0x152d9(%rip), %rsi     # 0xe64e7
movq %r14, %rdi
callq 0x85b0
movq %rax, %r12
testq %rax, %rax
movq 0x8(%rsp), %r13
jne 0xd127c
leaq 0x53d36(%rip), %rdi     # 0x124f60
leaq 0x16be9(%rip), %rsi     # 0xe7e1a
callq 0x85b0
testq %rax, %rax
je 0xd12b2
movq %rax, %r12
leaq 0x1720d(%rip), %rsi     # 0xe8452
leaq 0x53d14(%rip), %rdx     # 0x124f60
leaq 0x1721c(%rip), %rcx     # 0xe846f
leaq 0x17221(%rip), %r8      # 0xe847b
movq %rax, %rdi
xorl %eax, %eax
callq 0x8390
leaq 0x17219(%rip), %rsi     # 0xe8484
leaq 0x171d6(%rip), %rdx     # 0xe8448
movq %r12, %rdi
xorl %eax, %eax
callq 0x8390
movq %r12, %rdi
callq 0x8180
leaq 0x444a5(%rip), %r14     # 0x115730
pushq $0x1
popq %r12
testl %r15d, %r15d
jne 0xd12b6
movq (%r14), %rsi
testq %rsi, %rsi
je 0xd12ad
movq %r13, %rdi
callq 0xd1471
movl %eax, %r15d
addq $0x8, %r14
jmp 0xd128f
xorl %r12d, %r12d
jmp 0xd12b6
pushq $0x1
popq %r12
movslq 0x14(%rsp), %r14
cmpq %r14, %rbx
jge 0xd12dd
testl %r12d, %r12d
jne 0xd12dd
movq (%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r13, %rdi
callq 0xd1471
movl %eax, %r12d
incq %rbx
jmp 0xd12bb
testl %r12d, %r12d
je 0xd12e7
pushq $0x1
popq %rbp
jmp 0xd130f
xorl %ebp, %ebp
cmpb $0x0, 0x53e70(%rip)     # 0x125160
jne 0xd130f
cmpb $0x0, 0x53e68(%rip)     # 0x125161
jne 0xd1300
callq 0xd153e
leaq 0x16f61(%rip), %rsi     # 0xe8268
movq %r13, %rdi
callq 0x2af27
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
je 0xd1334
cmpl $0x68, %eax
jne 0xd1340
xorl %edi, %edi
callq 0xd13a3
callq 0xd153e
xorl %edi, %edi
callq 0x8650
movsbl %al, %edx
movq 0x43cae(%rip), %rax     # 0x114ff8
movq (%rax), %rdi
leaq 0x16ef2(%rip), %rsi     # 0xe8246
xorl %eax, %eax
callq 0x8390
pushq $0x1
popq %rdi
callq 0xd13a3
movq 0x43c8e(%rip), %rax     # 0x114ff8
movq (%rax), %rcx
leaq 0x16e7d(%rip), %rdi     # 0xe81f1
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x8660
jmp 0xd135b
movq 0x43c70(%rip), %rax     # 0x114ff8
movq (%rax), %rdi
movq (%rsp), %rax
movq (%rax,%r12,8), %rdx
leaq 0x16e77(%rip), %rsi     # 0xe8211
xorl %eax, %eax
callq 0x8390
jmp 0xd135b