#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 */
void *calloc(int, int);
float consumer_raw(int, int);
int /*<<< orphan*/ printf(char *, int, int, float);
float **noStoreCompute() {
  int x, y, i, j;
  int yo, y_base, y_in, yi, py;
  float **consumer_arr;
  float storeMe;
  int numPasses = 40 / 1;
  if (40 % 1)
    numPasses++;
  consumer_arr = calloc(4, sizeof(float *));
  for (i = 0; i < 4; i++)
    consumer_arr[i] = calloc(40, sizeof(float));
#pragma omp parallel for private(yo, y_in, y_base, x, yi, py, storeMe)
  for (yo = 0; yo < numPasses; yo++) {
    y_base = 1 * yo;
    if (y_base > 40 - 1)
      y_base = 40 - 1;
    for (x = 0; x < 4; x++) {
      for (y_in = 0; y_in < 1; y_in++) {
        y = y_base + y_in;
        storeMe = consumer_raw(x, y);
        if (storeMe - (x * y + (x + 1) * (y + 1) + x * (y + 1) + y * (x + 1)) >
            0.001f)
          printf("HELP HELP I NEED AN ADULT! got producer(%d, %d) = %f\n", x, y,
                 storeMe);
        consumer_arr[x][y] = storeMe;
      }
    }
  }
  return consumer_arr;
}


