#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 */

/* Variables and functions */
int /*<<< orphan*/ SmithWaterman(char *, char *);
int /*<<< orphan*/ printf(char *);
char random_number_gen();
int main(int argc, char *argv[]) {
  int i;
  char aa[21];
  char q[78];
  for (i = 0; i < 21; i++)
    aa[i] = random_number_gen();
  for (i = 0; i < 78; i++)
    q[i] = random_number_gen();
  SmithWaterman(aa, q);
  printf("Smithwaterman finished\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x15,-0x14(%rbp)
jge    1179 <main+0x49>
mov    $0x0,%al
call   1050 <random_number_gen@plt>
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <main+0x20>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4e,-0x14(%rbp)
jge    11a9 <main+0x79>
mov    $0x0,%al
call   1050 <random_number_gen@plt>
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <main+0x50>
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <SmithWaterman@plt>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x1(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x2(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x3(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x4(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x5(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x6(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x7(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x8(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x9(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xa(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xb(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xc(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xd(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xe(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0xf(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x10(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x11(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x12(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x13(%rsp)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x14(%rsp)
xor    %ebx,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1050 <random_number_gen@plt>
mov    %al,0x20(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x4e,%rbx
jne    1220 <main+0xf0>
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1040 <SmithWaterman@plt>
lea    0xdb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Smithwaterman finished\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [21 x i8]
%8 = alloca [78 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 21
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = call signext i8 (...) @random_number_gen()
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 %15
store i8 %13, i8* %16
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %9
20: ; preds = %9
store i32 0, i32* %6
br label %21
21: ; preds = %29, %20
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 78
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = call signext i8 (...) @random_number_gen()
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [78 x i8], [78 x i8]* %8, i64 0, i64 %27
store i8 %25, i8* %28
br label %29
29: ; preds = %24
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %21
32: ; preds = %21
%33 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [78 x i8], [78 x i8]* %8, i64 0, i64 0
%35 = call i32 @SmithWaterman(i8* %33, i8* %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [23 x i8] c"Smithwaterman finished\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [21 x i8]
%4 = alloca [78 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [78 x i8], [78 x i8]* %4, i64 0, i64 0
%7 = tail call signext i8 (...) @random_number_gen()
store i8 %7, i8* %5
%8 = tail call signext i8 (...) @random_number_gen()
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = tail call signext i8 (...) @random_number_gen()
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 2
store i8 %10, i8* %11
%12 = tail call signext i8 (...) @random_number_gen()
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 3
store i8 %12, i8* %13
%14 = tail call signext i8 (...) @random_number_gen()
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 4
store i8 %14, i8* %15
%16 = tail call signext i8 (...) @random_number_gen()
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 5
store i8 %16, i8* %17
%18 = tail call signext i8 (...) @random_number_gen()
%19 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 6
store i8 %18, i8* %19
%20 = tail call signext i8 (...) @random_number_gen()
%21 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 7
store i8 %20, i8* %21
%22 = tail call signext i8 (...) @random_number_gen()
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 8
store i8 %22, i8* %23
%24 = tail call signext i8 (...) @random_number_gen()
%25 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 9
store i8 %24, i8* %25
%26 = tail call signext i8 (...) @random_number_gen()
%27 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 10
store i8 %26, i8* %27
%28 = tail call signext i8 (...) @random_number_gen()
%29 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 11
store i8 %28, i8* %29
%30 = tail call signext i8 (...) @random_number_gen()
%31 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 12
store i8 %30, i8* %31
%32 = tail call signext i8 (...) @random_number_gen()
%33 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 13
store i8 %32, i8* %33
%34 = tail call signext i8 (...) @random_number_gen()
%35 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 14
store i8 %34, i8* %35
%36 = tail call signext i8 (...) @random_number_gen()
%37 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 15
store i8 %36, i8* %37
%38 = tail call signext i8 (...) @random_number_gen()
%39 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 16
store i8 %38, i8* %39
%40 = tail call signext i8 (...) @random_number_gen()
%41 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 17
store i8 %40, i8* %41
%42 = tail call signext i8 (...) @random_number_gen()
%43 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 18
store i8 %42, i8* %43
%44 = tail call signext i8 (...) @random_number_gen()
%45 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 19
store i8 %44, i8* %45
%46 = tail call signext i8 (...) @random_number_gen()
%47 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 20
store i8 %46, i8* %47
br label %48
48: ; preds = %2, %48
%49 = phi i64 [ 0, %2 ], [ %52, %48 ]
%50 = tail call signext i8 (...) @random_number_gen()
%51 = getelementptr inbounds [78 x i8], [78 x i8]* %4, i64 0, i64 %49
store i8 %50, i8* %51
%52 = add nuw nsw i64 %49, 1
%53 = icmp eq i64 %52, 78
br i1 %53, label %54, label %48
54: ; preds = %48
%55 = call i32 @SmithWaterman(i8* %5, i8* %6)
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 1
}