#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 scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int mm_isupper(char);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  clock_t start, end;
  double mtime1, mtime2;
  int i, res;
  start = clock();
  i = 0;
  while (++i)
    res = (('g') >= 'A' && ('g') <= 'Z') ? 1 : 0;
  end = clock();
  mtime1 = ((double)(end - start)) / CLOCKS_PER_SEC;
  start = clock();
  i = 0;
  while (++i)
    res = mm_isupper('g');
  end = clock();
  mtime2 = ((double)(end - start)) / CLOCKS_PER_SEC;
  res = res;
  printf("Total time1: %f\n", mtime1);
  printf("Total time2: %f\n", mtime2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
je     116f <main+0x3f>
movl   $0x0,-0x30(%rbp)
jmp    1151 <main+0x21>
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e5a(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
je     11cd <main+0x9d>
mov    $0x67,%edi
call   1030 <mm_isupper@plt>
mov    %eax,-0x30(%rbp)
jmp    11a9 <main+0x79>
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2dfc(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xdf9(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xdf9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [17 x i8] c"Total time1: %f\0A\00"
@.str.1 = [17 x i8] c"Total time2: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i64 (...) @clock()
store i64 %8, i64* %2
store i32 0, i32* %6
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %7
br label %9
14: ; preds = %9
%15 = call i64 (...) @clock()
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = load i64, i64* %2
%18 = sub nsw i64 %16, %17
%19 = sitofp i64 %18 to double
%20 = load double, double* @CLOCKS_PER_SEC
%21 = fdiv double %19, %20
store double %21, double* %4
%22 = call i64 (...) @clock()
store i64 %22, i64* %2
store i32 0, i32* %6
br label %23
23: ; preds = %27, %14
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @mm_isupper(i8 signext 103)
store i32 %28, i32* %7
br label %23
29: ; preds = %23
%30 = call i64 (...) @clock()
store i64 %30, i64* %3
%31 = load i64, i64* %3
%32 = load i64, i64* %2
%33 = sub nsw i64 %31, %32
%34 = sitofp i64 %33 to double
%35 = load double, double* @CLOCKS_PER_SEC
%36 = fdiv double %34, %35
store double %36, double* %5
%37 = load i32, i32* %7
store i32 %37, i32* %7
%38 = load double, double* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %38)
%40 = load double, double* %5
%41 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %40)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = tail call i64 (...) @clock()
unreachable
}