void print_mat(m, rsize1, rsize2, csize1, csize2) float **m;
int rsize1, rsize2, csize1, csize2;
{
  int i, j;
  putchar('{');
  for (i = rsize1; i <= rsize2; i++) {
    putchar('{');
    for (j = csize1; j < csize2; j++) {
      printf("%f,  ", m[i][j]);
    }
    printf("%f}\n", m[i][csize2]);
  }
  putchar('}');
}


x86 assembly (clang, -O0):
<print_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x7b,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11df <print_mat+0xbf>
mov    $0x7b,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11aa <print_mat+0x8a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1169 <print_mat+0x49>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <print_mat+0x2b>
mov    $0x7d,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    $0x7b,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    %ebx,(%rsp)
cmp    %ebx,%r14d
jle    116d <print_mat+0x4d>
mov    $0x7d,%edi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
movslq 0x8(%rsp),%rax
movslq 0x4(%rsp),%rcx
movslq %r14d,%r14
addl   $0x1,(%rsp)
mov    %rax,%r13
mov    %rcx,0x10(%rsp)
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
lea    0xe6d(%rip),%rbx
jmp    11c7 <print_mat+0xa7>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp,%r14,8),%rax
movss  (%rax,%r13,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe50(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14d,(%rsp)
je     1153 <print_mat+0x33>
mov    $0x7b,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
jge    11a0 <print_mat+0x80>
mov    0xc(%rsp),%r15d
mov    0x10(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rax
movss  (%rax,%r12,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r12
add    $0xffffffff,%r15d
jne    11f0 <print_mat+0xd0>
jmp    11a0 <print_mat+0x80>

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

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