#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 caparse(char *, int *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ isalpha(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int values[26] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  char in[255];
  argc = argc;
  argv = argv;
  while (!feof(stdin)) {
    fgets(in, 255, stdin);
    if (isalpha((int)in[0]) && in[1] == '=')
      values[in[0] - 'a'] = (in[2] - '0');
    else
      printf("%d\n", caparse(in, values));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11ba <main+0x5a>
jmp    123c <main+0xdc>
lea    -0x180(%rbp),%rdi
mov    0x2e20(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1050 <fgets@plt>
movsbl -0x180(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%rax
je     1219 <main+0xb9>
movsbl -0x17f(%rbp),%eax
cmp    $0x3d,%eax
jne    1219 <main+0xb9>
movsbl -0x17e(%rbp),%ecx
sub    $0x30,%ecx
movsbl -0x180(%rbp),%eax
sub    $0x61,%eax
cltq
mov    %ecx,-0x80(%rbp,%rax,4)
jmp    1237 <main+0xd7>
lea    -0x180(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1070 <caparse@plt>
mov    %eax,%esi
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
jmp    1197 <main+0x37>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x178,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
mov    0x2e5a(%rip),%rbx
mov    (%rbx),%edi
call   1050 <feof@plt>
test   %eax,%eax
je     11aa <main+0x5a>
xor    %eax,%eax
add    $0x178,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0x70(%rsp),%r12
mov    %rsp,%r14
lea    0xe47(%rip),%r15
jmp    11e0 <main+0x90>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
call   1060 <caparse@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1050 <feof@plt>
test   %eax,%eax
jne    1199 <main+0x49>
mov    (%rbx),%edx
mov    %r12,%rdi
mov    $0xff,%esi
call   1040 <fgets@plt>
movsbl 0x70(%rsp),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     11c0 <main+0x70>
cmpb   $0x3d,0x71(%rsp)
jne    11c0 <main+0x70>
movsbl 0x72(%rsp),%eax
add    $0xffffffd0,%eax
movsbq 0x70(%rsp),%rcx
mov    %eax,-0x184(%rsp,%rcx,4)
jmp    11d5 <main+0x85>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [26 x i32]
%7 = alloca [255 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [26 x i32]* %6 to i8*
%9 = load i32, i32* %4
store i32 %9, i32* %4
%10 = load i8**, i8*** %5
store i8** %10, i8*** %5
br label %11
11: ; preds = %46, %2
%12 = load i32, i32* @stdin
%13 = call i32 @feof(i32 %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %47
16: ; preds = %11
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %17, i32 255, i32 %18)
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i64 @isalpha(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %41
25: ; preds = %16
%26 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 61
br i1 %29, label %30, label %41
30: ; preds = %25
%31 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = sub nsw i32 %33, 48
%35 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 97
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 %39
store i32 %34, i32* %40
br label %46
41: ; preds = %25, %16
%42 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [26 x i32], [26 x i32]* %6, i64 0, i64 0
%44 = call i32 @caparse(i8* %42, i32* %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %41, %30
br label %11
47: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [26 x i32]
%4 = alloca [255 x i8]
%5 = bitcast [26 x i32]* %3 to i8*
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @feof(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %39
10: ; preds = %2
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 1
%12 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 2
br label %14
14: ; preds = %10, %35
%15 = load i32, i32* @stdin
%16 = call i32 @fgets(i8* %6, i32 255, i32 %15)
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = call i64 @isalpha(i32 %18)
%20 = icmp ne i64 %19, 0
%21 = load i8, i8* %11
%22 = icmp eq i8 %21, 61
%23 = select i1 %20, i1 %22, i1 false
br i1 %23, label %24, label %32
24: ; preds = %14
%25 = load i8, i8* %13
%26 = sext i8 %25 to i32
%27 = add nsw i32 %26, -48
%28 = load i8, i8* %6
%29 = sext i8 %28 to i64
%30 = add nsw i64 %29, -97
%31 = getelementptr inbounds [26 x i32], [26 x i32]* %3, i64 0, i64 %30
store i32 %27, i32* %31
br label %35
32: ; preds = %14
%33 = call i32 @caparse(i8* %6, i32* %12)
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %24
%36 = load i32, i32* @stdin
%37 = call i32 @feof(i32 %36)
%38 = icmp eq i32 %37, 0
br i1 %38, label %14, label %39
39: ; preds = %35, %2
ret i32 0
}