#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*/ printf(char *, ...);
void printConsumer(float **consumer_arr) {
  int x, y;
  for (x = 0; x < 4; x++) {
    printf("|");
    for (y = 0; y < 40; y++) {
      printf("%f|", consumer_arr[x][y]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printConsumer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    119d <printConsumer+0x8d>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x28,-0x10(%rbp)
jge    1181 <printConsumer+0x71>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <printConsumer+0x32>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printConsumer+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printConsumer>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x28,%rbx
jne    1140 <printConsumer+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xe83(%rip),%r14
nopl   (%rax)
mov    0x8(%r15),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x28,%rbx
jne    1180 <printConsumer+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xe42(%rip),%r14
xchg   %ax,%ax
mov    0x10(%r15),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x28,%rbx
jne    11c0 <printConsumer+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
lea    0xe02(%rip),%r14
xchg   %ax,%ax
mov    0x18(%r15),%rax
movss  (%rax,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x28,%rbx
jne    1200 <printConsumer+0xe0>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%f|\00"
define void @printConsumer(float** nocapture %0) {
%2 = tail call i32 @putchar(i32 124)
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %10, %3 ]
%5 = load float*, float** %0
%6 = getelementptr inbounds float, float* %5, i64 %4
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 40
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @putchar(i32 124)
%15 = getelementptr inbounds float*, float** %0, i64 1
br label %16
16: ; preds = %16, %12
%17 = phi i64 [ 0, %12 ], [ %23, %16 ]
%18 = load float*, float** %15
%19 = getelementptr inbounds float, float* %18, i64 %17
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %21)
%23 = add nuw nsw i64 %17, 1
%24 = icmp eq i64 %23, 40
br i1 %24, label %25, label %16
25: ; preds = %16
%26 = tail call i32 @putchar(i32 10)
%27 = tail call i32 @putchar(i32 124)
%28 = getelementptr inbounds float*, float** %0, i64 2
br label %29
29: ; preds = %29, %25
%30 = phi i64 [ 0, %25 ], [ %36, %29 ]
%31 = load float*, float** %28
%32 = getelementptr inbounds float, float* %31, i64 %30
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %34)
%36 = add nuw nsw i64 %30, 1
%37 = icmp eq i64 %36, 40
br i1 %37, label %38, label %29
38: ; preds = %29
%39 = tail call i32 @putchar(i32 10)
%40 = tail call i32 @putchar(i32 124)
%41 = getelementptr inbounds float*, float** %0, i64 3
br label %42
42: ; preds = %42, %38
%43 = phi i64 [ 0, %38 ], [ %49, %42 ]
%44 = load float*, float** %41
%45 = getelementptr inbounds float, float* %44, i64 %43
%46 = load float, float* %45
%47 = fpext float %46 to double
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %47)
%49 = add nuw nsw i64 %43, 1
%50 = icmp eq i64 %49, 40
br i1 %50, label %51, label %42
51: ; preds = %42
%52 = tail call i32 @putchar(i32 10)
ret void
}