#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 mfdump(void *p, size_t n, size_t m) {
  size_t i, j;
  float *f;
  f = p;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++)
      printf("%.6f ", *f++);
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<mfdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11ad <mfdump+0x9d>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    118e <mfdump+0x7e>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x30(%rbp)
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114a <mfdump+0x3a>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <mfdump+0x24>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfdump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     118e <mfdump+0x6e>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r13d,%r13d
lea    0xebd(%rip),%r12
jmp    1163 <mfdump+0x43>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    %r14,%r13
je     118e <mfdump+0x6e>
test   %r15,%r15
je     1150 <mfdump+0x30>
mov    %r15,%rbp
nopl   0x0(%rax,%rax,1)
movss  (%rbx),%xmm0
add    $0x4,%rbx
cvtss2sd %xmm0,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbp
jne    1170 <mfdump+0x50>
jmp    1150 <mfdump+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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