#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*/ chkrows(float *);
int /*<<< orphan*/ free(float *);
float *malloc(int);
int /*<<< orphan*/ mmltg(float *, float *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ prttm(float *, char *);
int main(int argc, char *argv[]) {
  char s[4] = {'A', 'C', 'G', 'T'};
  float plus[(4 * 4)] = {.18,  .274, .426, .12,  .17025, .36725, .27325, .18725,
                         .161, .339, .375, .125, .079,   .355,   .384,   .182};
  float minus[(4 * 4)] = {.3,   .205, .285, .21,  .322, .298, .078, .302,
                          .248, .246, .298, .208, .177, .239, .292, .292};
  chkrows(plus);
  float *tmm = malloc((4 * 4) * sizeof(float));
  printf("Transition matrix for bases within an island:\n");
  prttm(plus, s);
  printf("Transition matrix for bases OUTSIDE of a CpG island:\n");
  prttm(minus, s);
  int times = 565;
  mmltg(plus, tmm, times);
  printf("plus transition matrix multiplied %i times:\n", times);
  prttm(tmm, s);
  mmltg(minus, tmm, times);
  printf("minus transition matrix multiplied %i times:\n", times);
  prttm(tmm, s);
  free(tmm);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe71(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe73(%rip),%rsi
mov    $0x40,%edx
call   1060 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x40,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
call   1040 <chkrows@plt>
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,-0xa8(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <prttm@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <prttm@plt>
movl   $0x235,-0xac(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    -0xac(%rbp),%edx
call   1080 <mmltg@plt>
mov    -0xac(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <prttm@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
mov    -0xac(%rbp),%edx
call   1080 <mmltg@plt>
mov    -0xac(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <prttm@plt>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x98,%rsp
movl   $0x54474341,0xc(%rsp)
54
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe84(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe68(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe4c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe78(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe5c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x50(%rsp),%r15
mov    %r15,%rdi
call   1050 <chkrows@plt>
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <prttm@plt>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <prttm@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x235,%edx
call   1080 <mmltg@plt>
lea    0xe2e(%rip),%rdi
mov    $0x235,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <prttm@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x235,%edx
call   1080 <mmltg@plt>
lea    0xe2d(%rip),%rdi
mov    $0x235,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <prttm@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = [4 x i8] c"ACGT"
@__const.main.plus = [16 x float] [float 0x3FC70A3D80000000, float 0x3FD1893740000000, float 0x3FDB439580000000, float 0x3FBEB851E0000000, float 0x3FC5CAC080000000, float 0x3FD7810620000000, float 0x3FD17CEDA0000000, float 0x3FC7F7CEE0000000, float 0x3FC49BA5E0000000, float 0x3FD5B22D00000000, float 3.750000e-01, float 1.250000e-01, float 0x3FB4395820000000, float 0x3FD6B851E0000000, float 0x3FD89374C0000000, float 0x3FC74BC6A0000000]
@__const.main.minus = [16 x float] [float 0x3FD3333340000000, float 0x3FCA3D70A0000000, float 0x3FD23D70A0000000, float 0x3FCAE147A0000000, float 0x3FD49BA5E0000000, float 0x3FD3126EA0000000, float 0x3FB3F7CEE0000000, float 0x3FD353F7C0000000, float 0x3FCFBE76C0000000, float 0x3FCF7CEDA0000000, float 0x3FD3126EA0000000, float 0x3FCA9FBE80000000, float 0x3FC6A7EFA0000000, float 0x3FCE978D40000000, float 0x3FD2B020C0000000, float 0x3FD2B020C0000000]
@.str = [47 x i8] c"Transition matrix for bases within an island:\0A\00"
@.str.1 = [54 x i8] c"Transition matrix for bases OUTSIDE of a CpG island:\0A\00"
@.str.2 = [45 x i8] c"plus transition matrix multiplied %i times:\0A\00"
@.str.3 = [46 x i8] c"minus transition matrix multiplied %i times:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
%7 = alloca [16 x float]
%8 = alloca [16 x float]
%9 = alloca float*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [4 x i8]* %6 to i8*
%12 = bitcast [16 x float]* %7 to i8*
%13 = bitcast [16 x float]* %8 to i8*
%14 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%15 = call i32 @chkrows(float* %14)
%16 = call float* @malloc(i32 64)
store float* %16, float** %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%20 = call i32 @prttm(float* %18, i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%22 = getelementptr inbounds [16 x float], [16 x float]* %8, i64 0, i64 0
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%24 = call i32 @prttm(float* %22, i8* %23)
store i32 565, i32* %10
%25 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%26 = load float*, float** %9
%27 = load i32, i32* %10
%28 = call i32 @mmltg(float* %25, float* %26, i32 %27)
%29 = load i32, i32* %10
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load float*, float** %9
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%33 = call i32 @prttm(float* %31, i8* %32)
%34 = getelementptr inbounds [16 x float], [16 x float]* %8, i64 0, i64 0
%35 = load float*, float** %9
%36 = load i32, i32* %10
%37 = call i32 @mmltg(float* %34, float* %35, i32 %36)
%38 = load i32, i32* %10
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = load float*, float** %9
%41 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%42 = call i32 @prttm(float* %40, i8* %41)
%43 = load float*, float** %9
%44 = call i32 @free(float* %43)
ret i32 0
}

LLVM IR (-O2):
@__const.main.plus = [16 x float] [float 0x3FC70A3D80000000, float 0x3FD1893740000000, float 0x3FDB439580000000, float 0x3FBEB851E0000000, float 0x3FC5CAC080000000, float 0x3FD7810620000000, float 0x3FD17CEDA0000000, float 0x3FC7F7CEE0000000, float 0x3FC49BA5E0000000, float 0x3FD5B22D00000000, float 3.750000e-01, float 1.250000e-01, float 0x3FB4395820000000, float 0x3FD6B851E0000000, float 0x3FD89374C0000000, float 0x3FC74BC6A0000000]
@__const.main.minus = [16 x float] [float 0x3FD3333340000000, float 0x3FCA3D70A0000000, float 0x3FD23D70A0000000, float 0x3FCAE147A0000000, float 0x3FD49BA5E0000000, float 0x3FD3126EA0000000, float 0x3FB3F7CEE0000000, float 0x3FD353F7C0000000, float 0x3FCFBE76C0000000, float 0x3FCF7CEDA0000000, float 0x3FD3126EA0000000, float 0x3FCA9FBE80000000, float 0x3FC6A7EFA0000000, float 0x3FCE978D40000000, float 0x3FD2B020C0000000, float 0x3FD2B020C0000000]
@.str.2 = [45 x i8] c"plus transition matrix multiplied %i times:\0A\00"
@.str.3 = [46 x i8] c"minus transition matrix multiplied %i times:\0A\00"
@str = [46 x i8] c"Transition matrix for bases within an island:\00"
@str.4 = [53 x i8] c"Transition matrix for bases OUTSIDE of a CpG island:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [16 x float]
%5 = alloca [16 x float]
%6 = bitcast i32* %3 to i8*
store i32 1413956417, i32* %3
%7 = bitcast [16 x float]* %4 to i8*
%8 = bitcast [16 x float]* %5 to i8*
%9 = getelementptr inbounds [16 x float], [16 x float]* %4, i64 0, i64 0
%10 = call i32 @chkrows(float* %9)
%11 = call float* @malloc(i32 64)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%13 = call i32 @prttm(float* %9, i8* %6)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.4, i64 0, i64 0))
%15 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%16 = call i32 @prttm(float* %15, i8* %6)
%17 = call i32 @mmltg(float* %9, float* %11, i32 565)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i32 565)
%19 = call i32 @prttm(float* %11, i8* %6)
%20 = call i32 @mmltg(float* %15, float* %11, i32 565)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 565)
%22 = call i32 @prttm(float* %11, i8* %6)
%23 = call i32 @free(float* %11)
ret i32 0
}