void print_SeatsMap_Colored(int rows, int cols, char mat[rows][cols]) {
  int i, j;
  int char_num = int_to_charc(rows - 1);
  printf("%*s", char_num + 1, "");
  for (i = 0; i < cols; i++) {
    printf("  %d ", i);
  }
  printf("\n");
  printf("%*s", char_num + 1, "");
  for (i = 0; i < cols; i++) {
    printf(" ___");
  }
  printf("\n");
  for (i = 0; i < rows; i++) {
    printf("%*d |", char_num, i);
    for (j = 0; j < cols; j++) {
      if (mat[i][j] == 1)
        printf("\e[41m___\e[0m|");
      else
        printf("\e[42m___\e[0m|");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_SeatsMap_Colored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    $0x0,%al
call   1040 <int_to_charc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xeaa(%rip),%rdi
lea    0xeae(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1196 <print_SeatsMap_Colored+0x76>
mov    -0x14(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <print_SeatsMap_Colored+0x4b>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
lea    0xe4f(%rip),%rdi
lea    0xe53(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ee <print_SeatsMap_Colored+0xce>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c6 <print_SeatsMap_Colored+0xa6>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12aa <print_SeatsMap_Colored+0x18a>
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128e <print_SeatsMap_Colored+0x16e>
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jne    126d <print_SeatsMap_Colored+0x14d>
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127b <print_SeatsMap_Colored+0x15b>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1280 <print_SeatsMap_Colored+0x160>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    122a <print_SeatsMap_Colored+0x10a>
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1203 <print_SeatsMap_Colored+0xe3>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_SeatsMap_Colored>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%r13d
mov    %edi,%r15d
lea    -0x1(%r15),%edi
xor    %eax,%eax
call   1050 <int_to_charc@plt>
mov    %rax,0x10(%rsp)
lea    0x1(%rax),%r12d
lea    0xe9e(%rip),%rdi
lea    0xea0(%rip),%rdx
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r13d,%r13d
jle    11f1 <print_SeatsMap_Colored+0xc1>
mov    %r15,%r14
lea    0xe82(%rip),%rbp
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15d
cmp    %r15d,%r13d
jne    1190 <print_SeatsMap_Colored+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe49(%rip),%rdi
lea    0xe4b(%rip),%rdx
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r13d,%r13d
mov    %r14,%r15
jle    1213 <print_SeatsMap_Colored+0xe3>
lea    0xe33(%rip),%r14
mov    %r13d,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    11e0 <print_SeatsMap_Colored+0xb0>
jmp    1213 <print_SeatsMap_Colored+0xe3>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdfe(%rip),%rdi
lea    0xe00(%rip),%rdx
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13d,0x4(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
jle    12af <print_SeatsMap_Colored+0x17f>
mov    0x4(%rsp),%ebp
mov    %r15d,%eax
mov    %rax,0x8(%rsp)
lea    0xdd7(%rip),%r15
lea    0xdde(%rip),%r13
xor    %r12d,%r12d
jmp    1268 <print_SeatsMap_Colored+0x138>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    %rbp,%rbx
cmp    0x8(%rsp),%r12
je     12af <print_SeatsMap_Colored+0x17f>
lea    0xda0(%rip),%rdi
mov    0x10(%rsp),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1250 <print_SeatsMap_Colored+0x120>
xor    %r14d,%r14d
jmp    12a0 <print_SeatsMap_Colored+0x170>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
je     1250 <print_SeatsMap_Colored+0x120>
cmpb   $0x1,(%rbx,%r14,1)
mov    %r15,%rdi
je     1290 <print_SeatsMap_Colored+0x160>
mov    %r13,%rdi
jmp    1290 <print_SeatsMap_Colored+0x160>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%*s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c" %d \00"
@.str.4 = [5 x i8] c" ___\00"
@.str.5 = [6 x i8] c"%*d |\00"
@.str.6 = [14 x i8] c"\1B[41m___\1B[0m|\00"
@.str.7 = [14 x i8] c"\1B[42m___\1B[0m|\00"
define void @print_SeatsMap_Colored(i32 %0, i32 %1, i8* nocapture %2) {
%4 = zext i32 %1 to i64
%5 = add nsw i32 %0, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @int_to_charc to i32 (i32, ...)*)(i32 %5)
%7 = add nsw i32 %6, 1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp sgt i32 %1, 0
br i1 %9, label %10, label %23
10: ; preds = %3, %10
%11 = phi i32 [ %13, %10 ], [ 0, %3 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %10
15: ; preds = %10
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br i1 %9, label %18, label %26
18: ; preds = %15, %18
%19 = phi i32 [ %21, %18 ], [ 0, %15 ]
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%21 = add nuw nsw i32 %19, 1
%22 = icmp eq i32 %21, %1
br i1 %22, label %26, label %18
23: ; preds = %3
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %18, %23, %15
%27 = tail call i32 @putchar(i32 10)
%28 = icmp sgt i32 %0, 0
br i1 %28, label %29, label %51
29: ; preds = %26
%30 = zext i32 %0 to i64
br label %31
31: ; preds = %29, %47
%32 = phi i64 [ 0, %29 ], [ %49, %47 ]
%33 = trunc i64 %32 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %6, i32 %33)
br i1 %9, label %35, label %47
35: ; preds = %31
%36 = mul nuw nsw i64 %32, %4
%37 = getelementptr inbounds i8, i8* %2, i64 %36
br label %38
38: ; preds = %35, %38
%39 = phi i64 [ 0, %35 ], [ %45, %38 ]
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 1
%43 = select i1 %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %43)
%45 = add nuw nsw i64 %39, 1
%46 = icmp eq i64 %45, %4
br i1 %46, label %47, label %38
47: ; preds = %38, %31
%48 = tail call i32 @putchar(i32 10)
%49 = add nuw nsw i64 %32, 1
%50 = icmp eq i64 %49, %30
br i1 %50, label %51, label %31
51: ; preds = %47, %26
%52 = tail call i32 @putchar(i32 10)
ret void
}