#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*/ printf(char *, int, int, int);
void main(void) {
  int i = 1, j = 1;
  for (; i < 20; i++) {
    for (j = i; j < 20; j++) {
      if (j == 19) {
        printf("%d*%d=%i\n", i, j, i * j);
      } else {
        printf("%d*%d=%i ", i, j, i * j);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    11a7 <main+0x97>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1194 <main+0x84>
cmpl   $0x13,-0x8(%rbp)
jne    1168 <main+0x58>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <main+0x71>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x76>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x26>
jmp    1199 <main+0x89>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xffffffed,%ecx
mov    $0x3,%r14d
mov    $0x1,%r12d
lea    0xed7(%rip),%r15
mov    $0x1,%ebx
jmp    116c <main+0x5c>
nopw   0x0(%rax,%rax,1)
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    $0x13,%edx
mov    (%rsp),%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%ecx
add    $0x1,%ecx
add    %r14d,%r12d
add    $0x2,%r14d
cmp    $0x14,%ebx
je     119f <main+0x8f>
lea    (%rbx,%rbx,8),%eax
lea    (%rbx,%rax,2),%eax
mov    %eax,(%rsp)
mov    %r12d,%ebp
mov    %ecx,0x4(%rsp)
mov    %ecx,%r13d
nop
cmp    $0xffffffff,%r13d
je     1140 <main+0x30>
lea    0x14(%r13),%edx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%ecx
call   1030 <printf@plt>
add    %ebx,%ebp
inc    %r13d
jne    1180 <main+0x70>
jmp    1156 <main+0x46>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d*%d=%i\0A\00"
@.str.1 = [10 x i8] c"%d*%d=%i \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %33, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %36
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
br label %8
8: ; preds = %29, %6
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 20
br i1 %10, label %11, label %32
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 19
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = mul nsw i32 %17, %18
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %19)
br label %28
21: ; preds = %11
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = mul nsw i32 %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, i32 %26)
br label %28
28: ; preds = %21, %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %8
32: ; preds = %8
br label %33
33: ; preds = %32
%34 = load i32, i32* %1
%35 = add nsw i32 %34, 1
store i32 %35, i32* %1
br label %3
36: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d*%d=%i\0A\00"
@.str.1 = [10 x i8] c"%d*%d=%i \00"
define void @main() {
br label %1
1: ; preds = %14, %0
%2 = phi i32 [ 1, %0 ], [ %15, %14 ]
%3 = mul nuw nsw i32 %2, 19
br label %4
4: ; preds = %1, %9
%5 = phi i32 [ %2, %1 ], [ %12, %9 ]
%6 = icmp eq i32 %5, 19
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 19, i32 %3)
br label %14
9: ; preds = %4
%10 = mul nsw i32 %5, %2
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %5, i32 %10)
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 20
br i1 %13, label %14, label %4
14: ; preds = %9, %7
%15 = add nuw nsw i32 %2, 1
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %1
17: ; preds = %14
ret void
}