#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 uint16_t;
typedef int int8_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ FWHT(int *, int);
int **HadamardMatrix(int);
int /*<<< orphan*/ freeHadamardMatrix(int **, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  uint16_t order = 0;
  uint16_t signal_length = 16;
  int16_t is[16] = {0, 1, 2, 5, -5, -2, -1, 0, 8, -9, 2, 5, -5, -2, -1, 0};
  int16_t result1[16] = {0};
  signal_length--;
  while (signal_length) {
    order++;
    signal_length >>= 1;
  }
  int8_t **matrix = HadamardMatrix(order);
  uint16_t x, y, block_edge;
  block_edge = 1 << order;
  printf("Hadamard Matrix to be used (order : %d)\n", order);
  for (y = 0; y < block_edge; y++) {
    for (x = 0; x < block_edge; x++)
      printf("% 2d", matrix[x][y]);
    printf("\n");
  }
  FWHT(is, order);
  printf("Coefficients ");
  for (x = 0; x < (1 << order); x++) {
    printf("% 4d ", is[x]);
  }
  printf("\n");
  printf("Output ");
  for (x = 0; x < 16; x++) {
    for (y = 0; y < 16; y++) {
      result1[x] += matrix[x][y] * is[y];
    }
    result1[x] >>= order;
    printf("% 2d,", result1[x]);
  }
  printf("\n");
  freeHadamardMatrix(matrix, block_edge);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe75(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11d2 <main+0x72>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b1 <main+0x51>
mov    -0x8(%rbp),%edi
call   1060 <HadamardMatrix@plt>
mov    %rax,-0x98(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xa4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    129a <main+0x13a>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    1278 <main+0x118>
mov    -0x98(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1228 <main+0xc8>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    120c <main+0xac>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1070 <FWHT@plt>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jge    1305 <main+0x1a5>
movslq -0x9c(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    12be <main+0x15e>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x9c(%rbp)
cmpl   $0x10,-0x9c(%rbp)
jge    13ec <main+0x28c>
movl   $0x0,-0xa0(%rbp)
cmpl   $0x10,-0xa0(%rbp)
jge    13a0 <main+0x240>
mov    -0x98(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0xa0(%rbp),%rax
imul   -0x50(%rbp,%rax,4),%ecx
movslq -0x9c(%rbp),%rax
add    -0x90(%rbp,%rax,4),%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1342 <main+0x1e2>
mov    -0x8(%rbp),%ecx
movslq -0x9c(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
movslq -0x9c(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    132b <main+0x1cb>
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1080 <freeHadamardMatrix@plt>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe95(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe79(%rip),%xmm0
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
mov    $0x4,%edi
call   1050 <HadamardMatrix@plt>
mov    %rax,%r14
lea    0xe8a(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea0(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x58(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x60(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x68(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x70(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x78(%r14),%rax
mov    (%rax,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x4,%rbx
cmp    $0x40,%rbx
jne    11d0 <main+0x80>
mov    %rsp,%rdi
mov    $0x4,%esi
call   1060 <FWHT@plt>
lea    0xd63(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xd60(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc79(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc73(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rax
mov    (%rsp),%ecx
mov    0x4(%rsp),%edx
imul   (%rax),%ecx
add    0x40(%rsp,%rbx,4),%ecx
imul   0x4(%rax),%edx
mov    0x8(%rsp),%esi
imul   0x8(%rax),%esi
add    %ecx,%edx
mov    0xc(%rsp),%ecx
imul   0xc(%rax),%ecx
add    %edx,%esi
mov    0x10(%rsp),%edx
imul   0x10(%rax),%edx
add    %esi,%ecx
mov    0x14(%rsp),%esi
imul   0x14(%rax),%esi
add    %ecx,%edx
mov    0x18(%rsp),%ecx
imul   0x18(%rax),%ecx
add    %edx,%esi
mov    0x1c(%rsp),%edx
imul   0x1c(%rax),%edx
add    %esi,%ecx
mov    0x20(%rsp),%esi
imul   0x20(%rax),%esi
add    %ecx,%edx
mov    0x24(%rsp),%ecx
imul   0x24(%rax),%ecx
add    %edx,%esi
mov    0x28(%rsp),%edx
imul   0x28(%rax),%edx
add    %esi,%ecx
mov    0x2c(%rsp),%esi
imul   0x2c(%rax),%esi
add    %ecx,%edx
mov    0x30(%rsp),%ecx
imul   0x30(%rax),%ecx
add    %edx,%esi
mov    0x34(%rsp),%edx
imul   0x34(%rax),%edx
add    %esi,%ecx
mov    0x38(%rsp),%edi
imul   0x38(%rax),%edi
add    %ecx,%edx
mov    0x3c(%rsp),%esi
imul   0x3c(%rax),%esi
add    %edx,%edi
add    %edi,%esi
sar    $0x4,%esi
mov    %esi,0x40(%rsp,%rbx,4)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1420 <main+0x2d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x10,%esi
call   1070 <freeHadamardMatrix@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.is = [16 x i32] [i32 0, i32 1, i32 2, i32 5, i32 -5, i32 -2, i32 -1, i32 0, i32 8, i32 -9, i32 2, i32 5, i32 -5, i32 -2, i32 -1, i32 0]
@.str = [41 x i8] c"Hadamard Matrix to be used (order : %d)\0A\00"
@.str.1 = [5 x i8] c"% 2d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [14 x i8] c"Coefficients \00"
@.str.4 = [6 x i8] c"% 4d \00"
@.str.5 = [8 x i8] c"Output \00"
@.str.6 = [6 x i8] c"% 2d,\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [16 x i32]
%5 = alloca [16 x i32]
%6 = alloca i32**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 16, i32* %3
%10 = bitcast [16 x i32]* %4 to i8*
%11 = bitcast [16 x i32]* %5 to i8*
%12 = load i32, i32* %3
%13 = add nsw i32 %12, -1
store i32 %13, i32* %3
br label %14
14: ; preds = %17, %0
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = ashr i32 %20, 1
store i32 %21, i32* %3
br label %14
22: ; preds = %14
%23 = load i32, i32* %2
%24 = call i32** @HadamardMatrix(i32 %23)
store i32** %24, i32*** %6
%25 = load i32, i32* %2
%26 = shl i32 1, %25
store i32 %26, i32* %9
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %27)
store i32 0, i32* %8
br label %29
29: ; preds = %54, %22
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %57
33: ; preds = %29
store i32 0, i32* %7
br label %34
34: ; preds = %49, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %9
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %52
38: ; preds = %34
%39 = load i32**, i32*** %6
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32*, i32** %39, i64 %41
%43 = load i32*, i32** %42
%44 = load i32, i32* %8
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %43, i64 %45
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %38
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %34
52: ; preds = %34
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %52
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %29
57: ; preds = %29
%58 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%59 = load i32, i32* %2
%60 = call i32 @FWHT(i32* %58, i32 %59)
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %62
62: ; preds = %73, %57
%63 = load i32, i32* %7
%64 = load i32, i32* %2
%65 = shl i32 1, %64
%66 = icmp slt i32 %63, %65
br i1 %66, label %67, label %76
67: ; preds = %62
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %71)
br label %73
73: ; preds = %67
%74 = load i32, i32* %7
%75 = add nsw i32 %74, 1
store i32 %75, i32* %7
br label %62
76: ; preds = %62
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %7
br label %79
79: ; preds = %121, %76
%80 = load i32, i32* %7
%81 = icmp slt i32 %80, 16
br i1 %81, label %82, label %124
82: ; preds = %79
store i32 0, i32* %8
br label %83
83: ; preds = %106, %82
%84 = load i32, i32* %8
%85 = icmp slt i32 %84, 16
br i1 %85, label %86, label %109
86: ; preds = %83
%87 = load i32**, i32*** %6
%88 = load i32, i32* %7
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32*, i32** %87, i64 %89
%91 = load i32*, i32** %90
%92 = load i32, i32* %8
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %91, i64 %93
%95 = load i32, i32* %94
%96 = load i32, i32* %8
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %97
%99 = load i32, i32* %98
%100 = mul nsw i32 %95, %99
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %102
%104 = load i32, i32* %103
%105 = add nsw i32 %104, %100
store i32 %105, i32* %103
br label %106
106: ; preds = %86
%107 = load i32, i32* %8
%108 = add nsw i32 %107, 1
store i32 %108, i32* %8
br label %83
109: ; preds = %83
%110 = load i32, i32* %2
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %112
%114 = load i32, i32* %113
%115 = ashr i32 %114, %110
store i32 %115, i32* %113
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %109
%122 = load i32, i32* %7
%123 = add nsw i32 %122, 1
store i32 %123, i32* %7
br label %79
124: ; preds = %79
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%126 = load i32**, i32*** %6
%127 = load i32, i32* %9
%128 = call i32 @freeHadamardMatrix(i32** %126, i32 %127)
%129 = load i32, i32* %1
ret i32 %129
}

LLVM IR (-O2):
@__const.main.is = [16 x i32] [i32 0, i32 1, i32 2, i32 5, i32 -5, i32 -2, i32 -1, i32 0, i32 8, i32 -9, i32 2, i32 5, i32 -5, i32 -2, i32 -1, i32 0]
@.str = [41 x i8] c"Hadamard Matrix to be used (order : %d)\0A\00"
@.str.1 = [5 x i8] c"% 2d\00"
@.str.3 = [14 x i8] c"Coefficients \00"
@.str.4 = [6 x i8] c"% 4d \00"
@.str.5 = [8 x i8] c"Output \00"
@.str.6 = [6 x i8] c"% 2d,\00"
define i32 @main() {
%1 = alloca [16 x i32]
%2 = alloca [16 x i32]
%3 = bitcast [16 x i32]* %1 to i8*
%4 = bitcast [16 x i32]* %2 to i8*
%5 = tail call i32** @HadamardMatrix(i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = getelementptr inbounds i32*, i32** %5, i64 1
%8 = getelementptr inbounds i32*, i32** %5, i64 2
%9 = getelementptr inbounds i32*, i32** %5, i64 3
%10 = getelementptr inbounds i32*, i32** %5, i64 4
%11 = getelementptr inbounds i32*, i32** %5, i64 5
%12 = getelementptr inbounds i32*, i32** %5, i64 6
%13 = getelementptr inbounds i32*, i32** %5, i64 7
%14 = getelementptr inbounds i32*, i32** %5, i64 8
%15 = getelementptr inbounds i32*, i32** %5, i64 9
%16 = getelementptr inbounds i32*, i32** %5, i64 10
%17 = getelementptr inbounds i32*, i32** %5, i64 11
%18 = getelementptr inbounds i32*, i32** %5, i64 12
%19 = getelementptr inbounds i32*, i32** %5, i64 13
%20 = getelementptr inbounds i32*, i32** %5, i64 14
%21 = getelementptr inbounds i32*, i32** %5, i64 15
br label %22
22: ; preds = %0, %22
%23 = phi i64 [ 0, %0 ], [ %89, %22 ]
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i64 %23
%26 = load i32, i32* %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %7
%29 = getelementptr inbounds i32, i32* %28, i64 %23
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = load i32*, i32** %8
%33 = getelementptr inbounds i32, i32* %32, i64 %23
%34 = load i32, i32* %33
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = load i32*, i32** %9
%37 = getelementptr inbounds i32, i32* %36, i64 %23
%38 = load i32, i32* %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = load i32*, i32** %10
%41 = getelementptr inbounds i32, i32* %40, i64 %23
%42 = load i32, i32* %41
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = load i32*, i32** %11
%45 = getelementptr inbounds i32, i32* %44, i64 %23
%46 = load i32, i32* %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = load i32*, i32** %12
%49 = getelementptr inbounds i32, i32* %48, i64 %23
%50 = load i32, i32* %49
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = load i32*, i32** %13
%53 = getelementptr inbounds i32, i32* %52, i64 %23
%54 = load i32, i32* %53
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = load i32*, i32** %14
%57 = getelementptr inbounds i32, i32* %56, i64 %23
%58 = load i32, i32* %57
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %58)
%60 = load i32*, i32** %15
%61 = getelementptr inbounds i32, i32* %60, i64 %23
%62 = load i32, i32* %61
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %62)
%64 = load i32*, i32** %16
%65 = getelementptr inbounds i32, i32* %64, i64 %23
%66 = load i32, i32* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %66)
%68 = load i32*, i32** %17
%69 = getelementptr inbounds i32, i32* %68, i64 %23
%70 = load i32, i32* %69
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %70)
%72 = load i32*, i32** %18
%73 = getelementptr inbounds i32, i32* %72, i64 %23
%74 = load i32, i32* %73
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%76 = load i32*, i32** %19
%77 = getelementptr inbounds i32, i32* %76, i64 %23
%78 = load i32, i32* %77
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = load i32*, i32** %20
%81 = getelementptr inbounds i32, i32* %80, i64 %23
%82 = load i32, i32* %81
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %82)
%84 = load i32*, i32** %21
%85 = getelementptr inbounds i32, i32* %84, i64 %23
%86 = load i32, i32* %85
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %86)
%88 = tail call i32 @putchar(i32 10)
%89 = add nuw nsw i64 %23, 1
%90 = icmp eq i64 %89, 16
br i1 %90, label %91, label %22
91: ; preds = %22
%92 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%93 = call i32 @FWHT(i32* %92, i32 4)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%95 = load i32, i32* %92
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %95)
%97 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 1
%98 = load i32, i32* %97
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 2
%101 = load i32, i32* %100
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %101)
%103 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 3
%104 = load i32, i32* %103
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %104)
%106 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 4
%107 = load i32, i32* %106
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %107)
%109 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 5
%110 = load i32, i32* %109
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %110)
%112 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 6
%113 = load i32, i32* %112
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %113)
%115 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 7
%116 = load i32, i32* %115
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %116)
%118 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 8
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %119)
%121 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 9
%122 = load i32, i32* %121
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %122)
%124 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 10
%125 = load i32, i32* %124
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %125)
%127 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 11
%128 = load i32, i32* %127
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %128)
%130 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 12
%131 = load i32, i32* %130
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %131)
%133 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 13
%134 = load i32, i32* %133
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %134)
%136 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 14
%137 = load i32, i32* %136
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %137)
%139 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 15
%140 = load i32, i32* %139
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %140)
%142 = call i32 @putchar(i32 10)
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%144 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 1
%145 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 2
%146 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 3
%147 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 4
%148 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 5
%149 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 6
%150 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 7
%151 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 8
%152 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 9
%153 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 10
%154 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 11
%155 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 12
%156 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 13
%157 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 14
%158 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 15
br label %159
159: ; preds = %91, %159
%160 = phi i64 [ 0, %91 ], [ %246, %159 ]
%161 = getelementptr inbounds i32*, i32** %5, i64 %160
%162 = load i32*, i32** %161
%163 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 %160
%164 = load i32, i32* %163
%165 = load i32, i32* %162
%166 = load i32, i32* %92
%167 = mul nsw i32 %166, %165
%168 = add nsw i32 %164, %167
%169 = getelementptr inbounds i32, i32* %162, i64 1
%170 = load i32, i32* %169
%171 = load i32, i32* %144
%172 = mul nsw i32 %171, %170
%173 = add nsw i32 %168, %172
%174 = getelementptr inbounds i32, i32* %162, i64 2
%175 = load i32, i32* %174
%176 = load i32, i32* %145
%177 = mul nsw i32 %176, %175
%178 = add nsw i32 %173, %177
%179 = getelementptr inbounds i32, i32* %162, i64 3
%180 = load i32, i32* %179
%181 = load i32, i32* %146
%182 = mul nsw i32 %181, %180
%183 = add nsw i32 %178, %182
%184 = getelementptr inbounds i32, i32* %162, i64 4
%185 = load i32, i32* %184
%186 = load i32, i32* %147
%187 = mul nsw i32 %186, %185
%188 = add nsw i32 %183, %187
%189 = getelementptr inbounds i32, i32* %162, i64 5
%190 = load i32, i32* %189
%191 = load i32, i32* %148
%192 = mul nsw i32 %191, %190
%193 = add nsw i32 %188, %192
%194 = getelementptr inbounds i32, i32* %162, i64 6
%195 = load i32, i32* %194
%196 = load i32, i32* %149
%197 = mul nsw i32 %196, %195
%198 = add nsw i32 %193, %197
%199 = getelementptr inbounds i32, i32* %162, i64 7
%200 = load i32, i32* %199
%201 = load i32, i32* %150
%202 = mul nsw i32 %201, %200
%203 = add nsw i32 %198, %202
%204 = getelementptr inbounds i32, i32* %162, i64 8
%205 = load i32, i32* %204
%206 = load i32, i32* %151
%207 = mul nsw i32 %206, %205
%208 = add nsw i32 %203, %207
%209 = getelementptr inbounds i32, i32* %162, i64 9
%210 = load i32, i32* %209
%211 = load i32, i32* %152
%212 = mul nsw i32 %211, %210
%213 = add nsw i32 %208, %212
%214 = getelementptr inbounds i32, i32* %162, i64 10
%215 = load i32, i32* %214
%216 = load i32, i32* %153
%217 = mul nsw i32 %216, %215
%218 = add nsw i32 %213, %217
%219 = getelementptr inbounds i32, i32* %162, i64 11
%220 = load i32, i32* %219
%221 = load i32, i32* %154
%222 = mul nsw i32 %221, %220
%223 = add nsw i32 %218, %222
%224 = getelementptr inbounds i32, i32* %162, i64 12
%225 = load i32, i32* %224
%226 = load i32, i32* %155
%227 = mul nsw i32 %226, %225
%228 = add nsw i32 %223, %227
%229 = getelementptr inbounds i32, i32* %162, i64 13
%230 = load i32, i32* %229
%231 = load i32, i32* %156
%232 = mul nsw i32 %231, %230
%233 = add nsw i32 %228, %232
%234 = getelementptr inbounds i32, i32* %162, i64 14
%235 = load i32, i32* %234
%236 = load i32, i32* %157
%237 = mul nsw i32 %236, %235
%238 = add nsw i32 %233, %237
%239 = getelementptr inbounds i32, i32* %162, i64 15
%240 = load i32, i32* %239
%241 = load i32, i32* %158
%242 = mul nsw i32 %241, %240
%243 = add nsw i32 %238, %242
%244 = ashr i32 %243, 4
store i32 %244, i32* %163
%245 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %244)
%246 = add nuw nsw i64 %160, 1
%247 = icmp eq i64 %246, 16
br i1 %247, label %248, label %159
248: ; preds = %159
%249 = call i32 @putchar(i32 10)
%250 = call i32 @freeHadamardMatrix(i32** %5, i32 16)
ret i32 0
}