#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 */
double CLOCKS_PER_SEC;
double clock();
unsigned int log(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double start, end;
  printf("Params received.\n");
  printf("Alrogithm starts, please wait...\n");
  start = clock();
  for (unsigned int i = 2; i <= 100; i++) {
    for (unsigned int j = 2; j <= 100; j++) {
      printf("%0.10f\n", log(i) * j);
    }
  }
  end = clock();
  printf("Algorithm end.\n");
  printf("Total time: %f\n", (end - start) / CLOCKS_PER_SEC);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
movl   $0x2,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
ja     11cd <main+0x9d>
movl   $0x2,-0x28(%rbp)
cmpl   $0x64,-0x28(%rbp)
ja     11ba <main+0x8a>
mov    -0x24(%rbp),%edi
call   1050 <log@plt>
mov    %eax,%esi
imul   -0x28(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1186 <main+0x56>
jmp    11bf <main+0x8f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1175 <main+0x45>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    0x2df0(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe49(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%ebx
lea    0xe87(%rip),%r14
nopl   0x0(%rax)
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1060 <log@plt>
imul   %ebp,%eax
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1190 <main+0x50>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1180 <main+0x40>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,(%rsp)
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mov    0x2e08(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe1d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Params received.\0A\00"
@.str.1 = [34 x i8] c"Alrogithm starts, please wait...\0A\00"
@.str.2 = [8 x i8] c"%0.10f\0A\00"
@.str.3 = [16 x i8] c"Algorithm end.\0A\00"
@.str.4 = [16 x i8] c"Total time: %f\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%12 = call double (...) @clock()
store double %12, double* %6
store i32 2, i32* %8
br label %13
13: ; preds = %30, %2
%14 = load i32, i32* %8
%15 = icmp ule i32 %14, 100
br i1 %15, label %16, label %33
16: ; preds = %13
store i32 2, i32* %9
br label %17
17: ; preds = %26, %16
%18 = load i32, i32* %9
%19 = icmp ule i32 %18, 100
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %8
%22 = call i32 @log(i32 %21)
%23 = load i32, i32* %9
%24 = mul i32 %22, %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %9
%28 = add i32 %27, 1
store i32 %28, i32* %9
br label %17
29: ; preds = %17
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add i32 %31, 1
store i32 %32, i32* %8
br label %13
33: ; preds = %13
%34 = call double (...) @clock()
store double %34, double* %7
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%36 = load double, double* %7
%37 = load double, double* %6
%38 = fsub double %36, %37
%39 = load double, double* @CLOCKS_PER_SEC
%40 = fdiv double %38, %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %40)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [8 x i8] c"%0.10f\0A\00"
@.str.4 = [16 x i8] c"Total time: %f\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@str = [17 x i8] c"Params received.\00"
@str.5 = [33 x i8] c"Alrogithm starts, please wait...\00"
@str.6 = [15 x i8] c"Algorithm end.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%5 = tail call double (...) @clock()
br label %6
6: ; preds = %2, %15
%7 = phi i32 [ 2, %2 ], [ %16, %15 ]
br label %18
8: ; preds = %15
%9 = tail call double (...) @clock()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0))
%11 = fsub double %9, %5
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %13)
ret i32 0
15: ; preds = %18
%16 = add nuw nsw i32 %7, 1
%17 = icmp eq i32 %16, 101
br i1 %17, label %8, label %6
18: ; preds = %6, %18
%19 = phi i32 [ 2, %6 ], [ %23, %18 ]
%20 = tail call i32 @log(i32 %7)
%21 = mul i32 %20, %19
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = add nuw nsw i32 %19, 1
%24 = icmp eq i32 %23, 101
br i1 %24, label %15, label %18
}