#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();
int digit_cancelable(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double start, end;
  unsigned int trivial_numerator = 1, trivial_denominator = 1;
  printf("Algorithm starts, please wait...\n");
  start = clock();
  for (unsigned int i = 11; i <= 99; i++) {
    for (unsigned int j = 11; j < i; j++) {
      if (digit_cancelable(j, i) == 1) {
        trivial_numerator *= j;
        trivial_denominator *= i;
      }
    }
  }
  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)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
movl   $0xb,-0x2c(%rbp)
cmpl   $0x63,-0x2c(%rbp)
ja     11e0 <main+0xb0>
movl   $0xb,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    11cd <main+0x9d>
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1030 <digit_cancelable@plt>
cmp    $0x1,%eax
jne    11ba <main+0x8a>
mov    -0x30(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11bf <main+0x8f>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1186 <main+0x56>
jmp    11d2 <main+0xa2>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1175 <main+0x45>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mov    0x2ddd(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe1c(%rip),%rdi
mov    $0x1,%al
call   1050 <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    0xec1(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0xb,%ebp
jmp    117c <main+0x3c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0xffffffff,%r14d
cmp    $0x64,%ebp
je     11ae <main+0x6e>
cmp    $0xc,%ebp
jb     1170 <main+0x30>
mov    $0xb,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <digit_cancelable@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0xb,%eax
jne    1190 <main+0x50>
jmp    1170 <main+0x30>
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,(%rsp)
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
movsd  (%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mov    0x2e10(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe1d(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Algorithm starts, please wait...\0A\00"
@.str.1 = [16 x i8] c"Algorithm end.\0A\00"
@.str.2 = [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
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %8
store i32 1, i32* %9
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%13 = call double (...) @clock()
store double %13, double* %6
store i32 11, i32* %10
br label %14
14: ; preds = %39, %2
%15 = load i32, i32* %10
%16 = icmp ule i32 %15, 99
br i1 %16, label %17, label %42
17: ; preds = %14
store i32 11, i32* %11
br label %18
18: ; preds = %35, %17
%19 = load i32, i32* %11
%20 = load i32, i32* %10
%21 = icmp ult i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %18
%23 = load i32, i32* %11
%24 = load i32, i32* %10
%25 = call i32 @digit_cancelable(i32 %23, i32 %24)
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %34
27: ; preds = %22
%28 = load i32, i32* %11
%29 = load i32, i32* %8
%30 = mul i32 %29, %28
store i32 %30, i32* %8
%31 = load i32, i32* %10
%32 = load i32, i32* %9
%33 = mul i32 %32, %31
store i32 %33, i32* %9
br label %34
34: ; preds = %27, %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %11
%37 = add i32 %36, 1
store i32 %37, i32* %11
br label %18
38: ; preds = %18
br label %39
39: ; preds = %38
%40 = load i32, i32* %10
%41 = add i32 %40, 1
store i32 %41, i32* %10
br label %14
42: ; preds = %14
%43 = call double (...) @clock()
store double %43, double* %7
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%45 = load double, double* %7
%46 = load double, double* %6
%47 = fsub double %45, %46
%48 = load double, double* @CLOCKS_PER_SEC
%49 = fdiv double %47, %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %49)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"Total time: %f\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
@str = [33 x i8] c"Algorithm starts, please wait...\00"
@str.3 = [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 ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%4 = tail call double (...) @clock()
br label %5
5: ; preds = %2, %15
%6 = phi i32 [ 11, %2 ], [ %16, %15 ]
%7 = icmp ugt i32 %6, 11
br i1 %7, label %18, label %15
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.3, i64 0, i64 0))
%11 = fsub double %9, %4
%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.2, i64 0, i64 0), double %13)
ret i32 0
15: ; preds = %18, %5
%16 = add nuw nsw i32 %6, 1
%17 = icmp eq i32 %16, 100
br i1 %17, label %8, label %5
18: ; preds = %5, %18
%19 = phi i32 [ %21, %18 ], [ 11, %5 ]
%20 = tail call i32 @digit_cancelable(i32 %19, i32 %6)
%21 = add nuw nsw i32 %19, 1
%22 = icmp eq i32 %21, %6
br i1 %22, label %15, label %18
}