#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*/ _putchar(char);
void print_times_table(int n) {
  int i, j, total;
  if (!(n > 15 || n < 0)) {
    for (i = 0; i <= n; i++) {
      for (j = 0; j <= n; j++) {
        total = (i * j);
        if (j != 0) {
          _putchar(',');
          _putchar(' ');
        }
        if (total < 10 && j != 0) {
          _putchar(' ');
          _putchar(' ');
          _putchar((total % 10) + '0');
        } else if (total >= 10 && total < 100) {
          _putchar(' ');
          _putchar((total / 10) + '0');
          _putchar((total % 10) + '0');
        } else if (total >= 100 && j != 0) {
          _putchar((total / 100) + '0');
          _putchar((total / 10) % 10 + '0');
          _putchar((total % 10) + '0');
        } else
          _putchar((total % 10) + '0');
      }
      _putchar('\n');
    }
  }
}


x86 assembly (clang, -O0):
<print_times_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jg     12cc <print_times_table+0x1bc>
cmpl   $0x0,-0x4(%rbp)
jl     12cc <print_times_table+0x1bc>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     12c7 <print_times_table+0x1b7>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     12af <print_times_table+0x19f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117d <print_times_table+0x6d>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
cmpl   $0xa,-0x10(%rbp)
jge    11c2 <print_times_table+0xb2>
cmpl   $0x0,-0xc(%rbp)
je     11c2 <print_times_table+0xb2>
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    129c <print_times_table+0x18c>
cmpl   $0xa,-0x10(%rbp)
jl     1213 <print_times_table+0x103>
cmpl   $0x64,-0x10(%rbp)
jge    1213 <print_times_table+0x103>
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    1297 <print_times_table+0x187>
cmpl   $0x64,-0x10(%rbp)
jl     127a <print_times_table+0x16a>
cmpl   $0x0,-0xc(%rbp)
je     127a <print_times_table+0x16a>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    1292 <print_times_table+0x182>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    1297 <print_times_table+0x187>
jmp    129c <print_times_table+0x18c>
jmp    12a1 <print_times_table+0x191>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <print_times_table+0x39>
mov    $0xa,%edi
call   1030 <_putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <print_times_table+0x26>
jmp    12cc <print_times_table+0x1bc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_times_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0xf,%edi
jbe    112f <print_times_table+0x1f>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edi,%ebx
xor    %r12d,%r12d
mov    %edi,0x4(%rsp)
jmp    115b <print_times_table+0x4b>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <_putchar@plt>
lea    0x1(%r12),%eax
mov    0x4(%rsp),%ebx
cmp    %ebx,%r12d
mov    %eax,%r12d
je     1120 <print_times_table+0x10>
mov    $0x30,%edi
call   1030 <_putchar@plt>
test   %ebx,%ebx
je     1140 <print_times_table+0x30>
mov    $0x1,%r14d
mov    %r12d,%ebx
mov    0x4(%rsp),%r13d
jmp    11c8 <print_times_table+0xb8>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
movzbl %bpl,%ebp
imul   $0xcd,%ebp,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
or     $0x30,%bpl
movsbl %bpl,%edi
call   1030 <_putchar@plt>
add    $0x1,%r14d
add    %r12d,%ebx
add    $0xffffffff,%r13d
je     1140 <print_times_table+0x30>
mov    %r14d,%ebp
imul   %r12d,%ebp
mov    $0x2c,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
cmp    $0x9,%ebx
jbe    1180 <print_times_table+0x70>
lea    -0xa(%rbx),%eax
cmp    $0x59,%eax
ja     1230 <print_times_table+0x120>
movzbl %bl,%ebp
imul   $0xcd,%ebp,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
mov    $0x20,%edi
call   1030 <_putchar@plt>
movzbl %bl,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
add    $0x30,%al
movzbl %al,%edi
call   1030 <_putchar@plt>
jmp    11aa <print_times_table+0x9a>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%r15d
imul   $0x51eb851f,%r15,%rax
shr    $0x25,%rax
add    $0x30,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    $0xcccccccd,%ecx
imul   %rcx,%r15
shr    $0x23,%r15
mov    %r15,%rax
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r15d
or     $0x30,%r15b
movzbl %r15b,%edi
call   1030 <_putchar@plt>
mov    %ebp,%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
jmp    11aa <print_times_table+0x9a>

