#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*/ clock();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  time_t t0 = clock();
  int L = 10000000;
  long long acc = 0;
  int ini = 0, fim = 2 * L;
  while (ini <= fim)
    acc += ini++;
  time_t t1 = clock();
  printf("C\n");
  printf("%lld\n", acc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
movl   $0x989680,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     117e <main+0x5e>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <main+0x38>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x24(%rbp)
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
xor    %eax,%eax
call   1040 <clock@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%rdi
movabs $0xb5e6218d1680,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"C\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (...) @clock()
store i32 %8, i32* %2
store i32 10000000, i32* %3
store i64 0, i64* %4
store i32 0, i32* %5
%9 = load i32, i32* %3
%10 = mul nsw i32 2, %9
store i32 %10, i32* %6
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = sext i32 %16 to i64
%19 = load i64, i64* %4
%20 = add nsw i64 %19, %18
store i64 %20, i64* %4
br label %11
21: ; preds = %11
%22 = call i32 (...) @clock()
store i32 %22, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%24 = load i64, i64* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %24)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%lld\0A\00"
@str = [2 x i8] c"C\00"
define i32 @main() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 (...) @clock()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 200000010000000)
ret i32 0
}