#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*/ exit(int);
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
main() {
  int i;
  char s[1000];
  for (;;) {
    if (!scanf("%s", s))
      exit(0);
    if (feof(stdin))
      exit(0);
    for (i = 0;; i += 3) {
      if (!s[i])
        break;
      if (s[i] == '+' || s[i] == '-')
        printf("%c", s[i]);
      else {
        fprintf(stderr, "no +-");
        exit(20);
      }
      printf("%c%c", 'a' + s[i + 1] - '1', '1' + s[i + 2] - '1');
    }
    printf(": +0\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1060 <scanf@plt>
cmp    $0x0,%eax
jne    1185 <main+0x35>
xor    %edi,%edi
call   1070 <exit@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     11a4 <main+0x54>
xor    %edi,%edi
call   1070 <exit@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmpb   $0x0,-0x3f0(%rbp,%rax,1)
jne    11c2 <main+0x72>
jmp    1272 <main+0x122>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x2b,%eax
je     11ec <main+0x9c>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x2d,%eax
jne    120b <main+0xbb>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%esi
ff
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122a <main+0xda>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
lea    0xde8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x14,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%esi
ff
add    $0x61,%esi
sub    $0x31,%esi
mov    -0x8(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%edx
ff
add    $0x31,%edx
sub    $0x31,%edx
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    11ab <main+0x5b>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1162 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
lea    0xe78(%rip),%rdi
mov    %rsp,%rsi
call   1080 <scanf@plt>
test   %eax,%eax
jne    119b <main+0x2b>
xor    %edi,%edi
call   1090 <exit@plt>
mov    0x2e46(%rip),%rbp
lea    0xe60(%rip),%rbx
lea    0xe5e(%rip),%r14
lea    0xe49(%rip),%r15
mov    %rsp,%r12
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
call   1070 <feof@plt>
test   %rax,%rax
jne    1194 <main+0x24>
lea    0x2(%rsp),%r13
jmp    1200 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <putchar@plt>
movsbl -0x1(%r13),%esi
add    $0x30,%esi
movsbl 0x0(%r13),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x3,%r13
movzbl -0x2(%r13),%edi
cmp    $0x2b,%edi
je     11e0 <main+0x70>
cmp    $0x2d,%dil
je     11e0 <main+0x70>
test   %dil,%dil
jne    1231 <main+0xc1>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <scanf@plt>
test   %eax,%eax
jne    11c0 <main+0x50>
jmp    1194 <main+0x24>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
lea    0xdc2(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x14,%edi
call   1090 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
@stderr = global i32 0
@.str.2 = [6 x i8] c"no +-\00"
@.str.3 = [5 x i8] c"%c%c\00"
@str = [5 x i8] c": +0\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %35, %0
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0, %35
%8 = load i32, i32* @stdin
%9 = call i64 @feof(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %7, %17
%14 = phi i64 [ %30, %17 ], [ 0, %7 ]
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
switch i8 %16, label %31 [
i8 0, label %35
i8 43, label %17
i8 45, label %17
]
17: ; preds = %13, %13
%18 = zext i8 %16 to i32
%19 = call i32 @putchar(i32 %18)
%20 = add nuw nsw i64 %14, 1
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 48
%25 = add nuw nsw i64 %14, 2
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %28)
%30 = add nuw i64 %14, 3
br label %13
31: ; preds = %13
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @exit(i32 20)
unreachable
35: ; preds = %13
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%38 = icmp eq i32 %37, 0
br i1 %38, label %5, label %7
}