#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*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *rna_to_protein(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ trim_r(char *);
int main() {
  char buffer[10001];
  char *prot;
  assert(fgets(buffer, 10001, stdin));
  trim_r(buffer);
  prot = rna_to_protein(buffer);
  if (!prot)
    return 1;
  printf("%s\n", prot);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
mov    0x2e78(%rip),%rax
mov    (%rax),%edx
mov    $0x2711,%esi
call   1050 <fgets@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    -0x2720(%rbp),%rdi
call   1030 <trim_r@plt>
lea    -0x2720(%rbp),%rdi
call   1070 <rna_to_protein@plt>
mov    %rax,-0x2728(%rbp)
cmpq   $0x0,-0x2728(%rbp)
jne    11bc <main+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    11d6 <main+0x86>
mov    -0x2728(%rbp),%rsi
lea    0xe36(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2720,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2711,%esi
call   1050 <fgets@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1030 <trim_r@plt>
mov    %rbx,%rdi
call   1070 <rna_to_protein@plt>
test   %rax,%rax
je     11a0 <main+0x50>
lea    0xe6c(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    11a5 <main+0x55>
mov    $0x1,%eax
add    $0x2720,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10001 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 10001, i32 %5)
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 0
%9 = call i32 @trim_r(i8* %8)
%10 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 0
%11 = call i8* @rna_to_protein(i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %0
store i32 1, i32* %1
br label %18
15: ; preds = %0
%16 = load i8*, i8** %3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 0, i32* %1
br label %18
18: ; preds = %15, %14
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10001 x i8]
%2 = getelementptr inbounds [10001 x i8], [10001 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10001, i32 %3)
%5 = call i32 @assert(i32 %4)
%6 = call i32 @trim_r(i8* %2)
%7 = call i8* @rna_to_protein(i8* %2)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %11
11: ; preds = %0, %9
%12 = phi i32 [ 0, %9 ], [ 1, %0 ]
ret i32 %12
}