pmat(m, n, y) int m, n;
double y[];
{
  int i, j, k;
  k = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("%.5e ", y[k]);
      k += 1;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<pmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119d <pmat+0x8d>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <pmat+0x71>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1143 <pmat+0x33>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <pmat+0x20>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %esi,0x8(%rsp)
mov    %edi,0xc(%rsp)
test   %edi,%edi
jle    11ae <pmat+0x8e>
mov    0x8(%rsp),%ebx
xor    %r13d,%r13d
lea    0xeb3(%rip),%rbp
xor    %r14d,%r14d
jmp    1175 <pmat+0x55>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
je     11ae <pmat+0x8e>
cmpl   $0x0,0x8(%rsp)
jle    1160 <pmat+0x40>
movslq %r13d,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%r12
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%r15,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15d,%ebx
jne    1190 <pmat+0x70>
add    %r15d,%r13d
jmp    1160 <pmat+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.5e \00"
define i32 @pmat(i32 %0, i32 %1, double* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %28
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
br label %7
7: ; preds = %5, %23
%8 = phi i32 [ 0, %5 ], [ %24, %23 ]
%9 = phi i32 [ 0, %5 ], [ %26, %23 ]
br i1 %6, label %10, label %23
10: ; preds = %7
%11 = sext i32 %8 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ %11, %10 ], [ %18, %12 ]
%14 = phi i32 [ 0, %10 ], [ %19, %12 ]
%15 = getelementptr inbounds double, double* %2, i64 %13
%16 = load double, double* %15
%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 nsw i64 %13, 1
%19 = add nuw nsw i32 %14, 1
%20 = icmp eq i32 %19, %1
br i1 %20, label %21, label %12
21: ; preds = %12
%22 = trunc i64 %18 to i32
br label %23
23: ; preds = %21, %7
%24 = phi i32 [ %8, %7 ], [ %22, %21 ]
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %9, 1
%27 = icmp eq i32 %26, %0
br i1 %27, label %28, label %7
28: ; preds = %23, %3
ret i32 undef
}