#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);
int main() {
  int i = 11, sum = 0;
  printf("%d", i);
  sum = i;
  i = i + 2;
  while (i <= 99) {
    printf(" + %d", i);
    sum = sum + i;
    i += 2;
  }
  printf(" = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jg     117b <main+0x6b>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xb,%ebx
mov    $0xb,%esi
call   1030 <printf@plt>
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x62,%ebx
jb     1140 <main+0x30>
lea    0xead(%rip),%rdi
mov    $0x9ab,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c" + %d\00"
@.str.2 = [7 x i8] c" = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 11)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 13, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 2
%6 = icmp ult i32 %3, 98
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 2475)
ret i32 0
}