#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 *, ...);
void exerciseE() {
  int i;
  int sum;
  printf("\n\nExercise E running....\n");
  for (sum = 0, i = 1; i < (50 * 3); i += 3) {
    printf("%d", i);
    if (i < ((50 - 1) * 3))
      printf(", ");
    else
      printf(".");
    sum += i;
  }
  printf("\nSum of numbers: %d", sum);
  printf("\nExercise E complete.\n\n");
  return;
}


x86 assembly (clang, -O0):
<exerciseE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x96,-0x4(%rbp)
jge    1197 <exerciseE+0x87>
mov    -0x4(%rbp),%esi
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x93,-0x4(%rbp)
jge    1172 <exerciseE+0x62>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1180 <exerciseE+0x70>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <exerciseE+0x24>
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exerciseE>:
push   %r15
push   %r14
push   %rbx
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
lea    0xecc(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xfffffffe,%ebx
lea    0xe9d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x6(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x3,%ebx
cmp    $0x90,%ebx
jb     1170 <exerciseE+0x40>
mov    $0x2e,%edi
call   1030 <putchar@plt>
lea    0xe60(%rip),%rdi
mov    $0xe8d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7a(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A\0AExercise E running....\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c", \00"
@.str.3 = [2 x i8] c".\00"
@.str.4 = [20 x i8] c"\0ASum of numbers: %d\00"
@.str.5 = [24 x i8] c"\0AExercise E complete.\0A\0A\00"
define void @exerciseE() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
store i32 1, i32* %1
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 150
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 147
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = add nsw i32 %18, %17
store i32 %19, i32* %2
br label %20
20: ; preds = %16
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 3
store i32 %22, i32* %1
br label %4
23: ; preds = %4
%24 = load i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c", \00"
@.str.4 = [20 x i8] c"\0ASum of numbers: %d\00"
@str = [25 x i8] c"\0A\0AExercise E running....\00"
@str.6 = [23 x i8] c"\0AExercise E complete.\0A\00"
define void @exerciseE() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %6, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = icmp ult i32 %4, 144
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = tail call i32 @putchar(i32 46)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 3725)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
ret void
}