#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*/ printf(char *, int);
void main() {
  int i, j, k, n, s;
  n = 10000;
  s = 2;
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j)
      for (k = 0; k < n; ++k)
        s = 2 * s + 1;
  printf("%d", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2710,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119f <main+0x8f>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118c <main+0x7c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1179 <main+0x69>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <main+0x43>
jmp    117e <main+0x6e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x30>
jmp    1191 <main+0x81>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2710,%edx
cs nopw 0x0(%rax,%rax,1)
nop
shl    $0x8,%esi
or     $0xff,%esi
add    $0xfffffff8,%edx
jne    1140 <main+0x30>
add    $0x1,%ecx
cmp    $0x2710,%ecx
jne    1130 <main+0x20>
add    $0x1,%eax
cmp    $0x2710,%eax
jne    1120 <main+0x10>
lea    0xe96(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10000, i32* %4
store i32 2, i32* %5
store i32 0, i32* %1
br label %6
6: ; preds = %32, %0
%7 = load i32, i32* %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %35
10: ; preds = %6
store i32 0, i32* %2
br label %11
11: ; preds = %28, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
store i32 0, i32* %3
br label %16
16: ; preds = %24, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i32, i32* %5
%22 = mul nsw i32 2, %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %24
24: ; preds = %20
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %16
27: ; preds = %16
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %11
31: ; preds = %11
br label %32
32: ; preds = %31
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %6
35: ; preds = %6
%36 = load i32, i32* %5
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
br label %1
1: ; preds = %0, %17
%2 = phi i32 [ 2, %0 ], [ %11, %17 ]
%3 = phi i32 [ 0, %0 ], [ %18, %17 ]
br label %4
4: ; preds = %1, %14
%5 = phi i32 [ %2, %1 ], [ %11, %14 ]
%6 = phi i32 [ 0, %1 ], [ %15, %14 ]
br label %7
7: ; preds = %7, %4
%8 = phi i32 [ %5, %4 ], [ %11, %7 ]
%9 = phi i32 [ 0, %4 ], [ %12, %7 ]
%10 = shl i32 %8, 8
%11 = or i32 %10, 255
%12 = add nuw nsw i32 %9, 8
%13 = icmp eq i32 %12, 10000
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, 10000
br i1 %16, label %17, label %4
17: ; preds = %14
%18 = add nuw nsw i32 %3, 1
%19 = icmp eq i32 %18, 10000
br i1 %19, label %20, label %1
20: ; preds = %17
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}