#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*/ STDIN_FILENO;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ putchar(char);
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main() {
  char buffer[1000];
  char *c;
  while (read(STDIN_FILENO, buffer, 1000) > 0) {
    c = buffer;
    while (*c && *c != '\n') {
      switch (*c) {
      case 'A':
        putchar('A');
        break;
      case 'C':
        putchar('C');
        break;
      case 'G':
        putchar('G');
        break;
      case 'T':
        putchar('U');
        break;
      default:
        fprintf(stderr, "invalid char %c\n", *c);
        return 1;
      }
      c++;
    }
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rsi
mov    $0x3e8,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jle    1271 <main+0x141>
lea    -0x3f0(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
mov    -0x3f8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3f9(%rbp)
je     11a5 <main+0x75>
mov    -0x3f8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x3f9(%rbp)
mov    -0x3f9(%rbp),%al
test   $0x1,%al
jne    11b8 <main+0x88>
jmp    126c <main+0x13c>
mov    -0x3f8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x408(%rbp)
sub    $0x13,%eax
ja     122a <main+0xfa>
mov    -0x408(%rbp),%rax
lea    0xe1b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x41,%edi
call   1030 <putchar@plt>
jmp    1255 <main+0x125>
mov    $0x43,%edi
call   1030 <putchar@plt>
jmp    1255 <main+0x125>
mov    $0x47,%edi
call   1030 <putchar@plt>
jmp    1255 <main+0x125>
mov    $0x55,%edi
call   1030 <putchar@plt>
jmp    1255 <main+0x125>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    -0x3f8(%rbp),%rax
lea    0xe0f(%rip),%rsi
movsbl (%rax),%edx
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1282 <main+0x152>
mov    -0x3f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x3f8(%rbp)
jmp    1174 <main+0x44>
jmp    1142 <main+0x12>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    0x2e93(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%r12
mov    %r12,%rsi
mov    $0x3e8,%edx
call   1040 <read@plt>
test   %rax,%rax
jle    11bf <main+0x8f>
lea    0xe9c(%rip),%r15
mov    %r12,%rbx
jmp    1188 <main+0x58>
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %r12,%rsi
mov    $0x3e8,%edx
call   1040 <read@plt>
mov    %r12,%rbx
test   %rax,%rax
jle    11bf <main+0x8f>
movsbl (%rbx),%edx
test   %edx,%edx
je     1170 <main+0x40>
cmp    $0xa,%dl
je     1170 <main+0x40>
lea    -0x41(%rdx),%ecx
cmp    $0x13,%ecx
ja     11da <main+0xaa>
mov    $0x41,%al
movslq (%r15,%rcx,4),%rcx
add    %r15,%rcx
jmp    *%rcx
mov    $0x43,%al
jmp    11b1 <main+0x81>
mov    $0x47,%al
jmp    11b1 <main+0x81>
mov    $0x55,%al
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
jmp    1188 <main+0x58>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
lea    0xe66(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    11cb <main+0x9b>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"invalid char %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i8*
store i32 0, i32* %1
br label %4
4: ; preds = %43, %0
%5 = load i32, i32* @STDIN_FILENO
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i64 @read(i32 %5, i8* %6, i32 1000)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %44
9: ; preds = %4
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
store i8* %10, i8** %3
br label %11
11: ; preds = %40, %9
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ false, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %43
23: ; preds = %21
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
switch i32 %26, label %35 [
i32 65, label %27
i32 67, label %29
i32 71, label %31
i32 84, label %33
]
27: ; preds = %23
%28 = call i32 @putchar(i8 signext 65)
br label %40
29: ; preds = %23
%30 = call i32 @putchar(i8 signext 67)
br label %40
31: ; preds = %23
%32 = call i32 @putchar(i8 signext 71)
br label %40
33: ; preds = %23
%34 = call i32 @putchar(i8 signext 85)
br label %40
35: ; preds = %23
%36 = load i32, i32* @stderr
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %38)
store i32 1, i32* %1
br label %46
40: ; preds = %33, %31, %29, %27
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %3
br label %11
43: ; preds = %21
br label %4
44: ; preds = %4
%45 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %1
br label %46
46: ; preds = %44, %35
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@stderr = global i32 0
@.str = [17 x i8] c"invalid char %c\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i64 @read(i32 %3, i8* %2, i32 1000)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %27
6: ; preds = %0, %21
%7 = phi i8* [ %22, %21 ], [ %2, %0 ]
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 0, label %23
i8 10, label %23
]
9: ; preds = %6
%10 = sext i8 %8 to i32
switch i32 %10, label %14 [
i32 65, label %17
i32 67, label %11
i32 71, label %12
i32 84, label %13
]
11: ; preds = %9
br label %17
12: ; preds = %9
br label %17
13: ; preds = %9
br label %17
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %8)
br label %29
17: ; preds = %9, %13, %12, %11
%18 = phi i8 [ 85, %13 ], [ 71, %12 ], [ 67, %11 ], [ 65, %9 ]
%19 = tail call i32 @putchar(i8 signext %18)
%20 = getelementptr inbounds i8, i8* %7, i64 1
br label %21
21: ; preds = %17, %23
%22 = phi i8* [ %20, %17 ], [ %2, %23 ]
br label %6
23: ; preds = %6, %6
%24 = load i32, i32* @STDIN_FILENO
%25 = call i64 @read(i32 %24, i8* %2, i32 1000)
%26 = icmp sgt i64 %25, 0
br i1 %26, label %21, label %27
27: ; preds = %23, %0
%28 = tail call i32 @putchar(i8 signext 10)
br label %29
29: ; preds = %27, %14
%30 = phi i32 [ 1, %14 ], [ 0, %27 ]
ret i32 %30
}