#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*/ foo(float **);
int bar() {
  int i, j;
  float A[100][200];
  for (i = 0; i < 5; i++)
    for (j = 0; j < 5; j++)
      A[i][j] = A[i + 1][j];
  foo(A);
  return A[1][2];
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13890,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    119f <bar+0x8f>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    118c <bar+0x7c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0x4(%rbp),%rcx
lea    -0x13890(%rbp),%rax
imul   $0x320,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <bar+0x23>
jmp    1191 <bar+0x81>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <bar+0x12>
lea    -0x13890(%rbp),%rdi
call   1030 <foo@plt>
cvttss2si -0x13568(%rbp),%eax
ff
add    $0x13890,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x13888,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
cvttss2si 0x328(%rsp),%eax
add    $0x13888,%rsp
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x [200 x float]]
store i32 0, i32* %1
br label %4
4: ; preds = %30, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %33
7: ; preds = %4
store i32 0, i32* %2
br label %8
8: ; preds = %26, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x [200 x float]], [100 x [200 x float]]* %3, i64 0, i64 %14
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x float], [200 x float]* %15, i64 0, i64 %17
%19 = load float, float* %18
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x [200 x float]], [100 x [200 x float]]* %3, i64 0, i64 %21
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [200 x float], [200 x float]* %22, i64 0, i64 %24
store float %19, float* %25
br label %26
26: ; preds = %11
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %8
29: ; preds = %8
br label %30
30: ; preds = %29
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %4
33: ; preds = %4
%34 = getelementptr inbounds [100 x [200 x float]], [100 x [200 x float]]* %3, i64 0, i64 0
%35 = bitcast [200 x float]* %34 to float**
%36 = call i32 @foo(float** %35)
%37 = getelementptr inbounds [100 x [200 x float]], [100 x [200 x float]]* %3, i64 0, i64 1
%38 = getelementptr inbounds [200 x float], [200 x float]* %37, i64 0, i64 2
%39 = load float, float* %38
%40 = fptosi float %39 to i32
ret i32 %40
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca [100 x [200 x float]]
%2 = bitcast [100 x [200 x float]]* %1 to i8*
%3 = getelementptr inbounds [100 x [200 x float]], [100 x [200 x float]]* %1, i64 0, i64 1, i64 2
%4 = bitcast [100 x [200 x float]]* %1 to float**
%5 = call i32 @foo(float** %4)
%6 = load float, float* %3
%7 = fptosi float %6 to i32
ret i32 %7
}