#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*/ filter_image(double **, double **, int, int);
int /*<<< orphan*/ free(double **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int line = 3;
  int row = 8;
  double **im = NULL, **im2 = NULL;
  im = (double **)malloc(line * sizeof(double *));
  im2 = (double **)malloc(line * sizeof(double *));
  int i = 0, j = 0;
  for (i = 0; i < line; i++) {
    im[i] = (double *)malloc(row * sizeof(double));
    im2[i] = (double *)malloc(row * sizeof(double));
  }
  int k = 0;
  for (i = 0; i < line; i++) {
    k = 1;
    for (j = 0; j < row; j++) {
      if (k > 4) {
        k = 1;
      }
      im[i][j] = (double)(2 * k);
      k++;
    }
  }
  filter_image(im, im2, line, row);
  for (i = 0; i < line; i++) {
    for (j = 0; j < row; j++) {
      printf("%f ", im[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  for (i = 0; i < line; i++) {
    for (j = 0; j < row; j++) {
      printf("%f ", im2[i][j]);
    }
    printf("\n");
  }
  free(im);
  free(im2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1205 <main+0xc5>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11af <main+0x6f>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1293 <main+0x153>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1280 <main+0x140>
cmpl   $0x4,-0x34(%rbp)
jle    124a <main+0x10a>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    122d <main+0xed>
jmp    1285 <main+0x145>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1213 <main+0xd3>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <filter_image@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1319 <main+0x1d9>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12fd <main+0x1bd>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd18(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12c0 <main+0x180>
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12ad <main+0x16d>
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    139a <main+0x25a>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    137e <main+0x23e>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xc97(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1341 <main+0x201>
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    132e <main+0x1ee>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x18,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x18,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,(%rbx)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,(%r14)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,0x8(%r14)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,0x10(%r14)
mov    (%rbx),%rax
movaps 0xe35(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xe3b(%rip),%xmm1
movups %xmm1,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm1,0x30(%rax)
mov    0x8(%rbx),%rax
movups %xmm0,(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm1,0x30(%rax)
mov    0x10(%rbx),%rax
movups %xmm0,(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm1,0x30(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    $0x8,%ecx
call   1060 <filter_image@plt>
mov    (%rbx),%rax
movsd  (%rax),%xmm0
lea    0xdf6(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%rbx),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rbx),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rbx),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rbx),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%rbx),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    (%r14),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    (%r14),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%r14),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%r14),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%r14),%rax
movsd  (%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x8(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x10(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x18(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x20(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x28(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x30(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x10(%r14),%rax
movsd  0x38(%rax),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double**
%9 = alloca double**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
store i32 8, i32* %7
store double** null, double*** %8
store double** null, double*** %9
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to double**
store double** %18, double*** %8
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = trunc i64 %21 to i32
%23 = call i64 @malloc(i32 %22)
%24 = inttoptr i64 %23 to double**
store double** %24, double*** %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %10
br label %25
25: ; preds = %50, %2
%26 = load i32, i32* %10
%27 = load i32, i32* %6
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %53
29: ; preds = %25
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = mul i64 %31, 8
%33 = trunc i64 %32 to i32
%34 = call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to double*
%36 = load double**, double*** %8
%37 = load i32, i32* %10
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double*, double** %36, i64 %38
store double* %35, double** %39
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to double*
%46 = load double**, double*** %9
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double*, double** %46, i64 %48
store double* %45, double** %49
br label %50
50: ; preds = %29
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
br label %25
53: ; preds = %25
store i32 0, i32* %12
store i32 0, i32* %10
br label %54
54: ; preds = %85, %53
%55 = load i32, i32* %10
%56 = load i32, i32* %6
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %88
58: ; preds = %54
store i32 1, i32* %12
store i32 0, i32* %11
br label %59
59: ; preds = %81, %58
%60 = load i32, i32* %11
%61 = load i32, i32* %7
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %84
63: ; preds = %59
%64 = load i32, i32* %12
%65 = icmp sgt i32 %64, 4
br i1 %65, label %66, label %67
66: ; preds = %63
store i32 1, i32* %12
br label %67
67: ; preds = %66, %63
%68 = load i32, i32* %12
%69 = mul nsw i32 2, %68
%70 = sitofp i32 %69 to double
%71 = load double**, double*** %8
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double*, double** %71, i64 %73
%75 = load double*, double** %74
%76 = load i32, i32* %11
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %75, i64 %77
store double %70, double* %78
%79 = load i32, i32* %12
%80 = add nsw i32 %79, 1
store i32 %80, i32* %12
br label %81
81: ; preds = %67
%82 = load i32, i32* %11
%83 = add nsw i32 %82, 1
store i32 %83, i32* %11
br label %59
84: ; preds = %59
br label %85
85: ; preds = %84
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %54
88: ; preds = %54
%89 = load double**, double*** %8
%90 = load double**, double*** %9
%91 = load i32, i32* %6
%92 = load i32, i32* %7
%93 = call i32 @filter_image(double** %89, double** %90, i32 %91, i32 %92)
store i32 0, i32* %10
br label %94
94: ; preds = %119, %88
%95 = load i32, i32* %10
%96 = load i32, i32* %6
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %122
98: ; preds = %94
store i32 0, i32* %11
br label %99
99: ; preds = %114, %98
%100 = load i32, i32* %11
%101 = load i32, i32* %7
%102 = icmp slt i32 %100, %101
br i1 %102, label %103, label %117
103: ; preds = %99
%104 = load double**, double*** %8
%105 = load i32, i32* %10
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double*, double** %104, i64 %106
%108 = load double*, double** %107
%109 = load i32, i32* %11
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %112)
br label %114
114: ; preds = %103
%115 = load i32, i32* %11
%116 = add nsw i32 %115, 1
store i32 %116, i32* %11
br label %99
117: ; preds = %99
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %119
119: ; preds = %117
%120 = load i32, i32* %10
%121 = add nsw i32 %120, 1
store i32 %121, i32* %10
br label %94
122: ; preds = %94
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %10
br label %124
124: ; preds = %149, %122
%125 = load i32, i32* %10
%126 = load i32, i32* %6
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %152
128: ; preds = %124
store i32 0, i32* %11
br label %129
129: ; preds = %144, %128
%130 = load i32, i32* %11
%131 = load i32, i32* %7
%132 = icmp slt i32 %130, %131
br i1 %132, label %133, label %147
133: ; preds = %129
%134 = load double**, double*** %9
%135 = load i32, i32* %10
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double*, double** %134, i64 %136
%138 = load double*, double** %137
%139 = load i32, i32* %11
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
%142 = load double, double* %141
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %142)
br label %144
144: ; preds = %133
%145 = load i32, i32* %11
%146 = add nsw i32 %145, 1
store i32 %146, i32* %11
br label %129
147: ; preds = %129
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %149
149: ; preds = %147
%150 = load i32, i32* %10
%151 = add nsw i32 %150, 1
store i32 %151, i32* %10
br label %124
152: ; preds = %124
%153 = load double**, double*** %8
%154 = call i32 @free(double** %153)
%155 = load double**, double*** %9
%156 = call i32 @free(double** %155)
ret i32 0
}

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