#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 print_data_float(float *dat, int N, int M) {
  int i, j;
  for (i = 0; i < N; i++) {
    for (j = 0; j < M - 1; j++) {
      printf("%G ", dat[i * M + j]);
    }
    printf("%G", dat[i * M + (M - 1)]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_data_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cc <print_data_float+0xbc>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1183 <print_data_float+0x73>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <print_data_float+0x2c>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_data_float+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_data_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,(%rsp)
test   %esi,%esi
jle    11ef <print_data_float+0xcf>
mov    %edx,%ebx
movslq %edx,%rax
add    $0xffffffff,%ebx
movslq %ebx,%rcx
mov    %rcx,0x18(%rsp)
mov    %esi,%ecx
mov    %rcx,0x10(%rsp)
mov    %rax,0x20(%rsp)
lea    0x0(,%rax,4),%rax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
lea    0xe93(%rip),%r15
mov    (%rsp),%r12
jmp    11ba <print_data_float+0x9a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    0x18(%rsp),%rbp
mov    (%rsp),%rax
movss  (%rax,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    0x8(%rsp),%r12
cmp    0x10(%rsp),%r14
je     11ef <print_data_float+0xcf>
mov    %r14,%rbp
mov    0x20(%rsp),%rax
imul   %rax,%rbp
cmp    $0x2,%eax
jl     1180 <print_data_float+0x60>
xor    %r13d,%r13d
xchg   %ax,%ax
movss  (%r12,%r13,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r13
cmp    %r13,%rbx
jne    11d0 <print_data_float+0xb0>
jmp    1180 <print_data_float+0x60>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%G \00"
@.str.1 = [3 x i8] c"%G\00"
define void @print_data_float(float* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %33
5: ; preds = %3
%6 = add i32 %2, -1
%7 = icmp sgt i32 %2, 1
%8 = sext i32 %2 to i64
%9 = sext i32 %6 to i64
%10 = zext i32 %1 to i64
%11 = zext i32 %6 to i64
br label %12
12: ; preds = %5, %24
%13 = phi i64 [ 0, %5 ], [ %31, %24 ]
%14 = mul nsw i64 %13, %8
br i1 %7, label %15, label %24
15: ; preds = %12, %15
%16 = phi i64 [ %22, %15 ], [ 0, %12 ]
%17 = add nsw i64 %16, %14
%18 = getelementptr inbounds float, float* %0, i64 %17
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %20)
%22 = add nuw nsw i64 %16, 1
%23 = icmp eq i64 %22, %11
br i1 %23, label %24, label %15
24: ; preds = %15, %12
%25 = add nsw i64 %14, %9
%26 = getelementptr inbounds float, float* %0, i64 %25
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %28)
%30 = tail call i32 @putchar(i32 10)
%31 = add nuw nsw i64 %13, 1
%32 = icmp eq i64 %31, %10
br i1 %32, label %33, label %12
33: ; preds = %24, %3
ret void
}