#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*/ getchar();
int /*<<< orphan*/ teste1(float *, int, int);
int main() {
  float t1[4][2];
  for (int i = 0; i < 4 * 2; i++)
    t1[i % 4][i / 4] = i + 1;
  teste1((float *)t1, 4, 2);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    118e <main+0x6e>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    -0x30(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <main+0x16>
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1040 <teste1@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1040 <teste1@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [2 x float]]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %3
%12 = srem i32 %11, 4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %2, i64 0, i64 %13
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [2 x float], [2 x float]* %14, i64 0, i64 %17
store float %10, float* %18
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
%23 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %2, i64 0, i64 0
%24 = bitcast [2 x float]* %23 to float*
%25 = call i32 @teste1(float* %24, i32 4, i32 2)
%26 = call i32 (...) @getchar()
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [2 x float]]
%2 = bitcast [4 x [2 x float]]* %1 to i8*
%3 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [4 x [2 x float]], [4 x [2 x float]]* %1, i64 0, i64 2, i64 0
%5 = bitcast [4 x [2 x float]]* %1 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 5.000000e+00, float 2.000000e+00, float 6.000000e+00>, <4 x float>* %5
%6 = bitcast float* %4 to <4 x float>*
store <4 x float> <float 3.000000e+00, float 7.000000e+00, float 4.000000e+00, float 8.000000e+00>, <4 x float>* %6
%7 = call i32 @teste1(float* %3, i32 4, i32 2)
%8 = call i32 (...) @getchar()
ret i32 0
}