#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__ EOF;
char bioseq_dna_codon_protein(char, char, char);
int /*<<< orphan*/ exit(int);
scalar_t__ putchar(char);
int /*<<< orphan*/ puts(char *);
char read_stdin();
void stdin_stdout_protein() {
  char in[3] = {'\0', '\0', '\0'};
  int cont = 1;
  while (cont == 1) {
    in[0] = read_stdin();
    in[1] = read_stdin();
    in[2] = read_stdin();
    char out = bioseq_dna_codon_protein(in[0], in[1], in[2]);
    if (putchar(out) == EOF) {
      puts("Error: cannot write to stdout.");
      exit(1);
    }
    if (out == '?' || out == '\0')
      cont = 0;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<stdin_stdout_protein>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1050 <memset@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1214 <stdin_stdout_protein+0xb4>
mov    $0x0,%al
call   1070 <read_stdin@plt>
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1070 <read_stdin@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1070 <read_stdin@plt>
mov    %al,-0x1(%rbp)
mov    -0x3(%rbp),%cl
mov    -0x2(%rbp),%al
movsbl %cl,%edi
movsbl %al,%esi
movsbl -0x1(%rbp),%edx
call   1060 <bioseq_dna_codon_protein@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2e19(%rip),%rcx
cmp    (%rcx),%rax
jne    11ee <stdin_stdout_protein+0x8e>
lea    0xe21(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x3f,%eax
je     1208 <stdin_stdout_protein+0xa8>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    120f <stdin_stdout_protein+0xaf>
movl   $0x0,-0x8(%rbp)
jmp    117f <stdin_stdout_protein+0x1f>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_stdout_protein>:
push   %rbp
push   %r14
push   %rbx
mov    0x2e8d(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <read_stdin@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <read_stdin@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <read_stdin@plt>
movsbl %bpl,%edi
movsbl %bl,%esi
movsbl %al,%edx
call   1050 <bioseq_dna_codon_protein@plt>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    (%r14),%rax
je     11ae <stdin_stdout_protein+0x5e>
cmp    $0x3f,%bl
je     11a0 <stdin_stdout_protein+0x50>
test   %bl,%bl
jne    1160 <stdin_stdout_protein+0x10>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xe4b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [31 x i8] c"Error: cannot write to stdout.\00"
define void @stdin_stdout_protein() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = alloca i8
%4 = bitcast [3 x i8]* %1 to i8*
store i32 1, i32* %2
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %39
8: ; preds = %5
%9 = call signext i8 (...) @read_stdin()
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 %9, i8* %10
%11 = call signext i8 (...) @read_stdin()
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 %11, i8* %12
%13 = call signext i8 (...) @read_stdin()
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 %13, i8* %14
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%16 = load i8, i8* %15
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%18 = load i8, i8* %17
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%20 = load i8, i8* %19
%21 = call signext i8 @bioseq_dna_codon_protein(i8 signext %16, i8 signext %18, i8 signext %20)
store i8 %21, i8* %3
%22 = load i8, i8* %3
%23 = call i64 @putchar(i8 signext %22)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %8
%27 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %8
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 63
br i1 %32, label %37, label %33
33: ; preds = %29
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33, %29
store i32 0, i32* %2
br label %38
38: ; preds = %37, %33
br label %5
39: ; preds = %5
%40 = call i64 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [31 x i8] c"Error: cannot write to stdout.\00"
define void @stdin_stdout_protein() {
br label %1
1: ; preds = %12, %0
%2 = tail call signext i8 (...) @read_stdin()
%3 = tail call signext i8 (...) @read_stdin()
%4 = tail call signext i8 (...) @read_stdin()
%5 = tail call signext i8 @bioseq_dna_codon_protein(i8 signext %2, i8 signext %3, i8 signext %4)
%6 = tail call i64 @putchar(i8 signext %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %1
switch i8 %5, label %1 [
i8 63, label %13
i8 0, label %13
]
13: ; preds = %12, %12
%14 = tail call i64 @putchar(i8 signext 10)
ret void
}