#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, int);
int main(void) {
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 3; k++) {
        printf("%d * %d * %d = %d\n", i, j, k, (i * j * k));
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11a9 <main+0x99>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1196 <main+0x86>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1183 <main+0x73>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%r8d
imul   -0xc(%rbp),%r8d
imul   -0x10(%rbp),%r8d
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <main+0x38>
jmp    1188 <main+0x78>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    119b <main+0x8b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee0(%rip),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1120 <main+0x10>
xor    %ebx,%ebx
lea    0xe96(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %ebp,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x2,%ecx
mov    %ebx,%r8d
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x2,%ebx
cmp    $0xa,%ebp
jne    1170 <main+0x60>
xor    %ebx,%ebx
lea    0xe3a(%rip),%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
mov    $0x2,%ecx
mov    %r15d,%r8d
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x4,%r15d
add    $0x2,%ebx
cmp    $0x14,%ebx
jne    11d0 <main+0xc0>
xor    %r15d,%r15d
lea    0xdd5(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
nop
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    %r15d,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
mov    $0x2,%ecx
mov    %ebp,%r8d
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0x6,%ebp
add    $0x3,%r15d
cmp    $0x3c,%ebp
jne    1230 <main+0x120>
xor    %ebx,%ebx
lea    0xd76(%rip),%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    $0x2,%ecx
mov    %r15d,%r8d
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x8,%r15d
add    $0x4,%ebx
cmp    $0x28,%ebx
jne    1290 <main+0x180>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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