LLVM IR (-O0):
define void @print_times_table(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 15
br i1 %7, label %103, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %103, label %11
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %99, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %102
16: ; preds = %12
store i32 0, i32* %4
br label %17
17: ; preds = %94, %16
%18 = load i32, i32* %4
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %97
21: ; preds = %17
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %5
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = call i32 @_putchar(i8 signext 44)
%29 = call i32 @_putchar(i8 signext 32)
br label %30
30: ; preds = %27, %21
%31 = load i32, i32* %5
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = load i32, i32* %4
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %44
36: ; preds = %33
%37 = call i32 @_putchar(i8 signext 32)
%38 = call i32 @_putchar(i8 signext 32)
%39 = load i32, i32* %5
%40 = srem i32 %39, 10
%41 = add nsw i32 %40, 48
%42 = trunc i32 %41 to i8
%43 = call i32 @_putchar(i8 signext %42)
br label %93
44: ; preds = %33, %30
%45 = load i32, i32* %5
%46 = icmp sge i32 %45, 10
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = load i32, i32* %5
%49 = icmp slt i32 %48, 100
br i1 %49, label %50, label %62
50: ; preds = %47
%51 = call i32 @_putchar(i8 signext 32)
%52 = load i32, i32* %5
%53 = sdiv i32 %52, 10
%54 = add nsw i32 %53, 48
%55 = trunc i32 %54 to i8
%56 = call i32 @_putchar(i8 signext %55)
%57 = load i32, i32* %5
%58 = srem i32 %57, 10
%59 = add nsw i32 %58, 48
%60 = trunc i32 %59 to i8
%61 = call i32 @_putchar(i8 signext %60)
br label %92
62: ; preds = %47, %44
%63 = load i32, i32* %5
%64 = icmp sge i32 %63, 100
br i1 %64, label %65, label %85
65: ; preds = %62
%66 = load i32, i32* %4
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %85
68: ; preds = %65
%69 = load i32, i32* %5
%70 = sdiv i32 %69, 100
%71 = add nsw i32 %70, 48
%72 = trunc i32 %71 to i8
%73 = call i32 @_putchar(i8 signext %72)
%74 = load i32, i32* %5
%75 = sdiv i32 %74, 10
%76 = srem i32 %75, 10
%77 = add nsw i32 %76, 48
%78 = trunc i32 %77 to i8
%79 = call i32 @_putchar(i8 signext %78)
%80 = load i32, i32* %5
%81 = srem i32 %80, 10
%82 = add nsw i32 %81, 48
%83 = trunc i32 %82 to i8
%84 = call i32 @_putchar(i8 signext %83)
br label %91
85: ; preds = %65, %62
%86 = load i32, i32* %5
%87 = srem i32 %86, 10
%88 = add nsw i32 %87, 48
%89 = trunc i32 %88 to i8
%90 = call i32 @_putchar(i8 signext %89)
br label %91
91: ; preds = %85, %68
br label %92
92: ; preds = %91, %50
br label %93
93: ; preds = %92, %36
br label %94
94: ; preds = %93
%95 = load i32, i32* %4
%96 = add nsw i32 %95, 1
store i32 %96, i32* %4
br label %17
97: ; preds = %17
%98 = call i32 @_putchar(i8 signext 10)
br label %99
99: ; preds = %97
%100 = load i32, i32* %3
%101 = add nsw i32 %100, 1
store i32 %101, i32* %3
br label %12
102: ; preds = %12
br label %103
103: ; preds = %102, %8, %1
ret void
}

LLVM IR (-O2):
define void @print_times_table(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %51, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br label %5
5: ; preds = %3, %47
%6 = phi i32 [ %49, %47 ], [ 0, %3 ]
%7 = tail call i32 @_putchar(i8 signext 48)
br i1 %4, label %47, label %8
8: ; preds = %5, %41
%9 = phi i32 [ %45, %41 ], [ 1, %5 ]
%10 = mul nuw nsw i32 %9, %6
%11 = tail call i32 @_putchar(i8 signext 44)
%12 = tail call i32 @_putchar(i8 signext 32)
%13 = icmp ult i32 %10, 10
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = tail call i32 @_putchar(i8 signext 32)
%16 = tail call i32 @_putchar(i8 signext 32)
%17 = trunc i32 %10 to i8
%18 = urem i8 %17, 10
br label %41
19: ; preds = %8
%20 = add nsw i32 %10, -10
%21 = icmp ult i32 %20, 90
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = tail call i32 @_putchar(i8 signext 32)
%24 = trunc i32 %10 to i8
%25 = udiv i8 %24, 10
%26 = add nuw nsw i8 %25, 48
%27 = tail call i32 @_putchar(i8 signext %26)
%28 = urem i8 %24, 10
br label %41
29: ; preds = %19
%30 = udiv i32 %10, 100
%31 = trunc i32 %30 to i8
%32 = add i8 %31, 48
%33 = tail call i32 @_putchar(i8 signext %32)
%34 = udiv i32 %10, 10
%35 = urem i32 %34, 10
%36 = trunc i32 %35 to i8
%37 = or i8 %36, 48
%38 = tail call i32 @_putchar(i8 signext %37)
%39 = urem i32 %10, 10
%40 = trunc i32 %39 to i8
br label %41
41: ; preds = %14, %29, %22
%42 = phi i8 [ %18, %14 ], [ %40, %29 ], [ %28, %22 ]
%43 = or i8 %42, 48
%44 = tail call i32 @_putchar(i8 signext %43)
%45 = add nuw nsw i32 %9, 1
%46 = icmp eq i32 %9, %0
br i1 %46, label %47, label %8
47: ; preds = %41, %5
%48 = tail call i32 @_putchar(i8 signext 10)
%49 = add nuw i32 %6, 1
%50 = icmp eq i32 %6, %0
br i1 %50, label %51, label %5
51: ; preds = %47, %1
ret void
}