#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_infile();
int /*<<< orphan*/ close_outfile();
int /*<<< orphan*/ open_infile();
int /*<<< orphan*/ open_outfile();
char read_infile();
int /*<<< orphan*/ write_outfile(char);
void filein_fileout_protein() {
  char in[3] = {'\0', '\0', '\0'};
  int cont = 1;
  open_infile();
  open_outfile();
  while (cont == 1) {
    in[0] = read_infile();
    in[1] = read_infile();
    in[2] = read_infile();
    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_infile();
  close_outfile();
}


x86 assembly (clang, -O0):
<filein_fileout_protein>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1060 <memset@plt>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   10a0 <open_infile@plt>
mov    $0x0,%al
call   1090 <open_outfile@plt>
cmpl   $0x1,-0x8(%rbp)
jne    121c <filein_fileout_protein+0x9c>
mov    $0x0,%al
call   1050 <read_infile@plt>
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1050 <read_infile@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1050 <read_infile@plt>
mov    %al,-0x1(%rbp)
mov    -0x3(%rbp),%cl
mov    -0x2(%rbp),%al
movsbl %cl,%edi
movsbl %al,%esi
movsbl -0x1(%rbp),%edx
call   1070 <bioseq_dna_codon_protein@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1040 <write_outfile@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x3f,%eax
je     1210 <filein_fileout_protein+0x90>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1217 <filein_fileout_protein+0x97>
movl   $0x0,-0x8(%rbp)
jmp    11ad <filein_fileout_protein+0x2d>
mov    $0xa,%edi
call   1040 <write_outfile@plt>
mov    $0x0,%al
call   1030 <close_infile@plt>
mov    $0x0,%al
call   1080 <close_outfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filein_fileout_protein>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1090 <open_infile@plt>
xor    %eax,%eax
call   1080 <open_outfile@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <read_infile@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <read_infile@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <read_infile@plt>
movsbl %bpl,%edi
movsbl %bl,%esi
movsbl %al,%edx
call   1060 <bioseq_dna_codon_protein@plt>
mov    %eax,%ebx
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <write_outfile@plt>
cmp    $0x3f,%bpl
je     11ce <filein_fileout_protein+0x5e>
test   %bl,%bl
jne    1190 <filein_fileout_protein+0x20>
mov    $0xa,%edi
call   1040 <write_outfile@plt>
xor    %eax,%eax
call   1030 <close_infile@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <close_outfile@plt>

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

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