#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  int array[100];
  int sum = 0;
  for (i = 0; i < 100; i++)
    array[i] = i + 1;
  for (i = 0; i < 100; i++)
    sum += array[i];
  printf("Sum from 0 to 100: %d\n", sum);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1b4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1163 <main+0x53>
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1199 <main+0x89>
movslq -0x14(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%eax
add    -0x1b4(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <main+0x5a>
mov    -0x1b4(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xefb(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeff(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf0c(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xf0e(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xf10(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xf11(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xf12(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xf13(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movdqa 0x10(%rsp),%xmm0
paddd  (%rsp),%xmm0
paddd  0x20(%rsp),%xmm0
paddd  0x30(%rsp),%xmm0
paddd  0x40(%rsp),%xmm0
paddd  0x50(%rsp),%xmm0
paddd  0xef0(%rip),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%eax
add    $0x198,%rsp
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Sum from 0 to 100: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = bitcast [100 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 13, i32 14, i32 15, i32 16>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 16
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 17, i32 18, i32 19, i32 20>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 20
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 21, i32 22, i32 23, i32 24>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 24
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 25, i32 26, i32 27, i32 28>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 28
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 29, i32 30, i32 31, i32 32>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 32
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 33, i32 34, i32 35, i32 36>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 36
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 37, i32 38, i32 39, i32 40>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 40
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 41, i32 42, i32 43, i32 44>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 44
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 45, i32 46, i32 47, i32 48>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 48
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 49, i32 50, i32 51, i32 52>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 52
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 53, i32 54, i32 55, i32 56>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 56
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 57, i32 58, i32 59, i32 60>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 60
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 61, i32 62, i32 63, i32 64>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 64
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 65, i32 66, i32 67, i32 68>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 68
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 69, i32 70, i32 71, i32 72>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 72
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 73, i32 74, i32 75, i32 76>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 76
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 77, i32 78, i32 79, i32 80>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 80
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 81, i32 82, i32 83, i32 84>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 84
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 85, i32 86, i32 87, i32 88>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 88
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 89, i32 90, i32 91, i32 92>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 92
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 93, i32 94, i32 95, i32 96>, <4 x i32>* %51
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 96
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 97, i32 98, i32 99, i32 100>, <4 x i32>* %53
%54 = bitcast [100 x i32]* %3 to <4 x i32>*
%55 = load <4 x i32>, <4 x i32>* %54
%56 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 4
%57 = bitcast i32* %56 to <4 x i32>*
%58 = load <4 x i32>, <4 x i32>* %57
%59 = add <4 x i32> %58, %55
%60 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 8
%61 = bitcast i32* %60 to <4 x i32>*
%62 = load <4 x i32>, <4 x i32>* %61
%63 = add <4 x i32> %62, %59
%64 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 12
%65 = bitcast i32* %64 to <4 x i32>*
%66 = load <4 x i32>, <4 x i32>* %65
%67 = add <4 x i32> %66, %63
%68 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 16
%69 = bitcast i32* %68 to <4 x i32>*
%70 = load <4 x i32>, <4 x i32>* %69
%71 = add <4 x i32> %70, %67
%72 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 20
%73 = bitcast i32* %72 to <4 x i32>*
%74 = load <4 x i32>, <4 x i32>* %73
%75 = add <4 x i32> %74, %71
%76 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 24
%77 = bitcast i32* %76 to <4 x i32>*
%78 = load <4 x i32>, <4 x i32>* %77
%79 = add <4 x i32> %78, %75
%80 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 28
%81 = bitcast i32* %80 to <4 x i32>*
%82 = load <4 x i32>, <4 x i32>* %81
%83 = add <4 x i32> %82, %79
%84 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 32
%85 = bitcast i32* %84 to <4 x i32>*
%86 = load <4 x i32>, <4 x i32>* %85
%87 = add <4 x i32> %86, %83
%88 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 36
%89 = bitcast i32* %88 to <4 x i32>*
%90 = load <4 x i32>, <4 x i32>* %89
%91 = add <4 x i32> %90, %87
%92 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 40
%93 = bitcast i32* %92 to <4 x i32>*
%94 = load <4 x i32>, <4 x i32>* %93
%95 = add <4 x i32> %94, %91
%96 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 44
%97 = bitcast i32* %96 to <4 x i32>*
%98 = load <4 x i32>, <4 x i32>* %97
%99 = add <4 x i32> %98, %95
%100 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 48
%101 = bitcast i32* %100 to <4 x i32>*
%102 = load <4 x i32>, <4 x i32>* %101
%103 = add <4 x i32> %102, %99
%104 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 52
%105 = bitcast i32* %104 to <4 x i32>*
%106 = load <4 x i32>, <4 x i32>* %105
%107 = add <4 x i32> %106, %103
%108 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 56
%109 = bitcast i32* %108 to <4 x i32>*
%110 = load <4 x i32>, <4 x i32>* %109
%111 = add <4 x i32> %110, %107
%112 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 60
%113 = bitcast i32* %112 to <4 x i32>*
%114 = load <4 x i32>, <4 x i32>* %113
%115 = add <4 x i32> %114, %111
%116 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 64
%117 = bitcast i32* %116 to <4 x i32>*
%118 = load <4 x i32>, <4 x i32>* %117
%119 = add <4 x i32> %118, %115
%120 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 68
%121 = bitcast i32* %120 to <4 x i32>*
%122 = load <4 x i32>, <4 x i32>* %121
%123 = add <4 x i32> %122, %119
%124 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 72
%125 = bitcast i32* %124 to <4 x i32>*
%126 = load <4 x i32>, <4 x i32>* %125
%127 = add <4 x i32> %126, %123
%128 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 76
%129 = bitcast i32* %128 to <4 x i32>*
%130 = load <4 x i32>, <4 x i32>* %129
%131 = add <4 x i32> %130, %127
%132 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 80
%133 = bitcast i32* %132 to <4 x i32>*
%134 = load <4 x i32>, <4 x i32>* %133
%135 = add <4 x i32> %134, %131
%136 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 84
%137 = bitcast i32* %136 to <4 x i32>*
%138 = load <4 x i32>, <4 x i32>* %137
%139 = add <4 x i32> %138, %135
%140 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 88
%141 = bitcast i32* %140 to <4 x i32>*
%142 = load <4 x i32>, <4 x i32>* %141
%143 = add <4 x i32> %142, %139
%144 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 92
%145 = bitcast i32* %144 to <4 x i32>*
%146 = load <4 x i32>, <4 x i32>* %145
%147 = add <4 x i32> %146, %143
%148 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 96
%149 = bitcast i32* %148 to <4 x i32>*
%150 = load <4 x i32>, <4 x i32>* %149
%151 = add <4 x i32> %150, %147
%152 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %151)
%153 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %152)
%154 = load i32, i32* @EXIT_SUCCESS
ret i32 %154
}