x86 assembly (clang, -O0):
<noStoreCompute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x28,-0x38(%rbp)
mov    $0x4,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    118f <noStoreCompute+0x5f>
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <noStoreCompute+0x29>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12ae <noStoreCompute+0x17e>
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x27,-0x18(%rbp)
jle    11bc <noStoreCompute+0x8c>
movl   $0x27,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    129b <noStoreCompute+0x16b>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    1288 <noStoreCompute+0x158>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <consumer_raw@plt>
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  0xdc0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1260 <noStoreCompute+0x130>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movss  -0x34(%rbp),%xmm0
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
movss  -0x34(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d4 <noStoreCompute+0xa4>
jmp    128d <noStoreCompute+0x15d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c3 <noStoreCompute+0x93>
jmp    12a0 <noStoreCompute+0x170>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <noStoreCompute+0x66>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noStoreCompute>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0x4,%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,0x30(%rsp)
mov    %rax,(%rbx)
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,0x28(%rsp)
mov    %rax,0x8(%rbx)
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,0x20(%rsp)
mov    %rax,0x10(%rbx)
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %rax,0x18(%rbx)
mov    $0x1,%r15d
mov    $0x7,%r12d
mov    $0x5,%r13d
mov    $0x3,%ebx
mov    $0x1,%ebp
jmp    1208 <noStoreCompute+0xd8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x18(%rsp),%rax
movss  %xmm0,-0x4(%rax,%r15,4)
add    $0x1,%r15
add    $0xe,%r12d
add    $0xa,%r13d
add    $0x6,%ebx
add    $0x2,%ebp
cmp    $0x29,%r15
je     1349 <noStoreCompute+0x219>
lea    -0x1(%r15),%r14
xor    %edi,%edi
mov    %r14d,%esi
call   1050 <consumer_raw@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %ebp,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  0xdd4(%rip),%xmm1
ucomiss %xmm1,%xmm2
jbe    124e <noStoreCompute+0x11e>
lea    0xdcc(%rip),%rdi
xor    %esi,%esi
mov    %r14d,%edx
movss  %xmm0,0xc(%rsp)
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mov    0x30(%rsp),%rax
movss  %xmm0,-0x4(%rax,%r15,4)
mov    $0x1,%edi
mov    %r14d,%esi
call   1050 <consumer_raw@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
ucomiss 0xd84(%rip),%xmm2
jbe    129e <noStoreCompute+0x16e>
lea    0xd7f(%rip),%rdi
mov    $0x1,%esi
mov    %r14d,%edx
movss  %xmm0,0xc(%rsp)
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mov    0x28(%rsp),%rax
movss  %xmm0,-0x4(%rax,%r15,4)
mov    $0x2,%edi
mov    %r14d,%esi
call   1050 <consumer_raw@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %r13d,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
ucomiss 0xd33(%rip),%xmm2
jbe    12ef <noStoreCompute+0x1bf>
lea    0xd2e(%rip),%rdi
mov    $0x2,%esi
mov    %r14d,%edx
movss  %xmm0,0xc(%rsp)
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
mov    0x20(%rsp),%rax
movss  %xmm0,-0x4(%rax,%r15,4)
mov    $0x3,%edi
mov    %r14d,%esi
call   1050 <consumer_raw@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %r12d,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
ucomiss 0xce2(%rip),%xmm2
jbe    11e0 <noStoreCompute+0xb0>
lea    0xcd9(%rip),%rdi
mov    $0x3,%esi
mov    %r14d,%edx
movss  %xmm0,0xc(%rsp)
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
jmp    11e0 <noStoreCompute+0xb0>
mov    0x10(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"HELP HELP I NEED AN ADULT! got producer(%d, %d) = %f\0A\00"
define float** @noStoreCompute() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float**
%11 = alloca float
%12 = alloca i32
store i32 40, i32* %12
%13 = call i8* @calloc(i32 4, i32 8)
%14 = bitcast i8* %13 to float**
store float** %14, float*** %10
store i32 0, i32* %3
br label %15
15: ; preds = %25, %0
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = call i8* @calloc(i32 40, i32 4)
%20 = bitcast i8* %19 to float*
%21 = load float**, float*** %10
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float*, float** %21, i64 %23
store float* %20, float** %24
br label %25
25: ; preds = %18
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %15
28: ; preds = %15
store i32 0, i32* %5
br label %29
29: ; preds = %100, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %12
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %103
33: ; preds = %29
%34 = load i32, i32* %5
%35 = mul nsw i32 1, %34
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = icmp sgt i32 %36, 39
br i1 %37, label %38, label %39
38: ; preds = %33
store i32 39, i32* %6
br label %39
39: ; preds = %38, %33
store i32 0, i32* %1
br label %40
40: ; preds = %96, %39
%41 = load i32, i32* %1
%42 = icmp slt i32 %41, 4
br i1 %42, label %43, label %99
43: ; preds = %40
store i32 0, i32* %7
br label %44
44: ; preds = %92, %43
%45 = load i32, i32* %7
%46 = icmp slt i32 %45, 1
br i1 %46, label %47, label %95
47: ; preds = %44
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = add nsw i32 %48, %49
store i32 %50, i32* %2
%51 = load i32, i32* %1
%52 = load i32, i32* %2
%53 = call float @consumer_raw(i32 %51, i32 %52)
store float %53, float* %11
%54 = load float, float* %11
%55 = load i32, i32* %1
%56 = load i32, i32* %2
%57 = mul nsw i32 %55, %56
%58 = load i32, i32* %1
%59 = add nsw i32 %58, 1
%60 = load i32, i32* %2
%61 = add nsw i32 %60, 1
%62 = mul nsw i32 %59, %61
%63 = add nsw i32 %57, %62
%64 = load i32, i32* %1
%65 = load i32, i32* %2
%66 = add nsw i32 %65, 1
%67 = mul nsw i32 %64, %66
%68 = add nsw i32 %63, %67
%69 = load i32, i32* %2
%70 = load i32, i32* %1
%71 = add nsw i32 %70, 1
%72 = mul nsw i32 %69, %71
%73 = add nsw i32 %68, %72
%74 = sitofp i32 %73 to float
%75 = fsub float %54, %74
%76 = fcmp ogt float %75, 0x3F50624DE0000000
br i1 %76, label %77, label %82
77: ; preds = %47
%78 = load i32, i32* %1
%79 = load i32, i32* %2
%80 = load float, float* %11
%81 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %78, i32 %79, float %80)
br label %82
82: ; preds = %77, %47
%83 = load float, float* %11
%84 = load float**, float*** %10
%85 = load i32, i32* %1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds float*, float** %84, i64 %86
%88 = load float*, float** %87
%89 = load i32, i32* %2
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds float, float* %88, i64 %90
store float %83, float* %91
br label %92
92: ; preds = %82
%93 = load i32, i32* %7
%94 = add nsw i32 %93, 1
store i32 %94, i32* %7
br label %44
95: ; preds = %44
br label %96
96: ; preds = %95
%97 = load i32, i32* %1
%98 = add nsw i32 %97, 1
store i32 %98, i32* %1
br label %40
99: ; preds = %40
br label %100
100: ; preds = %99
%101 = load i32, i32* %5
%102 = add nsw i32 %101, 1
store i32 %102, i32* %5
br label %29
103: ; preds = %29
%104 = load float**, float*** %10
ret float** %104
}

