#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, n;
  for (i = 0; i < 10; _putchar('\n'), i++) {
    _putchar('0');
    _putchar(',');
    for (j = 1; j < 10; j++) {
      n = i * j;
      _putchar(' ');
      _putchar(n / 10 ? n / 10 + '0' : ' ');
      _putchar(n % 10 + '0');
      if (j < 9)
        _putchar(',');
    }
  }
}


x86 assembly (clang, -O0):
<times_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1200 <times_table+0xf0>
mov    $0x30,%edi
call   1030 <_putchar@plt>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11e3 <times_table+0xd3>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x20,%edi
call   1030 <_putchar@plt>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     118c <times_table+0x7c>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
jmp    1199 <times_table+0x89>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1199 <times_table+0x89>
mov    -0x10(%rbp),%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>
cmpl   $0x9,-0x8(%rbp)
jge    11d0 <times_table+0xc0>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
jmp    11d5 <times_table+0xc5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <times_table+0x34>
jmp    11e8 <times_table+0xd8>
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
jmp    1138 <times_table+0x28>
mov    $0xa,%edi
call   1030 <_putchar@plt>
add    $0x1,%r15d
cmp    $0xa,%r15d
je     11d9 <times_table+0xc9>
mov    $0x30,%edi
call   1030 <_putchar@plt>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
mov    $0x1,%r12d
mov    %r15d,%r13d
jmp    116d <times_table+0x5d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12d
add    %r15d,%r13d
cmp    $0xa,%r12d
je     1120 <times_table+0x10>
mov    %r13d,%ebp
mov    %rbp,%rax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %r13d,%ebx
sub    %al,%bl
mov    $0x20,%r14d
mov    $0x20,%edi
call   1030 <_putchar@plt>
cmp    $0xa,%r13d
jb     11b3 <times_table+0xa3>
mov    $0xcccccccd,%eax
imul   %rax,%rbp
shr    $0x23,%rbp
add    $0x30,%ebp
mov    %ebp,%r14d
movsbl %r14b,%edi
call   1030 <_putchar@plt>
or     $0x30,%bl
movsbl %bl,%edi
call   1030 <_putchar@plt>
cmp    $0x8,%r12d
ja     1160 <times_table+0x50>
mov    $0x2c,%edi
call   1030 <_putchar@plt>
jmp    1160 <times_table+0x50>
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 = %44, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %48
7: ; preds = %4
%8 = call i32 @_putchar(i8 signext 48)
%9 = call i32 @_putchar(i8 signext 44)
store i32 1, i32* %2
br label %10
10: ; preds = %40, %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %43
13: ; preds = %10
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %3
%17 = call i32 @_putchar(i8 signext 32)
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 10
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %13
%22 = load i32, i32* %3
%23 = sdiv i32 %22, 10
%24 = add nsw i32 %23, 48
br label %26
25: ; preds = %13
br label %26
26: ; preds = %25, %21
%27 = phi i32 [ %24, %21 ], [ 32, %25 ]
%28 = trunc i32 %27 to i8
%29 = call i32 @_putchar(i8 signext %28)
%30 = load i32, i32* %3
%31 = srem i32 %30, 10
%32 = add nsw i32 %31, 48
%33 = trunc i32 %32 to i8
%34 = call i32 @_putchar(i8 signext %33)
%35 = load i32, i32* %2
%36 = icmp slt i32 %35, 9
br i1 %36, label %37, label %39
37: ; preds = %26
%38 = call i32 @_putchar(i8 signext 44)
br label %39
39: ; preds = %37, %26
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %10
43: ; preds = %10
br label %44
44: ; preds = %43
%45 = call i32 @_putchar(i8 signext 10)
%46 = load i32, i32* %1
%47 = add nsw i32 %46, 1
store i32 %47, i32* %1
br label %4
48: ; preds = %4
ret void
}

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