#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(int);
int /*<<< orphan*/ printf(char *, ...);
void ErrorMsg(int message, const char *arg) {
  switch (message) {
  case 0: {
    printf("Syntax: error in or command line arguments [input-file]\n");
    break;
  }
  case 1: {
    printf("Error: Input-file '%s' not found.\n", arg);
    break;
  }
  case 2: {
    printf("Error: Parameter '%s' has invalid format.\n", arg);
    break;
  }
  case 3: {
    printf("Error: Parameter '%s' is out of range.\n", arg);
    break;
  }
  case 4: {
    printf("Error: Parameter '%s' is unknown.\n", arg);
    break;
  }
  case 5: {
    printf("Error: Unreadable parameter.\n");
    break;
  }
  default:
    printf("Error.\n");
  }
  printf("Program aborted.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ErrorMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     11d6 <ErrorMsg+0xb6>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
mov    -0x10(%rbp),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
mov    -0x10(%rbp),%rsi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
mov    -0x10(%rbp),%rsi
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
mov    -0x10(%rbp),%rsi
lea    0xf10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <ErrorMsg+0xc4>
lea    0xf2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ErrorMsg>:
push   %rax
cmp    $0x5,%edi
ja     1151 <ErrorMsg+0x21>
mov    %edi,%eax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf90(%rip),%rdi
jmp    118c <ErrorMsg+0x5c>
lea    0xfbf(%rip),%rdi
jmp    118c <ErrorMsg+0x5c>
lea    0xeb7(%rip),%rdi
jmp    117c <ErrorMsg+0x4c>
lea    0xed1(%rip),%rdi
jmp    117c <ErrorMsg+0x4c>
lea    0xef3(%rip),%rdi
jmp    117c <ErrorMsg+0x4c>
lea    0xf12(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1191 <ErrorMsg+0x61>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Syntax: error in or command line arguments [input-file]\0A\00"
@.str.1 = [35 x i8] c"Error: Input-file '%s' not found.\0A\00"
@.str.2 = [43 x i8] c"Error: Parameter '%s' has invalid format.\0A\00"
@.str.3 = [40 x i8] c"Error: Parameter '%s' is out of range.\0A\00"
@.str.4 = [35 x i8] c"Error: Parameter '%s' is unknown.\0A\00"
@.str.5 = [30 x i8] c"Error: Unreadable parameter.\0A\00"
@.str.6 = [8 x i8] c"Error.\0A\00"
@.str.7 = [18 x i8] c"Program aborted.\0A\00"
define void @ErrorMsg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %22 [
i32 0, label %6
i32 1, label %8
i32 2, label %11
i32 3, label %14
i32 4, label %17
i32 5, label %20
]
6: ; preds = %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %24
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %24
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %15)
br label %24
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %24
20: ; preds = %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %24
22: ; preds = %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %24
24: ; preds = %22, %20, %17, %14, %11, %8, %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"Error: Input-file '%s' not found.\0A\00"
@.str.2 = [43 x i8] c"Error: Parameter '%s' has invalid format.\0A\00"
@.str.3 = [40 x i8] c"Error: Parameter '%s' is out of range.\0A\00"
@.str.4 = [35 x i8] c"Error: Parameter '%s' is unknown.\0A\00"
@str = [29 x i8] c"Error: Unreadable parameter.\00"
@str.8 = [17 x i8] c"Program aborted.\00"
@str.9 = [56 x i8] c"Syntax: error in or command line arguments [input-file]\00"
@str.10 = [7 x i8] c"Error.\00"
define void @ErrorMsg(i32 %0, i8* %1) {
switch i32 %0, label %15 [
i32 0, label %3
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
i32 5, label %13
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.9, i64 0, i64 0))
br label %17
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %17
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %17
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %1)
br label %17
11: ; preds = %2
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %17
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.10, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5, %3
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.8, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
}