LLVM IR (-O2):
@.str = [54 x i8] c"HELP HELP I NEED AN ADULT! got producer(%d, %d) = %f\0A\00"
define noalias float** @noStoreCompute() {
%1 = tail call dereferenceable_or_null(32) i8* @calloc(i32 4, i32 8)
%2 = bitcast i8* %1 to float**
%3 = tail call dereferenceable_or_null(160) i8* @calloc(i32 40, i32 4)
%4 = bitcast i8* %1 to i8**
store i8* %3, i8** %4
%5 = tail call dereferenceable_or_null(160) i8* @calloc(i32 40, i32 4)
%6 = getelementptr inbounds float*, float** %2, i64 1
%7 = bitcast float** %6 to i8**
store i8* %5, i8** %7
%8 = tail call dereferenceable_or_null(160) i8* @calloc(i32 40, i32 4)
%9 = getelementptr inbounds float*, float** %2, i64 2
%10 = bitcast float** %9 to i8**
store i8* %8, i8** %10
%11 = tail call dereferenceable_or_null(160) i8* @calloc(i32 40, i32 4)
%12 = getelementptr inbounds float*, float** %2, i64 3
%13 = bitcast float** %12 to i8**
store i8* %11, i8** %13
%14 = bitcast i8* %3 to float*
%15 = bitcast i8* %5 to float*
%16 = bitcast i8* %8 to float*
%17 = bitcast i8* %11 to float*
br label %18
18: ; preds = %0, %60
%19 = phi i64 [ 0, %0 ], [ %20, %60 ]
%20 = add nuw nsw i64 %19, 1
%21 = add nuw nsw i64 %20, %19
%22 = trunc i64 %19 to i32
%23 = tail call float @consumer_raw(i32 0, i32 %22)
%24 = trunc i64 %21 to i32
%25 = sitofp i32 %24 to float
%26 = fsub float %23, %25
%27 = fcmp ogt float %26, 0x3F50624DE0000000
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 0, i32 %22, float %23)
br label %30
30: ; preds = %28, %18
%31 = getelementptr inbounds float, float* %14, i64 %19
store float %23, float* %31
%32 = tail call float @consumer_raw(i32 1, i32 %22)
%33 = trunc i64 %21 to i32
%34 = mul i32 %33, 3
%35 = sitofp i32 %34 to float
%36 = fsub float %32, %35
%37 = fcmp ogt float %36, 0x3F50624DE0000000
br i1 %37, label %38, label %40
38: ; preds = %30
%39 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 1, i32 %22, float %32)
br label %40
40: ; preds = %38, %30
%41 = getelementptr inbounds float, float* %15, i64 %19
store float %32, float* %41
%42 = tail call float @consumer_raw(i32 2, i32 %22)
%43 = trunc i64 %21 to i32
%44 = mul i32 %43, 5
%45 = sitofp i32 %44 to float
%46 = fsub float %42, %45
%47 = fcmp ogt float %46, 0x3F50624DE0000000
br i1 %47, label %48, label %50
48: ; preds = %40
%49 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 2, i32 %22, float %42)
br label %50
50: ; preds = %48, %40
%51 = getelementptr inbounds float, float* %16, i64 %19
store float %42, float* %51
%52 = tail call float @consumer_raw(i32 3, i32 %22)
%53 = trunc i64 %21 to i32
%54 = mul i32 %53, 7
%55 = sitofp i32 %54 to float
%56 = fsub float %52, %55
%57 = fcmp ogt float %56, 0x3F50624DE0000000
br i1 %57, label %58, label %60
58: ; preds = %50
%59 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 3, i32 %22, float %52)
br label %60
60: ; preds = %58, %50
%61 = getelementptr inbounds float, float* %17, i64 %19
store float %52, float* %61
%62 = icmp eq i64 %20, 40
br i1 %62, label %63, label %18
63: ; preds = %60
ret float** %2
}