#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return 1;
  int n, i;
  time_t t;
  srand((unsigned)time(&t));
  n = argv[1][0];
  for (i = 1; i <= 10; ++i) {
    printf("%d * %d = %d\n", n, i, n * i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11b9 <main+0x89>
lea    -0x1c(%rbp),%rdi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jg     11b2 <main+0x82>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
imul   -0x18(%rbp),%ecx
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1181 <main+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1237 <main+0x107>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%ebx
lea    0xe99(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
lea    (%rbx,%rbx,1),%r15d
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
mov    %r15d,%ecx
call   1030 <printf@plt>
lea    (%rbx,%rbx,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
lea    0x0(,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
lea    (%rbx,%rbx,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
lea    (%r15,%r15,2),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%ecx
sub    %ebx,%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
lea    (%rbx,%rbx,8),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1030 <printf@plt>
lea    (%r15,%r15,4),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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