#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 */
int /*<<< orphan*/ fake_call();
int /*<<< orphan*/ rdtsc_markerInit();
int /*<<< orphan*/ rdtsc_markerStartRegion(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ rdtsc_markerStopRegion(char *, int /*<<< orphan*/, int);
int main() {
  int i, j;
  int TAB[100];
  rdtsc_markerInit();
  rdtsc_markerStartRegion("test_1", 0, 1);
  for (i = 0; i < 10; i++) {
    fake_call();
  }
  rdtsc_markerStopRegion("test_1", 0, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rdtsc_markerInit@plt>
lea    0xea0(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <rdtsc_markerStartRegion@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1192 <main+0x52>
mov    $0x0,%al
call   1040 <fake_call@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <main+0x33>
lea    0xe67(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <rdtsc_markerStopRegion@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rdtsc_markerInit@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <rdtsc_markerStartRegion@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
xor    %eax,%eax
call   1040 <fake_call@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1050 <rdtsc_markerStopRegion@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"test_1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
store i32 0, i32* %1
%5 = call i32 (...) @rdtsc_markerInit()
%6 = call i32 @rdtsc_markerStartRegion(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
store i32 0, i32* %2
br label %7
7: ; preds = %12, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 (...) @fake_call()
br label %12
12: ; preds = %10
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %7
15: ; preds = %7
%16 = call i32 @rdtsc_markerStopRegion(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"test_1\00"
define i32 @main() {
%1 = tail call i32 (...) @rdtsc_markerInit()
%2 = tail call i32 @rdtsc_markerStartRegion(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%3 = tail call i32 (...) @fake_call()
%4 = tail call i32 (...) @fake_call()
%5 = tail call i32 (...) @fake_call()
%6 = tail call i32 (...) @fake_call()
%7 = tail call i32 (...) @fake_call()
%8 = tail call i32 (...) @fake_call()
%9 = tail call i32 (...) @fake_call()
%10 = tail call i32 (...) @fake_call()
%11 = tail call i32 (...) @fake_call()
%12 = tail call i32 (...) @fake_call()
%13 = tail call i32 @rdtsc_markerStopRegion(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}