#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*/ decode(char *, int /*<<< orphan*/);
int /*<<< orphan*/ encode(char *, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char x, msg[101];
  scanf("%c %s", &x, msg);
  if (x == 'E') {
    encode(msg, strlen(msg));
  } else {
    decode(msg, strlen(msg));
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdx
lea    0xe93(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1070 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
jne    11a4 <main+0x54>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%esi
call   1040 <encode@plt>
jmp    11c0 <main+0x70>
lea    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%esi
call   1060 <decode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xea2(%rip),%rdi
lea    0xf(%rsp),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdx
call   1070 <scanf@plt>
mov    0xf(%rsp),%bl
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x10(%rsp),%rdi
mov    %eax,%esi
cmp    $0x45,%bl
jne    118f <main+0x3f>
call   1040 <encode@plt>
jmp    1194 <main+0x44>
call   1060 <decode@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [101 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 69
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @encode(i8* %10, i32 %12)
br label %19
14: ; preds = %0
%15 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = call i32 @decode(i8* %15, i32 %17)
br label %19
19: ; preds = %14, %9
%20 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c %s\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 69
%7 = call i32 @strlen(i8* %3)
br i1 %6, label %8, label %10
8: ; preds = %0
%9 = call i32 @encode(i8* %3, i32 %7)
br label %12
10: ; preds = %0
%11 = call i32 @decode(i8* %3, i32 %7)
br label %12
12: ; preds = %10, %8
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}