#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 */
scalar_t__ click_counter(char);
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  char input[160];
  int count, CurentChar, sum = 0, SymbCount;
  for (count = 0; CurentChar != '\n' && count < 160; count++) {
    CurentChar = getchar();
    input[count] = CurentChar;
  }
  SymbCount = count;
  for (count = 0; count < SymbCount; count++) {
    sum += click_counter(input[count]);
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xb4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xb8(%rbp)
mov    %al,-0xc1(%rbp)
je     117e <main+0x4e>
cmpl   $0xa0,-0xb4(%rbp)
setl   %al
mov    %al,-0xc1(%rbp)
mov    -0xc1(%rbp),%al
test   $0x1,%al
jne    1191 <main+0x61>
jmp    11c8 <main+0x98>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
mov    %al,%cl
movslq -0xb4(%rbp),%rax
mov    %cl,-0xb0(%rbp,%rax,1)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1156 <main+0x26>
mov    -0xb4(%rbp),%eax
mov    %eax,-0xc0(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0xc0(%rbp),%eax
jge    122b <main+0xfb>
movslq -0xb4(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%edi
ff
call   1050 <click_counter@plt>
mov    %rax,%rcx
movslq -0xbc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xbc(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11de <main+0xae>
mov    -0xbc(%rbp),%esi
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}