#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 getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  char base;
  int ntimes[4] = {0};
  base = getchar();
  while (base != '\n') {
    if (base == 'A')
      printf("A");
    if (base == 'C')
      printf("C");
    if (base == 'G')
      printf("G");
    if (base == 'T')
      printf("U");
    base = getchar();
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     11d9 <main+0xa9>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    117f <main+0x4f>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jne    1198 <main+0x68>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x47,%eax
jne    11b1 <main+0x81>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    11ca <main+0x9a>
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1159 <main+0x29>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
jmp    1134 <main+0x14>
mov    $0x55,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x41(%rax),%ecx
cmp    $0x13,%cl
ja     116c <main+0x4c>
mov    $0x41,%edi
movzbl %cl,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
mov    $0x43,%edi
call   1030 <putchar@plt>
jmp    1134 <main+0x14>
mov    $0x47,%edi
call   1030 <putchar@plt>
jmp    1134 <main+0x14>
cmp    $0xa,%al
jne    1134 <main+0x14>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"C\00"
@.str.2 = [2 x i8] c"G\00"
@.str.3 = [2 x i8] c"U\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %3 to i8*
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
br label %6
6: ; preds = %34, %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %36
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 65
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 67
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 71
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 84
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = call signext i8 (...) @getchar()
store i8 %35, i8* %2
br label %6
36: ; preds = %6
%37 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %9, %0
%2 = tail call signext i8 (...) @getchar()
switch i8 %2, label %9 [
i8 10, label %10
i8 65, label %6
i8 67, label %3
i8 71, label %4
i8 84, label %5
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %3, %4
%7 = phi i32 [ 71, %4 ], [ 67, %3 ], [ 85, %5 ], [ 65, %1 ]
%8 = tail call i32 @putchar(i32 %7)
br label %9
9: ; preds = %6, %1
br label %1
10: ; preds = %1
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}