// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movl $0x0, 0x44(%rsp)
movl %edi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
callq 0x490e0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movq (%rax), %rsi
callq 0x1db8a0
movl $0x1, 0x30(%rsp)
movl 0x30(%rsp), %ecx
xorl %eax, %eax
cmpl 0x40(%rsp), %ecx
movb %al, 0x1f(%rsp)
jge 0x1db5d9
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2d, %ecx
movb %al, 0x1f(%rsp)
jne 0x1db5d9
cmpl $0x0, 0x34(%rsp)
sete %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x1db5e6
jmp 0x1db762
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x1db750
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
addl $-0x4c, %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x2a, %eax
ja 0x1db713
movq 0x10(%rsp), %rax
leaq 0x18b5b(%rip), %rcx     # 0x1f4190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
callq 0x1db9e0
jmp 0x1db73d
xorl %edi, %edi
callq 0x1dba90
jmp 0x1db73d
movb $0x1, 0x49db3(%rip)     # 0x225410
movb $0x1, 0x49dad(%rip)     # 0x225411
jmp 0x1db73d
movb $0x1, 0x49da1(%rip)     # 0x225411
jmp 0x1db73d
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x40(%rsp), %eax
jl 0x1db6ae
movq 0x39967(%rip), %rax     # 0x214ff8
movq (%rax), %rdi
leaq 0x18ba1(%rip), %rsi     # 0x1f423c
movb $0x0, %al
callq 0x9390
movl $0x1, %edi
callq 0x1db9e0
jmp 0x1db711
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1dbab0
testb $0x1, %al
jne 0x1db6f7
movq 0x3992c(%rip), %rax     # 0x214ff8
movq (%rax), %rdi
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x18b78(%rip), %rsi     # 0x1f425c
movb $0x0, %al
callq 0x9390
movl $0x1, %edi
callq 0x1db9e0
jmp 0x1db70f
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1dbb20
jmp 0x1db711
jmp 0x1db73d
movq 0x398de(%rip), %rax     # 0x214ff8
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movsbl (%rax), %edx
leaq 0x18b65(%rip), %rsi     # 0x1f4291
movb $0x0, %al
callq 0x9390
movl $0x1, %edi
callq 0x1db9e0
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x1db5fd
jmp 0x1db752
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x1db5a1
movq 0x28(%rsp), %rdi
movq 0x49caa(%rip), %rsi     # 0x225418
callq 0x1dbb20
movq 0x28(%rsp), %rdi
movq 0x49ca1(%rip), %rsi     # 0x225420
callq 0x1dbb20
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x49c8b(%rip), %rdi     # 0x225420
leaq 0x18b09(%rip), %rsi     # 0x1f42a5
callq 0x1dbbe0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x1dbb60
movq 0x28(%rsp), %rdi
callq 0x1dbc80
movq 0x28(%rsp), %rdi
callq 0x1dbcc0
cmpl $0x0, 0x34(%rsp)
jne 0x1db88b
movq 0x28(%rsp), %rdi
callq 0x1dbd30
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
jne 0x1db809
testb $0x1, 0x49c27(%rip)     # 0x225410
jne 0x1db809
callq 0x1dbd50
movl %eax, 0x34(%rsp)
cmpl $0x0, %eax
jne 0x1db807
movq 0x28(%rsp), %rdi
callq 0x1dbe40
movl %eax, 0x34(%rsp)
jmp 0x1db809
jmp 0x1db80b
movl 0x30(%rsp), %ecx
xorl %eax, %eax
cmpl 0x40(%rsp), %ecx
movb %al, 0x7(%rsp)
jge 0x1db827
cmpl $0x0, 0x34(%rsp)
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x1db831
jmp 0x1db85a
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1dbb60
movl %eax, 0x34(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x1db80b
cmpl $0x0, 0x34(%rsp)
jne 0x1db889
testb $0x1, 0x49ba8(%rip)     # 0x225410
jne 0x1db889
testb $0x1, 0x49ba0(%rip)     # 0x225411
jne 0x1db878
callq 0x1dbe60
movq 0x28(%rsp), %rdi
leaq 0x18a2f(%rip), %rsi     # 0x1f42b3
callq 0x2b910
jmp 0x1db88b
movl 0x34(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)