#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__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char *s;
  int len;
  s = (char *)malloc(sizeof(char) * 11);
  scanf("%s", s);
  len = strlen(s);
  if (*(s + len - 2) == 'A') {
    if (*(s + 0) == '1' && *(s + 1) == '2') {
      *(s + 0) = '0';
      *(s + 1) = '0';
      *(s + len - 2) = '\0';
      printf("sum=%s", s);
    } else {
      *(s + len - 2) = '\0';
      printf("%s", s);
    }
  } else {
    if (*(s + 0) == '1' && *(s + 1) == '2') {
      *(s + len - 2) = '\0';
      printf("%s", s);
    } else {
      *(s + 0) = 1 + *(s + 0);
      *(s + 1) = 2 + *(s + 1);
      *(s + len - 2) = '\0';
      printf("%s", s);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xb,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl -0x2(%rax,%rcx,1),%eax
cmp    $0x41,%eax
jne    1203 <main+0xc3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    11e1 <main+0xa1>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x32,%eax
jne    11e1 <main+0xa1>
mov    -0x10(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,-0x2(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xe29(%rip),%rdi
call   1040 <printf@plt>
jmp    11fe <main+0xbe>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,-0x2(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
jmp    128e <main+0x14e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    1246 <main+0x106>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x32,%eax
jne    1246 <main+0x106>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,-0x2(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xdc8(%rip),%rdi
call   1040 <printf@plt>
jmp    1289 <main+0x149>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
add    $0x2,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,-0x2(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xd80(%rip),%rdi
call   1040 <printf@plt>
jmp    128e <main+0x14e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xb,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeac(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x41,-0x2(%rbx,%rax,1)
mov    (%rbx),%cl
jne    118f <main+0x4f>
cmp    $0x31,%cl
jne    11a7 <main+0x67>
cmpb   $0x32,0x1(%rbx)
jne    11a7 <main+0x67>
movw   $0x3030,(%rbx)
lea    0xe73(%rip),%r14
jmp    11a7 <main+0x67>
mov    0x1(%rbx),%dl
cmp    $0x31,%cl
jne    119c <main+0x5c>
cmp    $0x32,%dl
je     11a7 <main+0x67>
add    $0x1,%cl
mov    %cl,(%rbx)
add    $0x2,%dl
mov    %dl,0x1(%rbx)
movb   $0x0,-0x2(%rbx,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"sum=%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 11)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 -2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 65
br i1 %17, label %18, label %51
18: ; preds = %0
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 49
br i1 %23, label %24, label %42
24: ; preds = %18
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 50
br i1 %29, label %30, label %42
30: ; preds = %24
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 0
store i8 48, i8* %32
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8 48, i8* %34
%35 = load i8*, i8** %2
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = getelementptr inbounds i8, i8* %38, i64 -2
store i8 0, i8* %39
%40 = load i8*, i8** %2
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %50
42: ; preds = %24, %18
%43 = load i8*, i8** %2
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = getelementptr inbounds i8, i8* %46, i64 -2
store i8 0, i8* %47
%48 = load i8*, i8** %2
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %42, %30
br label %96
51: ; preds = %0
%52 = load i8*, i8** %2
%53 = getelementptr inbounds i8, i8* %52, i64 0
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 49
br i1 %56, label %57, label %71
57: ; preds = %51
%58 = load i8*, i8** %2
%59 = getelementptr inbounds i8, i8* %58, i64 1
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 50
br i1 %62, label %63, label %71
63: ; preds = %57
%64 = load i8*, i8** %2
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = getelementptr inbounds i8, i8* %67, i64 -2
store i8 0, i8* %68
%69 = load i8*, i8** %2
%70 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %69)
br label %95
71: ; preds = %57, %51
%72 = load i8*, i8** %2
%73 = getelementptr inbounds i8, i8* %72, i64 0
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = add nsw i32 1, %75
%77 = trunc i32 %76 to i8
%78 = load i8*, i8** %2
%79 = getelementptr inbounds i8, i8* %78, i64 0
store i8 %77, i8* %79
%80 = load i8*, i8** %2
%81 = getelementptr inbounds i8, i8* %80, i64 1
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = add nsw i32 2, %83
%85 = trunc i32 %84 to i8
%86 = load i8*, i8** %2
%87 = getelementptr inbounds i8, i8* %86, i64 1
store i8 %85, i8* %87
%88 = load i8*, i8** %2
%89 = load i32, i32* %3
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
%92 = getelementptr inbounds i8, i8* %91, i64 -2
store i8 0, i8* %92
%93 = load i8*, i8** %2
%94 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %93)
br label %95
95: ; preds = %71, %63
br label %96
96: ; preds = %95, %50
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"sum=%s\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 11)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @strlen(i8* %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -2
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 65
%10 = load i8, i8* %2
%11 = icmp eq i8 %10, 49
br i1 %9, label %12, label %18
12: ; preds = %0
br i1 %11, label %13, label %27
13: ; preds = %12
%14 = getelementptr inbounds i8, i8* %2, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 50
br i1 %16, label %17, label %27
17: ; preds = %13
store i8 48, i8* %2
store i8 48, i8* %14
br label %27
18: ; preds = %0
%19 = getelementptr inbounds i8, i8* %2, i64 1
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 50
%22 = select i1 %11, i1 %21, i1 false
br i1 %22, label %27, label %23
23: ; preds = %18
%24 = add i8 %10, 1
store i8 %24, i8* %2
%25 = getelementptr inbounds i8, i8* %2, i64 1
%26 = add i8 %20, 2
store i8 %26, i8* %25
br label %27
27: ; preds = %18, %12, %13, %23, %17
%28 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %23 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %12 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %18 ]
store i8 0, i8* %7
%29 = tail call i32 @printf(i8* %28, i8* %2)
ret i32 0
}