#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int init_dicts(char *d_fasta, char *d_qual, int size) {
  char *dict_f = "fasta.dic";
  char *dict_q = "qual.dic";
  FILE *f_d_fasta = fopen(dict_f, "r");
  if (f_d_fasta == NULL) {
    fprintf(stderr, "error opening qual file %s, result %d %s\n", dict_f, errno,
            strerror(errno));
    return -2;
  };
  fread(d_fasta, size, 1, f_d_fasta);
  fclose(f_d_fasta);
  FILE *f_d_qual = fopen(dict_q, "r");
  if (f_d_qual == NULL) {
    fprintf(stderr, "error opening qual file %s, result %d %s\n", dict_q, errno,
            strerror(errno));
    return -2;
  };
  fread(d_qual, size, 1, f_d_fasta);
  fclose(f_d_qual);
}


x86 assembly (clang, -O0):
<init_dicts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11eb <init_dicts+0x9b>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    0x2e25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rdx
mov    -0x44(%rbp),%ecx
mov    %rax,%r8
lea    0xe3b(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1299 <init_dicts+0x149>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x38(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    127b <init_dicts+0x12b>
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x2d95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%ecx
mov    %rax,%r8
lea    0xdab(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1299 <init_dicts+0x149>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x38(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_dicts>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbp
lea    0xe99(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     11ce <init_dicts+0x7e>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe6d(%rip),%rdi
lea    0xe6f(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     11f7 <init_dicts+0xa7>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
jmp    122a <init_dicts+0xda>
mov    0x2e0b(%rip),%rax
mov    (%rax),%ebx
mov    0x2dfa(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1070 <strerror@plt>
lea    0xe27(%rip),%rsi
lea    0xe0b(%rip),%rdx
jmp    121e <init_dicts+0xce>
mov    0x2de2(%rip),%rax
mov    (%rax),%ebx
mov    0x2dd1(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1070 <strerror@plt>
lea    0xdfe(%rip),%rsi
lea    0xdec(%rip),%rdx
mov    %ebx,%edi
mov    %ebp,%ecx
mov    %rax,%r8
call   1050 <fprintf@plt>
mov    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"fasta.dic\00"
@.str.1 = [9 x i8] c"qual.dic\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [42 x i8] c"error opening qual file %s, result %d %s\0A\00"
@errno = global i32 0
define i32 @init_dicts(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %9
%12 = load i8*, i8** %8
%13 = call i32* @fopen(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %13, i32** %10
%14 = load i32*, i32** %10
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %23
16: ; preds = %3
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %8
%19 = load i32, i32* @errno
%20 = load i32, i32* @errno
%21 = call i8* @strerror(i32 %20)
%22 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %18, i32 %19, i8* %21)
store i32 -2, i32* %4
br label %48
23: ; preds = %3
%24 = load i8*, i8** %5
%25 = load i32, i32* %7
%26 = load i32*, i32** %10
%27 = call i32 @fread(i8* %24, i32 %25, i32 1, i32* %26)
%28 = load i32*, i32** %10
%29 = call i32 @fclose(i32* %28)
%30 = load i8*, i8** %9
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %31, i32** %11
%32 = load i32*, i32** %11
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %41
34: ; preds = %23
%35 = load i32, i32* @stderr
%36 = load i8*, i8** %9
%37 = load i32, i32* @errno
%38 = load i32, i32* @errno
%39 = call i8* @strerror(i32 %38)
%40 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %36, i32 %37, i8* %39)
store i32 -2, i32* %4
br label %48
41: ; preds = %23
%42 = load i8*, i8** %6
%43 = load i32, i32* %7
%44 = load i32*, i32** %10
%45 = call i32 @fread(i8* %42, i32 %43, i32 1, i32* %44)
%46 = load i32*, i32** %11
%47 = call i32 @fclose(i32* %46)
br label %48
48: ; preds = %41, %34, %16
%49 = load i32, i32* %4
ret i32 %49
}

LLVM IR (-O2):
@.str = [10 x i8] c"fasta.dic\00"
@.str.1 = [9 x i8] c"qual.dic\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [42 x i8] c"error opening qual file %s, result %d %s\0A\00"
@errno = global i32 0
define i32 @init_dicts(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
br label %24
11: ; preds = %3
%12 = tail call i32 @fread(i8* %0, i32 %2, i32 1, i32* %4)
%13 = tail call i32 @fclose(i32* %4)
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i32, i32* @errno
%19 = tail call i8* @strerror(i32 %18)
%20 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %18, i8* %19)
br label %24
21: ; preds = %11
%22 = tail call i32 @fread(i8* %1, i32 %2, i32 1, i32* %4)
%23 = tail call i32 @fclose(i32* %14)
br label %24
24: ; preds = %16, %21, %6
ret i32 -2
}