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


x86 assembly (clang, -O0):
<times_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     1222 <times_table+0x112>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     120a <times_table+0xfa>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1162 <times_table+0x52>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
cmpl   $0xa,-0xc(%rbp)
jl     119f <times_table+0x8f>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    11f7 <times_table+0xe7>
cmpl   $0xa,-0xc(%rbp)
jge    11da <times_table+0xca>
cmpl   $0x0,-0x8(%rbp)
je     11da <times_table+0xca>
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    11f2 <times_table+0xe2>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
jmp    11f7 <times_table+0xe7>
jmp    11fc <times_table+0xec>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <times_table+0x20>
mov    $0xa,%edi
call   1030 <_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <times_table+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<times_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
mov    $0xcccccccd,%r14d
jmp    1148 <times_table+0x38>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x1,%r15d
cmp    $0xa,%r15d
je     11f0 <times_table+0xe0>
mov    $0x30,%edi
call   1030 <_putchar@plt>
mov    $0x1,%r13d
mov    $0x9,%r12d
mov    %r15d,%ebx
jmp    11a9 <times_table+0x99>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
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>
or     $0x30,%bpl
movsbl %bpl,%edi
call   1030 <_putchar@plt>
add    $0x1,%r13d
add    %r15d,%ebx
add    $0xffffffff,%r12d
je     1130 <times_table+0x20>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
mov    $0x20,%edi
call   1030 <_putchar@plt>
cmp    $0xa,%ebx
jb     1170 <times_table+0x60>
mov    %r13d,%ebp
imul   %r15d,%ebp
mov    %ebx,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    $0x30,%al
movsbl %al,%edi
call   1030 <_putchar@plt>
mov    %ebp,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
jmp    118f <times_table+0x7f>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @times_table() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %60, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %63
7: ; preds = %4
store i32 0, i32* %2
br label %8
8: ; preds = %55, %7
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %58
11: ; preds = %8
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = call i32 @_putchar(i8 signext 44)
%19 = call i32 @_putchar(i8 signext 32)
br label %20
20: ; preds = %17, %11
%21 = load i32, i32* %3
%22 = icmp sge i32 %21, 10
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 10
%26 = add nsw i32 %25, 48
%27 = trunc i32 %26 to i8
%28 = call i32 @_putchar(i8 signext %27)
%29 = load i32, i32* %3
%30 = srem i32 %29, 10
%31 = add nsw i32 %30, 48
%32 = trunc i32 %31 to i8
%33 = call i32 @_putchar(i8 signext %32)
br label %54
34: ; preds = %20
%35 = load i32, i32* %3
%36 = icmp slt i32 %35, 10
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = call i32 @_putchar(i8 signext 32)
%42 = load i32, i32* %3
%43 = srem i32 %42, 10
%44 = add nsw i32 %43, 48
%45 = trunc i32 %44 to i8
%46 = call i32 @_putchar(i8 signext %45)
br label %53
47: ; preds = %37, %34
%48 = load i32, i32* %3
%49 = srem i32 %48, 10
%50 = add nsw i32 %49, 48
%51 = trunc i32 %50 to i8
%52 = call i32 @_putchar(i8 signext %51)
br label %53
53: ; preds = %47, %40
br label %54
54: ; preds = %53, %23
br label %55
55: ; preds = %54
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %8
58: ; preds = %8
%59 = call i32 @_putchar(i8 signext 10)
br label %60
60: ; preds = %58
%61 = load i32, i32* %1
%62 = add nsw i32 %61, 1
store i32 %62, i32* %1
br label %4
63: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @times_table() {
br label %1
1: ; preds = %27, %0
%2 = phi i32 [ 0, %0 ], [ %29, %27 ]
%3 = tail call i32 @_putchar(i8 signext 48)
br label %4
4: ; preds = %21, %1
%5 = phi i32 [ 1, %1 ], [ %25, %21 ]
%6 = mul nuw nsw i32 %5, %2
%7 = tail call i32 @_putchar(i8 signext 44)
%8 = tail call i32 @_putchar(i8 signext 32)
%9 = icmp ugt i32 %6, 9
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = udiv i32 %6, 10
%12 = trunc i32 %11 to i8
%13 = add i8 %12, 48
%14 = tail call i32 @_putchar(i8 signext %13)
%15 = urem i32 %6, 10
%16 = trunc i32 %15 to i8
br label %21
17: ; preds = %4
%18 = tail call i32 @_putchar(i8 signext 32)
%19 = trunc i32 %6 to i8
%20 = urem i8 %19, 10
br label %21
21: ; preds = %10, %17
%22 = phi i8 [ %16, %10 ], [ %20, %17 ]
%23 = or i8 %22, 48
%24 = tail call i32 @_putchar(i8 signext %23)
%25 = add nuw nsw i32 %5, 1
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %4
27: ; preds = %21
%28 = tail call i32 @_putchar(i8 signext 10)
%29 = add nuw nsw i32 %2, 1
%30 = icmp eq i32 %29, 10
br i1 %30, label %31, label %1
31: ; preds = %27
ret void
}