#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*/ getch();
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int sumarray(int *, int);
main() {
loop:;
  int c, s[200], i, d, n, j;
  for (i = 0; i <= 200; ++i) {
    s[i] = 0;
  }
  for (i = 0; i <= 200 && (c = getchar()) != '\n'; ++i) {
    s[i] = c - 96;
  }
  d = sumarray(s, 200);
  printf("\n%d\n", d);
  for (n = 0; n <= 100; ++n) {
    int t, state;
    t = n * (n + 1) / 2;
    if (d == t) {
      printf("Yes!");
    }
  }
  getch();
  goto loop;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x334(%rbp)
cmpl   $0xc8,-0x334(%rbp)
jg     1192 <main+0x52>
movslq -0x334(%rbp),%rax
movl   $0x0,-0x330(%rbp,%rax,4)
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    115c <main+0x1c>
movl   $0x0,-0x334(%rbp)
xor    %eax,%eax
cmpl   $0xc8,-0x334(%rbp)
mov    %al,-0x349(%rbp)
jg     11ca <main+0x8a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
setne  %al
mov    %al,-0x349(%rbp)
mov    -0x349(%rbp),%al
test   $0x1,%al
jne    11dd <main+0x9d>
jmp    1205 <main+0xc5>
mov    -0x8(%rbp),%ecx
sub    $0x60,%ecx
movslq -0x334(%rbp),%rax
mov    %ecx,-0x330(%rbp,%rax,4)
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    119c <main+0x5c>
lea    -0x330(%rbp),%rdi
mov    $0xc8,%esi
call   1060 <sumarray@plt>
mov    %eax,-0x338(%rbp)
mov    -0x338(%rbp),%esi
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x33c(%rbp)
cmpl   $0x64,-0x33c(%rbp)
jg     12a0 <main+0x160>
mov    -0x33c(%rbp),%eax
mov    -0x33c(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x344(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x344(%rbp),%eax
jne    1287 <main+0x147>
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128c <main+0x14c>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    123a <main+0xfa>
mov    $0x0,%al
call   1050 <getch@plt>
jmp    1152 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x320,%rsp
mov    %rsp,%r15
lea    0xe97(%rip),%r14
lea    0xe95(%rip),%r12
jmp    1187 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <getch@plt>
mov    $0x324,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     11bf <main+0x6f>
add    $0xffffffa0,%eax
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0xc9,%rbx
jne    11a0 <main+0x50>
mov    %r15,%rdi
mov    $0xc8,%esi
call   1070 <sumarray@plt>
mov    %eax,%ebp
xor    %ebx,%ebx
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11e5 <main+0x95>
xchg   %ax,%ax
cmp    $0x65,%ebx
je     1180 <main+0x30>
mov    %ebx,%eax
lea    0x1(%rax),%ebx
imul   %ebx,%eax
shr    %eax
cmp    %eax,%ebp
jne    11e0 <main+0x90>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11e0 <main+0x90>

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%d\0A\00"
@.str.1 = [5 x i8] c"Yes!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [200 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
br label %10
10: ; preds = %62, %0
store i32 0, i32* %4
br label %11
11: ; preds = %18, %10
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 200
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %16
store i32 0, i32* %17
br label %18
18: ; preds = %14
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %11
21: ; preds = %11
store i32 0, i32* %4
br label %22
22: ; preds = %36, %21
%23 = load i32, i32* %4
%24 = icmp sle i32 %23, 200
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = call i32 (...) @getchar()
store i32 %26, i32* %2
%27 = icmp ne i32 %26, 10
br label %28
28: ; preds = %25, %22
%29 = phi i1 [ false, %22 ], [ %27, %25 ]
br i1 %29, label %30, label %39
30: ; preds = %28
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 96
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %34
store i32 %32, i32* %35
br label %36
36: ; preds = %30
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %22
39: ; preds = %28
%40 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 0
%41 = call i32 @sumarray(i32* %40, i32 200)
store i32 %41, i32* %5
%42 = load i32, i32* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %42)
store i32 0, i32* %6
br label %44
44: ; preds = %59, %39
%45 = load i32, i32* %6
%46 = icmp sle i32 %45, 100
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = load i32, i32* %6
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
%51 = mul nsw i32 %48, %50
%52 = sdiv i32 %51, 2
store i32 %52, i32* %8
%53 = load i32, i32* %5
%54 = load i32, i32* %8
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %58
56: ; preds = %47
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %58
58: ; preds = %56, %47
br label %59
59: ; preds = %58
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %44
62: ; preds = %44
%63 = call i32 (...) @getch()
br label %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
@.str.1 = [5 x i8] c"Yes!\00"
define i32 @main() {
%1 = alloca [200 x i32]
%2 = bitcast [200 x i32]* %1 to i8*
%3 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %27, %0
br label %5
5: ; preds = %4, %9
%6 = phi i64 [ 0, %4 ], [ %12, %9 ]
%7 = call i32 (...) @getchar()
%8 = icmp eq i32 %7, 10
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nsw i32 %7, -96
%11 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %6
store i32 %10, i32* %11
%12 = add nuw nsw i64 %6, 1
%13 = icmp eq i64 %12, 201
br i1 %13, label %14, label %5
14: ; preds = %9, %5
%15 = call i32 @sumarray(i32* %3, i32 200)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %25
%18 = phi i32 [ 0, %14 ], [ %19, %25 ]
%19 = add nuw nsw i32 %18, 1
%20 = mul nuw nsw i32 %19, %18
%21 = lshr i32 %20, 1
%22 = icmp eq i32 %15, %21
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %17
%26 = icmp eq i32 %19, 101
br i1 %26, label %27, label %17
27: ; preds = %25
%28 = call i32 (...) @getch()
br label %4
}