// File: /workspace/github_c_makefile_star2_O0/sasairc[P]yasuna/src/subset.c
// Function: open_dict_file
int open_dict_file(FILE** fp, yasuna_t* yasuna)
{
    int     status  = 0;

    STRING* path    = new_string(NULL);

    struct  stat st;

    if (concat_file_path(path, yasuna) < 0) {
        status = -1; goto ERR;
    }

    if (stat(path->c_str(path), &st) != 0) {
        status = -2; goto ERR;
    }

    if ((st.st_mode & S_IFMT) == S_IFDIR) {
        status = -3; goto ERR;
    }
    if ((*fp = fopen(path->c_str(path), "r")) == NULL) {
        status = -4; goto ERR;
    }
    path->release(path);

    return 0;

ERR:
    switch (status) {
        case    -1:
            break;
        case    -2:
            fprintf(stderr, "%s: %s: %s\n",
                    PROGNAME, path->c_str(path), strerror(ENOENT));
            break;
        case    -3:
            fprintf(stderr, "%s: %s: %s\n",
                    PROGNAME, path->c_str(path), strerror(EISDIR));
            break;
        case    -4:
            fprintf(stderr, "%s: %s: %s\n",
                    PROGNAME, path->c_str(path), strerror(errno));
            break;
    }
    path->release(path);

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x8f80
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10910
cmpl $0x0, %eax
jge 0x10705
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0x107a1
movq -0x28(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x23b0
cmpl $0x0, %eax
je 0x10733
movl $0xfffffffe, -0x1c(%rbp) # imm = 0xFFFFFFFE
jmp 0x107a1
movl -0xa0(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x1074e
movl $0xfffffffd, -0x1c(%rbp) # imm = 0xFFFFFFFD
jmp 0x107a1
movq -0x28(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, %rdi
leaq 0x2021(%rip), %rsi      # 0x1278a
callq 0x20f0
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x10784
movl $0xfffffffc, -0x1c(%rbp) # imm = 0xFFFFFFFC
jmp 0x107a1
movq -0x28(%rbp), %rax
movq 0x268(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movl $0x0, -0x4(%rbp)
jmp 0x10900
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, %ecx
movq %rcx, -0xc0(%rbp)
subl $0x3, %eax
ja 0x108e9
movq -0xc0(%rbp), %rax
leaq 0x1d89(%rip), %rcx      # 0x12550
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x108e9
movq 0x5804(%rip), %rax      # 0x15fe0
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x28(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, -0xc8(%rbp)
movl $0x2, %edi
callq 0x2220
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rcx
movq %rax, %r8
leaq 0x1d50(%rip), %rsi      # 0x12570
leaq 0x19f3(%rip), %rdx      # 0x1221a
movb $0x0, %al
callq 0x23a0
jmp 0x108e9
movq 0x57a6(%rip), %rax      # 0x15fe0
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, -0xd8(%rbp)
movl $0x15, %edi
callq 0x2220
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rcx
movq %rax, %r8
leaq 0x1cf2(%rip), %rsi      # 0x12570
leaq 0x1995(%rip), %rdx      # 0x1221a
movb $0x0, %al
callq 0x23a0
jmp 0x108e9
movq 0x574b(%rip), %rax      # 0x15fe0
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
movq -0x28(%rbp), %rax
movq 0xc8(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, -0xe8(%rbp)
callq 0x2300
movl (%rax), %edi
callq 0x2220
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rcx
movq %rax, %r8
leaq 0x1c95(%rip), %rsi      # 0x12570
leaq 0x1938(%rip), %rdx      # 0x1221a
movb $0x0, %al
callq 0x23a0
movq -0x28(%rbp), %rax
movq 0x268(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)