#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 */
char bioseq_dna_codon_protein(char, char, char);
int /*<<< orphan*/ close_outfile();
int /*<<< orphan*/ open_outfile();
char read_stdin();
int /*<<< orphan*/ write_outfile(char);
void stdin_fileout_protein() {
  char in[3] = {'\0', '\0', '\0'};
  int cont = 1;
  open_outfile();
  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]);
    write_outfile(out);
    if (out == '?' || out == '\0')
      cont = 0;
  }
  write_outfile('\n');
  close_outfile();
}


x86 assembly (clang, -O0):
<stdin_fileout_protein>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1080 <open_outfile@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11f5 <stdin_fileout_protein+0x95>
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   1050 <bioseq_dna_codon_protein@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <write_outfile@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x3f,%eax
je     11e9 <stdin_fileout_protein+0x89>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    11f0 <stdin_fileout_protein+0x90>
movl   $0x0,-0x8(%rbp)
jmp    1186 <stdin_fileout_protein+0x26>
mov    $0xa,%edi
call   1030 <write_outfile@plt>
mov    $0x0,%al
call   1060 <close_outfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_fileout_protein>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <open_outfile@plt>
nopw   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   1040 <bioseq_dna_codon_protein@plt>
mov    %eax,%ebx
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <write_outfile@plt>
cmp    $0x3f,%bpl
je     119e <stdin_fileout_protein+0x4e>
test   %bl,%bl
jne    1160 <stdin_fileout_protein+0x10>
mov    $0xa,%edi
call   1030 <write_outfile@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <close_outfile@plt>

LLVM IR (-O0):
define void @stdin_fileout_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
%5 = call i32 (...) @open_outfile()
br label %6
6: ; preds = %33, %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = call signext i8 (...) @read_stdin()
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 %10, i8* %11
%12 = call signext i8 (...) @read_stdin()
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 %12, i8* %13
%14 = call signext i8 (...) @read_stdin()
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%17 = load i8, i8* %16
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%19 = load i8, i8* %18
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%21 = load i8, i8* %20
%22 = call signext i8 @bioseq_dna_codon_protein(i8 signext %17, i8 signext %19, i8 signext %21)
store i8 %22, i8* %3
%23 = load i8, i8* %3
%24 = call i32 @write_outfile(i8 signext %23)
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 63
br i1 %27, label %32, label %28
28: ; preds = %9
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28, %9
store i32 0, i32* %2
br label %33
33: ; preds = %32, %28
br label %6
34: ; preds = %6
%35 = call i32 @write_outfile(i8 signext 10)
%36 = call i32 (...) @close_outfile()
ret void
}

LLVM IR (-O2):
define void @stdin_fileout_protein() {
%1 = tail call i32 (...) @open_outfile()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @read_stdin()
%4 = tail call signext i8 (...) @read_stdin()
%5 = tail call signext i8 (...) @read_stdin()
%6 = tail call signext i8 @bioseq_dna_codon_protein(i8 signext %3, i8 signext %4, i8 signext %5)
%7 = tail call i32 @write_outfile(i8 signext %6)
switch i8 %6, label %2 [
i8 63, label %8
i8 0, label %8
]
8: ; preds = %2, %2
%9 = tail call i32 @write_outfile(i8 signext 10)
%10 = tail call i32 (...) @close_outfile()
ret void
}