#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 */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
char ConverterDNAComplement(char);
char ConverterRNA(char);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(int argc, char *argv[]) {
  int i;
  char OriginalDNAStrand[1000];
  char line[255];
  int isint;
  int NucleotideNumber;
  char c;
  printf("Input DNA Strand: ");
  scanf("%s", OriginalDNAStrand);
  while (1) {
    fgets(line, sizeof(line), stdin);
    NucleotideNumber = strlen(OriginalDNAStrand);
    char *RNAStrand = (char *)malloc(NucleotideNumber * sizeof(char));
    if (OriginalDNAStrand[0] == 'Q' || OriginalDNAStrand[0] == 'q') {
      return 1;
    }
    for (i = 0; i < NucleotideNumber; i++) {
      RNAStrand[i] = ConverterRNA(OriginalDNAStrand[i]);
      if (RNAStrand[i] == 0) {
        printf("Enter proper DNA code.\n");
        return 1;
      }
    }
    printf("Original DNA Strand: %s\n", OriginalDNAStrand);
    printf("Complementary RNA Strand: %s\n", RNAStrand);
    char *NewDNAStrand = (char *)malloc(NucleotideNumber * sizeof(char));
    for (i = 0; i < NucleotideNumber; i++) {
      NewDNAStrand[i] = ConverterDNAComplement(OriginalDNAStrand[i]);
    }
    printf("Complementary DNA Strand: %s\n", NewDNAStrand);
    printf("Number of Nucleotides Analyzed: %d\n\n", NucleotideNumber);
    printf("Input DNA Strand: ");
    scanf("%s", OriginalDNAStrand);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x520,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x400(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x500(%rbp),%rdi
mov    0x2e30(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1070 <fgets@plt>
lea    -0x400(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x508(%rbp)
movslq -0x508(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x518(%rbp)
movsbl -0x400(%rbp),%eax
cmp    $0x51,%eax
je     120f <main+0x9f>
movsbl -0x400(%rbp),%eax
cmp    $0x71,%eax
jne    121b <main+0xab>
movl   $0x1,-0x4(%rbp)
jmp    136e <main+0x1fe>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x508(%rbp),%eax
jge    1297 <main+0x127>
movslq -0x14(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%edi
ff
call   1030 <ConverterRNA@plt>
mov    %al,%dl
mov    -0x518(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x518(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1284 <main+0x114>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    136e <main+0x1fe>
jmp    1289 <main+0x119>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1222 <main+0xb2>
lea    -0x400(%rbp),%rsi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x518(%rbp),%rsi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x508(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x520(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x508(%rbp),%eax
jge    131f <main+0x1af>
movslq -0x14(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%edi
ff
call   1060 <ConverterDNAComplement@plt>
mov    %al,%dl
mov    -0x520(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12e1 <main+0x171>
mov    -0x520(%rbp),%rsi
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x508(%rbp),%esi
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x400(%rbp),%rsi
lea    0xcaf(%rip),%rdi
call   1090 <scanf@plt>
jmp    11aa <main+0x3a>
mov    -0x4(%rbp),%eax
add    $0x520,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e8,%rsp
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    0x100(%rsp),%rbx
mov    %rbx,%rsi
call   10a0 <scanf@plt>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0xff,%esi
call   1080 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    0x100(%rsp),%al
mov    %eax,%ecx
and    $0xdf,%cl
cmp    $0x51,%cl
je     1337 <main+0x1b7>
lea    0x100(%rsp),%r14
mov    %r12d,%r15d
test   %r12d,%r12d
jle    1250 <main+0xd0>
movsbl %al,%edi
call   1040 <ConverterRNA@plt>
mov    %al,0x0(%r13)
test   %al,%al
je     132b <main+0x1ab>
mov    $0x1,%ebp
nop
cmp    %rbp,%r15
je     1250 <main+0xd0>
movsbl 0x100(%rsp,%rbp,1),%edi
call   1040 <ConverterRNA@plt>
mov    %al,0x0(%r13,%rbp,1)
add    $0x1,%rbp
test   %al,%al
jne    1220 <main+0xa0>
jmp    132b <main+0x1ab>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xdbf(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdc7(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12d,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
test   %r12d,%r12d
jle    12aa <main+0x12a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x100(%rsp,%rbx,1),%edi
call   1070 <ConverterDNAComplement@plt>
mov    %al,0x0(%rbp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1290 <main+0x110>
lea    0xd9c(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xda9(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd2d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd32(%rip),%rdi
mov    %r14,%rsi
call   10a0 <scanf@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0xff,%esi
call   1080 <fgets@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    0x100(%rsp),%al
mov    %eax,%ecx
and    $0xdf,%cl
cmp    $0x51,%cl
jne    11fe <main+0x7e>
jmp    1337 <main+0x1b7>
lea    0xd5e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x4e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Input DNA Strand: \00"
@.str.1 = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.2 = [24 x i8] c"Enter proper DNA code.\0A\00"
@.str.3 = [25 x i8] c"Original DNA Strand: %s\0A\00"
@.str.4 = [30 x i8] c"Complementary RNA Strand: %s\0A\00"
@.str.5 = [30 x i8] c"Complementary DNA Strand: %s\0A\00"
@.str.6 = [37 x i8] c"Number of Nucleotides Analyzed: %d\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1000 x i8]
%8 = alloca [255 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %2, %95
%18 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %18, i32 255, i32 %19)
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 1
%26 = trunc i64 %25 to i32
%27 = call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %12
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 81
br i1 %32, label %38, label %33
33: ; preds = %17
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 113
br i1 %37, label %38, label %39
38: ; preds = %33, %17
store i32 1, i32* %3
br label %103
39: ; preds = %33
store i32 0, i32* %6
br label %40
40: ; preds = %64, %39
%41 = load i32, i32* %6
%42 = load i32, i32* %10
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %67
44: ; preds = %40
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = call signext i8 @ConverterRNA(i8 signext %48)
%50 = load i8*, i8** %12
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
store i8 %49, i8* %53
%54 = load i8*, i8** %12
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %44
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %103
63: ; preds = %44
br label %64
64: ; preds = %63
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %40
67: ; preds = %40
%68 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %68)
%70 = load i8*, i8** %12
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %70)
%72 = load i32, i32* %10
%73 = sext i32 %72 to i64
%74 = mul i64 %73, 1
%75 = trunc i64 %74 to i32
%76 = call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i8*
store i8* %77, i8** %13
store i32 0, i32* %6
br label %78
78: ; preds = %92, %67
%79 = load i32, i32* %6
%80 = load i32, i32* %10
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %95
82: ; preds = %78
%83 = load i32, i32* %6
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = call signext i8 @ConverterDNAComplement(i8 signext %86)
%88 = load i8*, i8** %13
%89 = load i32, i32* %6
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
store i8 %87, i8* %91
br label %92
92: ; preds = %82
%93 = load i32, i32* %6
%94 = add nsw i32 %93, 1
store i32 %94, i32* %6
br label %78
95: ; preds = %78
%96 = load i8*, i8** %13
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %96)
%98 = load i32, i32* %10
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %98)
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%101 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%102 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %101)
br label %17
103: ; preds = %61, %38
%104 = load i32, i32* %3
ret i32 %104
}

LLVM IR (-O2):
@.str = [19 x i8] c"Input DNA Strand: \00"
@.str.1 = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.3 = [25 x i8] c"Original DNA Strand: %s\0A\00"
@.str.4 = [30 x i8] c"Complementary RNA Strand: %s\0A\00"
@.str.5 = [30 x i8] c"Complementary DNA Strand: %s\0A\00"
@.str.6 = [37 x i8] c"Number of Nucleotides Analyzed: %d\0A\0A\00"
@str = [23 x i8] c"Enter proper DNA code.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i8]
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %6, i32 255, i32 %9)
%11 = call i32 @strlen(i8* %5)
%12 = call i64 @malloc(i32 %11)
%13 = load i8, i8* %5
%14 = and i8 %13, -33
%15 = icmp eq i8 %14, 81
br i1 %15, label %65, label %16
16: ; preds = %2, %53
%17 = phi i8 [ %62, %53 ], [ %13, %2 ]
%18 = phi i64 [ %61, %53 ], [ %12, %2 ]
%19 = phi i32 [ %60, %53 ], [ %11, %2 ]
%20 = inttoptr i64 %18 to i8*
%21 = icmp sgt i32 %19, 0
br i1 %21, label %22, label %38
22: ; preds = %16
%23 = zext i32 %19 to i64
%24 = call signext i8 @ConverterRNA(i8 signext %17)
store i8 %24, i8* %20
%25 = icmp eq i8 %24, 0
br i1 %25, label %36, label %26
26: ; preds = %22, %29
%27 = phi i64 [ %35, %29 ], [ 1, %22 ]
%28 = icmp eq i64 %27, %23
br i1 %28, label %38, label %29
29: ; preds = %26
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %27
%31 = load i8, i8* %30
%32 = call signext i8 @ConverterRNA(i8 signext %31)
%33 = getelementptr inbounds i8, i8* %20, i64 %27
store i8 %32, i8* %33
%34 = icmp eq i8 %32, 0
%35 = add nuw nsw i64 %27, 1
br i1 %34, label %36, label %26
36: ; preds = %22, %29
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %65
38: ; preds = %26, %16
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%41 = call i64 @malloc(i32 %19)
%42 = inttoptr i64 %41 to i8*
br i1 %21, label %43, label %53
43: ; preds = %38
%44 = zext i32 %19 to i64
br label %45
45: ; preds = %43, %45
%46 = phi i64 [ 0, %43 ], [ %51, %45 ]
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = call signext i8 @ConverterDNAComplement(i8 signext %48)
%50 = getelementptr inbounds i8, i8* %42, i64 %46
store i8 %49, i8* %50
%51 = add nuw nsw i64 %46, 1
%52 = icmp eq i64 %51, %44
br i1 %52, label %53, label %45
53: ; preds = %45, %38
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %19)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%57 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%58 = load i32, i32* @stdin
%59 = call i32 @fgets(i8* %6, i32 255, i32 %58)
%60 = call i32 @strlen(i8* %5)
%61 = call i64 @malloc(i32 %60)
%62 = load i8, i8* %5
%63 = and i8 %62, -33
%64 = icmp eq i8 %63, 81
br i1 %64, label %65, label %16
65: ; preds = %53, %2, %36
ret i32 1
}