#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 toupper(char);
void convert_to_numerical(char *sLine, long lLen, int **ipSeq) {
  long j = 0;
  for (j = 0; j < lLen; j++) {
    switch (toupper(sLine[j])) {
    case 'A':
      **ipSeq = 0;
      break;
    case 'C':
      **ipSeq = 1;
      break;
    case 'G':
      **ipSeq = 2;
      break;
    case 'T':
      **ipSeq = 3;
      break;
    default:
      **ipSeq = -1;
      break;
    }
    *ipSeq += 1;
  }
  *ipSeq -= lLen;
  return;
}


x86 assembly (clang, -O0):
<convert_to_numerical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11ed <convert_to_numerical+0xdd>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x13,%eax
ja     11c1 <convert_to_numerical+0xb1>
mov    -0x28(%rbp),%rax
lea    0xe90(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
jmp    11ce <convert_to_numerical+0xbe>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
jmp    11ce <convert_to_numerical+0xbe>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x2,(%rax)
jmp    11ce <convert_to_numerical+0xbe>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x3,(%rax)
jmp    11ce <convert_to_numerical+0xbe>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <convert_to_numerical+0x24>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
xor    %edx,%edx
sub    %rsi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_numerical>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
test   %rsi,%rsi
jle    11bc <convert_to_numerical+0xac>
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecc(%rip),%r13
jmp    1161 <convert_to_numerical+0x51>
cs nopw 0x0(%rax,%rax,1)
mov    (%r12),%rax
movl   $0xffffffff,(%rax)
nopw   0x0(%rax,%rax,1)
add    $0x4,%rax
mov    %rax,(%r12)
add    $0x1,%rbx
cmp    %rbx,%r14
je     11c0 <convert_to_numerical+0xb0>
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
cmp    $0x13,%eax
ja     1140 <convert_to_numerical+0x30>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    (%r12),%rax
movl   $0x0,(%rax)
jmp    1150 <convert_to_numerical+0x40>
nopl   0x0(%rax)
mov    (%r12),%rax
movl   $0x1,(%rax)
jmp    1150 <convert_to_numerical+0x40>
nopl   0x0(%rax)
mov    (%r12),%rax
movl   $0x2,(%rax)
jmp    1150 <convert_to_numerical+0x40>
nopl   0x0(%rax)
mov    (%r12),%rax
movl   $0x3,(%rax)
jmp    1150 <convert_to_numerical+0x40>
mov    (%r12),%rax
shl    $0x2,%r14
sub    %r14,%rax
mov    %rax,(%r12)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @convert_to_numerical(i8* %0, i64 %1, i32** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32**
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32** %2, i32*** %6
store i64 0, i64* %7
store i64 0, i64* %7
br label %8
8: ; preds = %37, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %40
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i64, i64* %7
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @toupper(i8 signext %16)
switch i32 %17, label %30 [
i32 65, label %18
i32 67, label %21
i32 71, label %24
i32 84, label %27
]
18: ; preds = %12
%19 = load i32**, i32*** %6
%20 = load i32*, i32** %19
store i32 0, i32* %20
br label %33
21: ; preds = %12
%22 = load i32**, i32*** %6
%23 = load i32*, i32** %22
store i32 1, i32* %23
br label %33
24: ; preds = %12
%25 = load i32**, i32*** %6
%26 = load i32*, i32** %25
store i32 2, i32* %26
br label %33
27: ; preds = %12
%28 = load i32**, i32*** %6
%29 = load i32*, i32** %28
store i32 3, i32* %29
br label %33
30: ; preds = %12
%31 = load i32**, i32*** %6
%32 = load i32*, i32** %31
store i32 -1, i32* %32
br label %33
33: ; preds = %30, %27, %24, %21, %18
%34 = load i32**, i32*** %6
%35 = load i32*, i32** %34
%36 = getelementptr inbounds i32, i32* %35, i64 1
store i32* %36, i32** %34
br label %37
37: ; preds = %33
%38 = load i64, i64* %7
%39 = add nsw i64 %38, 1
store i64 %39, i64* %7
br label %8
40: ; preds = %8
%41 = load i64, i64* %5
%42 = load i32**, i32*** %6
%43 = load i32*, i32** %42
%44 = sub i64 0, %41
%45 = getelementptr inbounds i32, i32* %43, i64 %44
store i32* %45, i32** %42
ret void
}

LLVM IR (-O2):
define void @convert_to_numerical(i8* nocapture %0, i64 %1, i32** nocapture %2) {
%4 = icmp sgt i64 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = load i32*, i32** %2
br label %29
7: ; preds = %3, %22
%8 = phi i64 [ %25, %22 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @toupper(i8 signext %10)
switch i32 %11, label %20 [
i32 65, label %12
i32 67, label %14
i32 71, label %16
i32 84, label %18
]
12: ; preds = %7
%13 = load i32*, i32** %2
store i32 0, i32* %13
br label %22
14: ; preds = %7
%15 = load i32*, i32** %2
store i32 1, i32* %15
br label %22
16: ; preds = %7
%17 = load i32*, i32** %2
store i32 2, i32* %17
br label %22
18: ; preds = %7
%19 = load i32*, i32** %2
store i32 3, i32* %19
br label %22
20: ; preds = %7
%21 = load i32*, i32** %2
store i32 -1, i32* %21
br label %22
22: ; preds = %20, %18, %16, %14, %12
%23 = phi i32* [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ]
%24 = getelementptr inbounds i32, i32* %23, i64 1
store i32* %24, i32** %2
%25 = add nuw nsw i64 %8, 1
%26 = icmp eq i64 %25, %1
br i1 %26, label %27, label %7
27: ; preds = %22
%28 = getelementptr inbounds i32, i32* %23, i64 1
br label %29
29: ; preds = %27, %5
%30 = phi i32* [ %6, %5 ], [ %28, %27 ]
%31 = sub i64 0, %1
%32 = getelementptr inbounds i32, i32* %30, i64 %31
store i32* %32, i32** %2
ret void
}