#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 /*<<< orphan*/ DisplayReTable(int /*<<< orphan*/ *);
int /*<<< orphan*/ ReadDataBase_AA(char *);
int /*<<< orphan*/ ReadDataBase_RE(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcpy(char *, char *);
void main(int argc, char *argv[]) {
  char aa_database[12];
  char re_database[12];
  char fname[12];
  FILE *fp;
  printf("Program to generate Restriction Enzyme Table\n");
  strcpy(aa_database, "dbase1");
  ReadDataBase_AA(aa_database);
  strcpy(re_database, "dbase2");
  ReadDataBase_RE(re_database);
  if (argc > 1) {
    if ((fp = fopen(argv[1], "w+")) == (FILE *)NULL)
      fp = stdout;
  } else
    fp = stdout;
  DisplayReTable(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x1c(%rbp),%rdi
call   1060 <ReadDataBase_AA@plt>
lea    -0x28(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x28(%rbp),%rdi
call   1030 <ReadDataBase_RE@plt>
cmpl   $0x1,-0x4(%rbp)
jle    11ec <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe76(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    11e7 <main+0x87>
mov    0x2e00(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    11fa <main+0x9a>
mov    0x2ded(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1070 <DisplayReTable@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xe9d(%rip),%rdi
call   1050 <puts@plt>
lea    0xe80(%rip),%rsi
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <ReadDataBase_AA@plt>
lea    0xe6b(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <ReadDataBase_RE@plt>
cmp    $0x2,%ebp
jl     11ce <main+0x6e>
mov    0x8(%r14),%rdi
lea    0xe4d(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rdi
test   %rax,%rax
jne    11d8 <main+0x78>
mov    0x2e0b(%rip),%rax
mov    (%rax),%rdi
call   1070 <DisplayReTable@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Program to generate Restriction Enzyme Table\0A\00"
@.str.1 = [7 x i8] c"dbase1\00"
@.str.2 = [7 x i8] c"dbase2\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32* null
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [12 x i8]
%6 = alloca [12 x i8]
%7 = alloca [12 x i8]
%8 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%13 = call i32 @ReadDataBase_AA(i8* %12)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%17 = call i32 @ReadDataBase_RE(i8* %16)
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %29
20: ; preds = %2
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %24, i32** %8
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = load i32*, i32** @stdout
store i32* %27, i32** %8
br label %28
28: ; preds = %26, %20
br label %31
29: ; preds = %2
%30 = load i32*, i32** @stdout
store i32* %30, i32** %8
br label %31
31: ; preds = %29, %28
%32 = load i32*, i32** %8
%33 = call i32 @DisplayReTable(i32* %32)
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"dbase1\00"
@.str.2 = [7 x i8] c"dbase2\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32* null
@str = [45 x i8] c"Program to generate Restriction Enzyme Table\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%8 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @ReadDataBase_AA(i8* %5)
%10 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @ReadDataBase_RE(i8* %6)
%12 = icmp sgt i32 %0, 1
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32* %16, null
%18 = load i32*, i32** @stdout
%19 = select i1 %17, i32* %18, i32* %16
br label %22
20: ; preds = %2
%21 = load i32*, i32** @stdout
br label %22
22: ; preds = %13, %20
%23 = phi i32* [ %21, %20 ], [ %19, %13 ]
%24 = call i32 @DisplayReTable(i32* %23)
ret void
}