#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
void raiseError(unsigned int iErrorLevel, unsigned int iErrorType,
                char strMessage[]) {
  char strFatalMessage[20][100];
  char strErrorMessage[20][100];
  strcpy(strFatalMessage[0], "Could not Open OPTAB");
  strcpy(strFatalMessage[1], "Could not Open Input Fille");
  strcpy(strFatalMessage[2], "Could not Create/Open Intermediate File");
  strcpy(strFatalMessage[4], "Could not Create/Open Output File");
  strcpy(strFatalMessage[5], "Source File not supplied");
  strcpy(strFatalMessage[6], "Memory Allocation for OPTAB Failed");
  strcpy(strFatalMessage[7], "Memory Allocation for SYMTAB Failed");
  strcpy(strFatalMessage[8], "Output file name missing for -o");
  strcpy(strFatalMessage[9],
         "Cannot do both Bootstrap and Loader Assembly in one shot");
  strcpy(strFatalMessage[10],
         "Bootstrap Creation failed, Expected Bootstrap length Exceeded for");
  strcpy(strFatalMessage[11], "Output Device Missing for -d");
  strcpy(strFatalMessage[12], "Stopping Assembly Due to Error in ");
  strcpy(strErrorMessage[0], "Duplicate LABEL present in Code");
  strcpy(strErrorMessage[1], "Invalid Operation Code (OPCODE) in Code");
  strcpy(strErrorMessage[2], "Undefeind Symbol present in the Code");
  switch (iErrorLevel) {
  case 0:
    fprintf(stderr, "Assembly Error (FATAL) : ");
    switch (iErrorType) {
    case 0:
    case 1:
    case 2:
    case 4:
      fprintf(stderr, "%s \"%s\"\n", strFatalMessage[iErrorType], strMessage);
      break;
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
      fprintf(stderr, "%s\n", strFatalMessage[iErrorType]);
      break;
    case 10:
      fprintf(stderr, "%s \"%s\"\n", strFatalMessage[iErrorType], strMessage);
      break;
    case 11:
      fprintf(stderr, "%s\n", strFatalMessage[iErrorType]);
      break;
    case 12:
      fprintf(stderr, "%s \"%s\"\n", strFatalMessage[iErrorType], strMessage);
      break;
    default:
      break;
    }
    exit(EXIT_FAILURE);
  case 1:
    fprintf(stderr, "Assembly Error (ERROR) : ");
    switch (iErrorType) {
    case 0:
      fprintf(stderr, "%s\n \"%s\" is repeated in the Code\n",
              strErrorMessage[iErrorType], strMessage);
      break;
    case 1:
      fprintf(stderr, "%s\n \"%s\" Does not exist in OPTAB\n",
              strErrorMessage[iErrorType], strMessage);
      break;
    case 2:
      fprintf(stderr, "%s\n \"%s\" Does not exist in SYMTAB\n",
              strErrorMessage[iErrorType], strMessage);
      break;
    default:
      break;
    }
    break;
  case 2:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<raiseError>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xee8(%rip),%rsi
lea    -0x7e0(%rbp),%rdi
call   1030 <strcpy@plt>
lea    -0x77c(%rbp),%rdi
lea    0xee3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x718(%rbp),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x650(%rbp),%rdi
lea    0xf00(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x5ec(%rbp),%rdi
lea    0xf0f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x588(%rbp),%rdi
lea    0xf15(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x524(%rbp),%rdi
lea    0xf25(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x4c0(%rbp),%rdi
lea    0xf36(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x45c(%rbp),%rdi
lea    0xf43(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x3f8(%rbp),%rdi
lea    0xf69(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x394(%rbp),%rdi
lea    0xf98(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x330(%rbp),%rdi
lea    0xfa2(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xfb9(%rip),%rsi
lea    -0xfb0(%rbp),%rdi
call   1030 <strcpy@plt>
lea    -0xf4c(%rbp),%rdi
lea    0xfbf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xee8(%rbp),%rdi
lea    0xfd4(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xfb4(%rbp)
test   %eax,%eax
je     12a0 <raiseError+0x170>
jmp    1278 <raiseError+0x148>
mov    -0xfb4(%rbp),%eax
sub    $0x1,%eax
je     13e2 <raiseError+0x2b2>
jmp    128c <raiseError+0x15c>
mov    -0xfb4(%rbp),%eax
sub    $0x2,%eax
je     14d4 <raiseError+0x3a4>
jmp    14d9 <raiseError+0x3a9>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
lea    0xfa6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0xfc0(%rbp)
sub    $0xc,%rax
ja     13cf <raiseError+0x29f>
mov    -0xfc0(%rbp),%rax
lea    0xd27(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0x7e0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xf69(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13d4 <raiseError+0x2a4>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0x7e0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
lea    0xf45(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13d4 <raiseError+0x2a4>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0x7e0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xf0b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13d4 <raiseError+0x2a4>
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0x7e0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13d4 <raiseError+0x2a4>
mov    0x2c3b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0x7e0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13d4 <raiseError+0x2a4>
jmp    13d4 <raiseError+0x2a4>
mov    0x2bfd(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2bf7(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xfc4(%rbp)
test   %eax,%eax
je     1437 <raiseError+0x307>
jmp    140f <raiseError+0x2df>
mov    -0xfc4(%rbp),%eax
sub    $0x1,%eax
je     1468 <raiseError+0x338>
jmp    1423 <raiseError+0x2f3>
mov    -0xfc4(%rbp),%eax
sub    $0x2,%eax
je     1499 <raiseError+0x369>
jmp    14ca <raiseError+0x39a>
mov    0x2ba2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0xfb0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    14cf <raiseError+0x39f>
mov    0x2b71(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0xfb0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xe2c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    14cf <raiseError+0x39f>
mov    0x2b40(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    -0xfb0(%rbp),%rdx
imul   $0x64,%rax,%rax
add    %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    14cf <raiseError+0x39f>
jmp    14cf <raiseError+0x39f>
jmp    14de <raiseError+0x3ae>
jmp    14de <raiseError+0x3ae>
jmp    14de <raiseError+0x3ae>
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raiseError>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfb8,%rsp
mov    %rdx,0x8(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xee3(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0x74(%rsp),%rdi
lea    0xee2(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xd8(%rsp),%rdi
lea    0xee9(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x1a0(%rsp),%rdi
lea    0xefd(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x204(%rsp),%rdi
lea    0xf0b(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x268(%rsp),%rdi
lea    0xf10(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2cc(%rsp),%rdi
lea    0xf1f(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x330(%rsp),%rdi
lea    0xf2f(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x394(%rsp),%rdi
lea    0xf3b(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x3f8(%rsp),%rdi
lea    0xf60(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x45c(%rsp),%r12
lea    0xf8e(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcpy@plt>
lea    0x4c0(%rsp),%r13
lea    0xf94(%rip),%rsi
mov    %r13,%rdi
call   1030 <strcpy@plt>
lea    0xfa8(%rip),%rsi
lea    0x7e0(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0x844(%rsp),%r14
lea    0xfac(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x8a8(%rsp),%r15
lea    0xfbd(%rip),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
cmp    $0x1,%ebx
je     12dc <raiseError+0x1ac>
test   %ebx,%ebx
jne    133a <raiseError+0x20a>
mov    0x2d50(%rip),%rbx
mov    (%rbx),%edi
lea    0xfbd(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0xc,%ebp
ja     139f <raiseError+0x26f>
mov    %ebp,%eax
lea    0xd4e(%rip),%rcx
movslq (%rcx,%rax,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    (%rbx),%edi
imul   $0x64,%rax,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x10,%rdx
lea    0xfa9(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    139f <raiseError+0x26f>
mov    0x2cfd(%rip),%rbx
mov    (%rbx),%edi
lea    0xf91(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0x2,%ebp
je     1314 <raiseError+0x1e4>
cmp    $0x1,%ebp
je     1322 <raiseError+0x1f2>
test   %ebp,%ebp
jne    133a <raiseError+0x20a>
mov    (%rbx),%edi
lea    0xf8d(%rip),%rsi
lea    0x7e0(%rsp),%rdx
jmp    132e <raiseError+0x1fe>
mov    (%rbx),%edi
lea    0xfbe(%rip),%rsi
mov    %r15,%rdx
jmp    132e <raiseError+0x1fe>
mov    (%rbx),%edi
lea    0xf8e(%rip),%rsi
mov    %r14,%rdx
mov    0x8(%rsp),%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xfb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%edi
imul   $0x64,%rax,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x10,%rdx
lea    0xf0f(%rip),%rsi
jmp    1393 <raiseError+0x263>
mov    (%rbx),%edi
lea    0xf04(%rip),%rsi
lea    0x3f8(%rsp),%rdx
jmp    1393 <raiseError+0x263>
mov    (%rbx),%edi
lea    0xefa(%rip),%rsi
mov    %r12,%rdx
jmp    12d0 <raiseError+0x1a0>
mov    (%rbx),%edi
lea    0xee0(%rip),%rsi
mov    %r13,%rdx
mov    0x8(%rsp),%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Could not Open OPTAB\00"
@.str.1 = [27 x i8] c"Could not Open Input Fille\00"
@.str.2 = [40 x i8] c"Could not Create/Open Intermediate File\00"
@.str.3 = [34 x i8] c"Could not Create/Open Output File\00"
@.str.4 = [25 x i8] c"Source File not supplied\00"
@.str.5 = [35 x i8] c"Memory Allocation for OPTAB Failed\00"
@.str.6 = [36 x i8] c"Memory Allocation for SYMTAB Failed\00"
@.str.7 = [32 x i8] c"Output file name missing for -o\00"
@.str.8 = [57 x i8] c"Cannot do both Bootstrap and Loader Assembly in one shot\00"
@.str.9 = [66 x i8] c"Bootstrap Creation failed, Expected Bootstrap length Exceeded for\00"
@.str.10 = [29 x i8] c"Output Device Missing for -d\00"
@.str.11 = [35 x i8] c"Stopping Assembly Due to Error in \00"
@.str.12 = [32 x i8] c"Duplicate LABEL present in Code\00"
@.str.13 = [40 x i8] c"Invalid Operation Code (OPCODE) in Code\00"
@.str.14 = [37 x i8] c"Undefeind Symbol present in the Code\00"
@stderr = global i32 0
@.str.15 = [26 x i8] c"Assembly Error (FATAL) : \00"
@.str.16 = [9 x i8] c"%s \22%s\22\0A\00"
@.str.17 = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.18 = [26 x i8] c"Assembly Error (ERROR) : \00"
@.str.19 = [34 x i8] c"%s\0A \22%s\22 is repeated in the Code\0A\00"
@.str.20 = [34 x i8] c"%s\0A \22%s\22 Does not exist in OPTAB\0A\00"
@.str.21 = [35 x i8] c"%s\0A \22%s\22 Does not exist in SYMTAB\0A\00"
define void @raiseError(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [20 x [100 x i8]]
%8 = alloca [20 x [100 x i8]]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 1
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 2
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 4
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %18, i64 0, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%21 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 5
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%24 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 6
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %24, i64 0, i64 0
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%27 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 7
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %27, i64 0, i64 0
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%30 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 8
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %30, i64 0, i64 0
%32 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
%33 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 9
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %33, i64 0, i64 0
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%36 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 10
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %36, i64 0, i64 0
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0))
%39 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 11
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %39, i64 0, i64 0
%41 = call i32 @strcpy(i8* %40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%42 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 12
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %42, i64 0, i64 0
%44 = call i32 @strcpy(i8* %43, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
%45 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 0
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %45, i64 0, i64 0
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%48 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 1
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %48, i64 0, i64 0
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
%51 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 2
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %51, i64 0, i64 0
%53 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0))
%54 = load i32, i32* %4
switch i32 %54, label %132 [
i32 0, label %55
i32 1, label %101
i32 2, label %131
]
55: ; preds = %3
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
%58 = load i32, i32* %5
switch i32 %58, label %97 [
i32 0, label %59
i32 1, label %59
i32 2, label %59
i32 4, label %59
i32 5, label %67
i32 6, label %67
i32 7, label %67
i32 8, label %67
i32 9, label %67
i32 10, label %74
i32 11, label %82
i32 12, label %89
]
59: ; preds = %55, %55, %55, %55
%60 = load i32, i32* @stderr
%61 = load i32, i32* %5
%62 = zext i32 %61 to i64
%63 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 %62
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %63, i64 0, i64 0
%65 = load i8*, i8** %6
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %64, i8* %65)
br label %98
67: ; preds = %55, %55, %55, %55, %55
%68 = load i32, i32* @stderr
%69 = load i32, i32* %5
%70 = zext i32 %69 to i64
%71 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 %70
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %71, i64 0, i64 0
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %72)
br label %98
74: ; preds = %55
%75 = load i32, i32* @stderr
%76 = load i32, i32* %5
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 %77
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %78, i64 0, i64 0
%80 = load i8*, i8** %6
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %79, i8* %80)
br label %98
82: ; preds = %55
%83 = load i32, i32* @stderr
%84 = load i32, i32* %5
%85 = zext i32 %84 to i64
%86 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 %85
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %86, i64 0, i64 0
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %87)
br label %98
89: ; preds = %55
%90 = load i32, i32* @stderr
%91 = load i32, i32* %5
%92 = zext i32 %91 to i64
%93 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %7, i64 0, i64 %92
%94 = getelementptr inbounds [100 x i8], [100 x i8]* %93, i64 0, i64 0
%95 = load i8*, i8** %6
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %94, i8* %95)
br label %98
97: ; preds = %55
br label %98
98: ; preds = %97, %89, %82, %74, %67, %59
%99 = load i32, i32* @EXIT_FAILURE
%100 = call i32 @exit(i32 %99)
unreachable
101: ; preds = %3
%102 = load i32, i32* @stderr
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0))
%104 = load i32, i32* %5
switch i32 %104, label %129 [
i32 0, label %105
i32 1, label %113
i32 2, label %121
]
105: ; preds = %101
%106 = load i32, i32* @stderr
%107 = load i32, i32* %5
%108 = zext i32 %107 to i64
%109 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 %108
%110 = getelementptr inbounds [100 x i8], [100 x i8]* %109, i64 0, i64 0
%111 = load i8*, i8** %6
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0), i8* %110, i8* %111)
br label %130
113: ; preds = %101
%114 = load i32, i32* @stderr
%115 = load i32, i32* %5
%116 = zext i32 %115 to i64
%117 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 %116
%118 = getelementptr inbounds [100 x i8], [100 x i8]* %117, i64 0, i64 0
%119 = load i8*, i8** %6
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i8* %118, i8* %119)
br label %130
121: ; preds = %101
%122 = load i32, i32* @stderr
%123 = load i32, i32* %5
%124 = zext i32 %123 to i64
%125 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %8, i64 0, i64 %124
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %125, i64 0, i64 0
%127 = load i8*, i8** %6
%128 = call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), i8* %126, i8* %127)
br label %130
129: ; preds = %101
br label %130
130: ; preds = %129, %121, %113, %105
br label %133
131: ; preds = %3
br label %133
132: ; preds = %3
br label %133
133: ; preds = %132, %131, %130
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Could not Open OPTAB\00"
@.str.1 = [27 x i8] c"Could not Open Input Fille\00"
@.str.2 = [40 x i8] c"Could not Create/Open Intermediate File\00"
@.str.3 = [34 x i8] c"Could not Create/Open Output File\00"
@.str.4 = [25 x i8] c"Source File not supplied\00"
@.str.5 = [35 x i8] c"Memory Allocation for OPTAB Failed\00"
@.str.6 = [36 x i8] c"Memory Allocation for SYMTAB Failed\00"
@.str.7 = [32 x i8] c"Output file name missing for -o\00"
@.str.8 = [57 x i8] c"Cannot do both Bootstrap and Loader Assembly in one shot\00"
@.str.9 = [66 x i8] c"Bootstrap Creation failed, Expected Bootstrap length Exceeded for\00"
@.str.10 = [29 x i8] c"Output Device Missing for -d\00"
@.str.11 = [35 x i8] c"Stopping Assembly Due to Error in \00"
@.str.12 = [32 x i8] c"Duplicate LABEL present in Code\00"
@.str.13 = [40 x i8] c"Invalid Operation Code (OPCODE) in Code\00"
@.str.14 = [37 x i8] c"Undefeind Symbol present in the Code\00"
@stderr = global i32 0
@.str.15 = [26 x i8] c"Assembly Error (FATAL) : \00"
@.str.16 = [9 x i8] c"%s \22%s\22\0A\00"
@.str.17 = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
@.str.18 = [26 x i8] c"Assembly Error (ERROR) : \00"
@.str.19 = [34 x i8] c"%s\0A \22%s\22 is repeated in the Code\0A\00"
@.str.20 = [34 x i8] c"%s\0A \22%s\22 Does not exist in OPTAB\0A\00"
@.str.21 = [35 x i8] c"%s\0A \22%s\22 Does not exist in SYMTAB\0A\00"
define void @raiseError(i32 %0, i32 %1, i8* %2) {
%4 = alloca [20 x [100 x i8]]
%5 = alloca [20 x [100 x i8]]
%6 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %5, i64 0, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 1, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 2, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 4, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 5, i64 0
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%17 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 6, i64 0
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 7, i64 0
%20 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%21 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 8, i64 0
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
%23 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 9, i64 0
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.8, i64 0, i64 0))
%25 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 10, i64 0
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.9, i64 0, i64 0))
%27 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 11, i64 0
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%29 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 12, i64 0
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
%31 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%32 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %5, i64 0, i64 1, i64 0
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0))
%34 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %5, i64 0, i64 2, i64 0
%35 = call i32 @strcpy(i8* %34, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0))
switch i32 %0, label %73 [
i32 0, label %36
i32 1, label %61
]
36: ; preds = %3
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0))
switch i32 %1, label %58 [
i32 0, label %39
i32 1, label %39
i32 2, label %39
i32 4, label %39
i32 5, label %44
i32 6, label %44
i32 7, label %44
i32 8, label %44
i32 9, label %44
i32 10, label %49
i32 11, label %52
i32 12, label %55
]
39: ; preds = %36, %36, %36, %36
%40 = load i32, i32* @stderr
%41 = zext i32 %1 to i64
%42 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 %41, i64 0
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %42, i8* %2)
br label %58
44: ; preds = %36, %36, %36, %36, %36
%45 = load i32, i32* @stderr
%46 = zext i32 %1 to i64
%47 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %4, i64 0, i64 %46, i64 0
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %47)
br label %58
49: ; preds = %36
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %25, i8* %2)
br label %58
52: ; preds = %36
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %27)
br label %58
55: ; preds = %36
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i8* %29, i8* %2)
br label %58
58: ; preds = %36, %55, %52, %49, %44, %39
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %3
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0))
switch i32 %1, label %73 [
i32 0, label %64
i32 1, label %67
i32 2, label %70
]
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0), i8* %7, i8* %2)
br label %73
67: ; preds = %61
%68 = load i32, i32* @stderr
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i8* %32, i8* %2)
br label %73
70: ; preds = %61
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0), i8* %34, i8* %2)
br label %73
73: ; preds = %3, %64, %67, %70, %61
ret void
}