#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 Base2int(int /*<<< orphan*/);
int /*<<< orphan*/ toupper(char);
int convertSeq(char seqchar[], int seqnum[], int seqlength) {
  int i;
  for (i = 0; i < seqlength; i++)
    seqnum[i] = Base2int(toupper(seqchar[i]));
  seqnum[i] = -1;
  return -1;
}


x86 assembly (clang, -O0):
<convertSeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1179 <convertSeq+0x59>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %eax,%edi
call   1040 <Base2int@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <convertSeq+0x1a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertSeq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edx,%edx
jle    1160 <convertSeq+0x40>
mov    %rdi,%r12
mov    %edx,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r12,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %eax,%edi
call   1040 <Base2int@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <convertSeq+0x20>
jmp    1163 <convertSeq+0x43>
xor    %r15d,%r15d
movl   $0xffffffff,(%r14,%r15,4)
ff
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @convertSeq(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @toupper(i8 signext %17)
%19 = call i32 @Base2int(i32 %18)
%20 = load i32*, i32** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
%28 = load i32*, i32** %5
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 -1, i32* %31
ret i32 -1
}

LLVM IR (-O2):
define i32 @convertSeq(i8* nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %14, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @toupper(i8 signext %10)
%12 = tail call i32 @Base2int(i32 %11)
%13 = getelementptr inbounds i32, i32* %1, i64 %8
store i32 %12, i32* %13
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %16, label %7
16: ; preds = %7
%17 = zext i32 %2 to i64
br label %18
18: ; preds = %3, %16
%19 = phi i64 [ %17, %16 ], [ 0, %3 ]
%20 = getelementptr inbounds i32, i32* %1, i64 %19
store i32 -1, i32* %20
ret i32 -1
}