#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 */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char *argv[]) {
  int a[] = {3, 2, 5, 6, 11, 13, 40, 66, 34, 12, 90, 100, 78, 44, 34, 22, 25};
  int size = sizeof(a) / sizeof(a[0]);
  int count = 0;
  for (int i = 0; i < size; i++)
    for (int j = 0; j < size; j++)
      for (int k = 0; k < size; k++)
        if (a[i] + a[j] == a[k]) {
          printf("%d + %d = %d\n", a[i], a[j], a[k]);
          count++;
          break;
        }
  printf("\nCount is %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x44,%edx
call   1040 <memcpy@plt>
movl   $0x11,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1220 <main+0x100>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    120d <main+0xed>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    11fa <main+0xda>
movslq -0x6c(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%eax
movslq -0x70(%rbp),%rcx
add    -0x60(%rbp,%rcx,4),%eax
movslq -0x74(%rbp),%rcx
cmp    -0x60(%rbp,%rcx,4),%eax
jne    11e7 <main+0xc7>
movslq -0x6c(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
movslq -0x70(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
movslq -0x74(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11fa <main+0xda>
jmp    11ec <main+0xcc>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1189 <main+0x69>
jmp    11ff <main+0xdf>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1176 <main+0x56>
jmp    1212 <main+0xf2>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1163 <main+0x43>
mov    -0x68(%rbp),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x106e(%rip),%r15
lea    0xed7(%rip),%r12
lea    0x10a4(%rip),%r14
xor    %eax,%eax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,(%rsp)
mov    (%r15,%rax,4),%ebx
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%r15,1),%edx
lea    (%rdx,%rbx,1),%eax
add    $0xfffffffe,%eax
cmp    $0x62,%eax
ja     117b <main+0x6b>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
lea    (%rdx,%rbx,1),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x4,%r13
cmp    $0x44,%r13
jne    1150 <main+0x40>
mov    (%rsp),%rax
add    $0x1,%rax
cmp    $0x11,%rax
jne    1140 <main+0x30>
lea    0x1048(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.a = [17 x i32] [i32 3, i32 2, i32 5, i32 6, i32 11, i32 13, i32 40, i32 66, i32 34, i32 12, i32 90, i32 100, i32 78, i32 44, i32 34, i32 22, i32 25]
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"\0ACount is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [17 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [17 x i32]* %6 to i8*
store i32 17, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %13
13: ; preds = %67, %2
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %70
17: ; preds = %13
store i32 0, i32* %10
br label %18
18: ; preds = %63, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %66
22: ; preds = %18
store i32 0, i32* %11
br label %23
23: ; preds = %59, %22
%24 = load i32, i32* %11
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %62
27: ; preds = %23
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = add nsw i32 %31, %35
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = icmp eq i32 %36, %40
br i1 %41, label %42, label %58
42: ; preds = %27
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [17 x i32], [17 x i32]* %6, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %46, i32 %50, i32 %54)
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %62
58: ; preds = %27
br label %59
59: ; preds = %58
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %23
62: ; preds = %42, %23
br label %63
63: ; preds = %62
%64 = load i32, i32* %10
%65 = add nsw i32 %64, 1
store i32 %65, i32* %10
br label %18
66: ; preds = %18
br label %67
67: ; preds = %66
%68 = load i32, i32* %9
%69 = add nsw i32 %68, 1
store i32 %69, i32* %9
br label %13
70: ; preds = %13
%71 = load i32, i32* %8
%72 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %71)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [17 x i32] [i32 3, i32 2, i32 5, i32 6, i32 11, i32 13, i32 40, i32 66, i32 34, i32 12, i32 90, i32 100, i32 78, i32 44, i32 34, i32 22, i32 25]
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [14 x i8] c"\0ACount is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %16
%4 = phi i64 [ 0, %2 ], [ %17, %16 ]
%5 = phi i32 [ 0, %2 ], [ %23, %16 ]
%6 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.main.a, i64 0, i64 %4
%7 = load i32, i32* %6
br label %10
8: ; preds = %16
%9 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
10: ; preds = %3, %22
%11 = phi i64 [ 0, %3 ], [ %24, %22 ]
%12 = phi i32 [ %5, %3 ], [ %23, %22 ]
%13 = getelementptr inbounds [17 x i32], [17 x i32]* @__const.main.a, i64 0, i64 %11
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %7
switch i32 %15, label %22 [
i32 3, label %19
i32 2, label %19
i32 5, label %19
i32 6, label %19
i32 11, label %19
i32 13, label %19
i32 40, label %19
i32 66, label %19
i32 34, label %19
i32 12, label %19
i32 90, label %19
i32 100, label %19
i32 78, label %19
i32 44, label %19
i32 22, label %19
i32 25, label %19
]
16: ; preds = %22
%17 = add nuw nsw i64 %4, 1
%18 = icmp eq i64 %17, 17
br i1 %18, label %8, label %3
19: ; preds = %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10
%20 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %14, i32 %15)
%21 = add nsw i32 %12, 1
br label %22
22: ; preds = %10, %19
%23 = phi i32 [ %21, %19 ], [ %12, %10 ]
%24 = add nuw nsw i64 %11, 1
%25 = icmp eq i64 %24, 17
br i1 %25, label %16, label %10
}