void printTransform(int r, int c, double M[r][c]) {
  printf("\n[");
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      char *pre = signbit(M[i][j]) ? "" : " ";
      char *post1 = "";
      char *post2 = (j == (c - 1)) ? (i == (r - 1)) ? "" : ";" : " ";
      printf("%s%.8lf%s%s", pre, M[i][j], post1, post2);
    }
    printf("%s", (i == (r - 1)) ? "]\n" : "\n ");
  }
}


x86 assembly (clang, -O0):
<printTransform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x38(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    128a <printTransform+0x16a>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1251 <printTransform+0x131>
mov    -0x38(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1,%al
call   1040 <signbit@plt>
mov    %eax,%edx
lea    0xe78(%rip),%rax
lea    0xe6f(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    0xe5d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11f1 <printTransform+0xd1>
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
lea    0xe28(%rip),%rax
lea    0xe31(%rip),%rcx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    1201 <printTransform+0xe1>
lea    0xe1d(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    1201 <printTransform+0xe1>
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xdc9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <printTransform+0x41>
mov    -0x14(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xdb3(%rip),%rsi
lea    0xda9(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rsi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <printTransform+0x2e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTransform>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%rbx
mov    %rsi,0x8(%rsp)
mov    %edi,%r15d
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r15d,%r15d
jle    1245 <printTransform+0x125>
mov    0x8(%rsp),%rax
mov    %eax,%ecx
add    $0xffffffff,%eax
mov    %rax,0x30(%rsp)
lea    -0x1(%r15),%eax
mov    %rax,0x10(%rsp)
mov    %r15d,%eax
mov    %rax,0x20(%rsp)
mov    %rcx,0x28(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,(%rsp)
mov    0x28(%rsp),%r15
jmp    11d0 <printTransform+0xb0>
nop
mov    (%rsp),%rbp
cmp    0x10(%rsp),%rbp
lea    0xe74(%rip),%rsi
lea    0xe6a(%rip),%rax
cmove  %rax,%rsi
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
add    0x18(%rsp),%rbx
mov    %rbp,%rax
mov    %rbp,(%rsp)
cmp    0x20(%rsp),%rbp
je     1245 <printTransform+0x125>
cmpl   $0x0,0x8(%rsp)
lea    0xe37(%rip),%r14
lea    0xe32(%rip),%r13
jle    1190 <printTransform+0x70>
mov    (%rsp),%rax
cmp    0x10(%rsp),%rax
lea    0xe0e(%rip),%r12
cmove  %r14,%r12
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,8),%xmm0
mov    $0x1,%al
call   1040 <signbit@plt>
test   %eax,%eax
mov    %r14,%rsi
cmove  %r13,%rsi
cmp    %rbp,0x30(%rsp)
mov    %r13,%rcx
cmove  %r12,%rcx
movsd  (%rbx,%rbp,8),%xmm0
lea    0xdd8(%rip),%rdi
mov    %r14,%rdx
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1200 <printTransform+0xe0>
jmp    1190 <printTransform+0x70>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A[\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c";\00"
@.str.4 = [12 x i8] c"%s%.8lf%s%s\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [3 x i8] c"]\0A\00"
@.str.7 = [3 x i8] c"\0A \00"
define void @printTransform(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %17
17: ; preds = %78, %3
%18 = load i32, i32* %7
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %81
21: ; preds = %17
store i32 0, i32* %8
br label %22
22: ; preds = %67, %21
%23 = load i32, i32* %8
%24 = load i32, i32* %5
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %70
26: ; preds = %22
%27 = load double*, double** %6
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = mul nsw i64 %29, %15
%31 = getelementptr inbounds double, double* %27, i64 %30
%32 = load i32, i32* %8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = call i32 (double, ...) bitcast (i32 (...)* @signbit to i32 (double, ...)*)(double %35)
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i64
%39 = select i1 %37, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
store i8* %39, i8** %9
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %10
%40 = load i32, i32* %8
%41 = load i32, i32* %5
%42 = sub nsw i32 %41, 1
%43 = icmp eq i32 %40, %42
br i1 %43, label %44, label %51
44: ; preds = %26
%45 = load i32, i32* %7
%46 = load i32, i32* %4
%47 = sub nsw i32 %46, 1
%48 = icmp eq i32 %45, %47
%49 = zext i1 %48 to i64
%50 = select i1 %48, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
br label %52
51: ; preds = %26
br label %52
52: ; preds = %51, %44
%53 = phi i8* [ %50, %44 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %51 ]
store i8* %53, i8** %11
%54 = load i8*, i8** %9
%55 = load double*, double** %6
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = mul nsw i64 %57, %15
%59 = getelementptr inbounds double, double* %55, i64 %58
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = load i8*, i8** %10
%65 = load i8*, i8** %11
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %54, double %63, i8* %64, i8* %65)
br label %67
67: ; preds = %52
%68 = load i32, i32* %8
%69 = add nsw i32 %68, 1
store i32 %69, i32* %8
br label %22
70: ; preds = %22
%71 = load i32, i32* %7
%72 = load i32, i32* %4
%73 = sub nsw i32 %72, 1
%74 = icmp eq i32 %71, %73
%75 = zext i1 %74 to i64
%76 = select i1 %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %70
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %17
81: ; preds = %17
ret void
}

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