#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*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void timing_computation() {
  for (int counter = 0; counter < 100000000; counter++) {
    if (counter % 100000 == 0) {
      write(STDOUT_FILENO, ".", 1);
    }
  }
}


x86 assembly (clang, -O0):
<timing_computation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    116d <timing_computation+0x5d>
mov    -0x4(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115a <timing_computation+0x4a>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    115f <timing_computation+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <timing_computation+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timing_computation>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    0x2ed0(%rip),%r14
lea    0xed9(%rip),%r15
xor    %ebx,%ebx
jmp    113e <timing_computation+0x2e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    $0xfa0a1f00,%ebp
je     116a <timing_computation+0x5a>
mov    %ebx,%eax
shr    $0x5,%eax
imul   $0xa7c5ac5,%rax,%rax
shr    $0x27,%rax
imul   $0xfffe7960,%eax,%eax
cmp    %ebp,%eax
jne    1130 <timing_computation+0x20>
mov    (%r14),%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1130 <timing_computation+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c".\00"
define void @timing_computation() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100000000
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = load i32, i32* %1
%7 = srem i32 %6, 100000
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* @STDOUT_FILENO
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %12
12: ; preds = %9, %5
br label %13
13: ; preds = %12
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %2
16: ; preds = %2
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c".\00"
define void @timing_computation() {
br label %2
1: ; preds = %9
ret void
2: ; preds = %0, %9
%3 = phi i32 [ 0, %0 ], [ %10, %9 ]
%4 = urem i32 %3, 100000
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @STDOUT_FILENO
%8 = tail call i32 @write(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %9
9: ; preds = %2, %6
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 100000000
br i1 %11, label %1, label %2
}