#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*/ strcpy(void *, char *);
void check_rms_codes(int rmsmsgid, void *bufadr, void *smesg) {
  switch (rmsmsgid) {
  case 98728:
    strcpy(bufadr, "Record too large for buffer");
    break;
  case 98938:
    strcpy(bufadr, "End of file");
    break;
  case 98962:
    strcpy(bufadr, "File not found");
    break;
  case 99018:
    strcpy(bufadr, "No more files");
    break;
  case 99050:
    strcpy(bufadr, "Invalid wild card contect");
    break;
  case 99380:
    strcpy(bufadr, "Fatal process deleted");
    break;
  case 99532:
    strcpy(bufadr, "Error in directory name");
    break;
  case 99588:
    strcpy(bufadr, "Expand string area too small");
    break;
  case 99628:
    strcpy(bufadr, "Error in file name");
    break;
  case 99684:
    strcpy(bufadr, "Invalid internal file identifier");
    break;
  case 99804:
    strcpy(bufadr, "Invalid name");
    break;
  case 99988:
    strcpy(bufadr, "Invalid resultant string size");
    break;
  case 100004:
    strcpy(bufadr, "Invalid record size");
    break;
  case 100164:
    strcpy(bufadr, "Read error");
    break;
  }
}


x86 assembly (clang, -O0):
<check_rms_codes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x181a8,%eax
je     1230 <check_rms_codes+0x120>
jmp    1139 <check_rms_codes+0x29>
mov    -0x1c(%rbp),%eax
sub    $0x1827a,%eax
je     1245 <check_rms_codes+0x135>
jmp    114c <check_rms_codes+0x3c>
mov    -0x1c(%rbp),%eax
sub    $0x18292,%eax
je     125a <check_rms_codes+0x14a>
jmp    115f <check_rms_codes+0x4f>
mov    -0x1c(%rbp),%eax
sub    $0x182ca,%eax
je     126f <check_rms_codes+0x15f>
jmp    1172 <check_rms_codes+0x62>
mov    -0x1c(%rbp),%eax
sub    $0x182ea,%eax
je     1284 <check_rms_codes+0x174>
jmp    1185 <check_rms_codes+0x75>
mov    -0x1c(%rbp),%eax
sub    $0x18434,%eax
je     1299 <check_rms_codes+0x189>
jmp    1198 <check_rms_codes+0x88>
mov    -0x1c(%rbp),%eax
sub    $0x184cc,%eax
je     12ae <check_rms_codes+0x19e>
jmp    11ab <check_rms_codes+0x9b>
mov    -0x1c(%rbp),%eax
sub    $0x18504,%eax
je     12c3 <check_rms_codes+0x1b3>
jmp    11be <check_rms_codes+0xae>
mov    -0x1c(%rbp),%eax
sub    $0x1852c,%eax
je     12d8 <check_rms_codes+0x1c8>
jmp    11d1 <check_rms_codes+0xc1>
mov    -0x1c(%rbp),%eax
sub    $0x18564,%eax
je     12ed <check_rms_codes+0x1dd>
jmp    11e4 <check_rms_codes+0xd4>
mov    -0x1c(%rbp),%eax
sub    $0x185dc,%eax
je     1302 <check_rms_codes+0x1f2>
jmp    11f7 <check_rms_codes+0xe7>
mov    -0x1c(%rbp),%eax
sub    $0x18694,%eax
je     1317 <check_rms_codes+0x207>
jmp    120a <check_rms_codes+0xfa>
mov    -0x1c(%rbp),%eax
sub    $0x186a4,%eax
je     132c <check_rms_codes+0x21c>
jmp    121d <check_rms_codes+0x10d>
mov    -0x1c(%rbp),%eax
sub    $0x18744,%eax
je     1341 <check_rms_codes+0x231>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdbb(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdbc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdc7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdc9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <check_rms_codes+0x241>
mov    -0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_rms_codes>:
cmp    $0x18503,%edi
jg     1150 <check_rms_codes+0x40>
cmp    $0x182c9,%edi
jle    1188 <check_rms_codes+0x78>
cmp    $0x18433,%edi
jg     11dd <check_rms_codes+0xcd>
cmp    $0x182ca,%edi
je     120f <check_rms_codes+0xff>
cmp    $0x182ea,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xefa(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
cmp    $0x185db,%edi
jle    11b8 <check_rms_codes+0xa8>
cmp    $0x186a3,%edi
jg     11f6 <check_rms_codes+0xe6>
cmp    $0x185dc,%edi
je     1218 <check_rms_codes+0x108>
cmp    $0x18694,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xf68(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
cmp    $0x181a8,%edi
je     1221 <check_rms_codes+0x111>
cmp    $0x1827a,%edi
je     122a <check_rms_codes+0x11a>
cmp    $0x18292,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xe75(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
cmp    $0x18504,%edi
je     1233 <check_rms_codes+0x123>
cmp    $0x1852c,%edi
je     123c <check_rms_codes+0x12c>
cmp    $0x18564,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xee2(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
cmp    $0x18434,%edi
je     1245 <check_rms_codes+0x135>
cmp    $0x184cc,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xe81(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
cmp    $0x186a4,%edi
je     124e <check_rms_codes+0x13e>
cmp    $0x18744,%edi
jne    1260 <check_rms_codes+0x150>
lea    0xf10(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xe21(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xebf(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xdd8(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xdeb(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xe53(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xe67(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xe13(%rip),%rax
jmp    1255 <check_rms_codes+0x145>
lea    0xeb4(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <strcpy@plt>
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Record too large for buffer\00"
@.str.1 = [12 x i8] c"End of file\00"
@.str.2 = [15 x i8] c"File not found\00"
@.str.3 = [14 x i8] c"No more files\00"
@.str.4 = [26 x i8] c"Invalid wild card contect\00"
@.str.5 = [22 x i8] c"Fatal process deleted\00"
@.str.6 = [24 x i8] c"Error in directory name\00"
@.str.7 = [29 x i8] c"Expand string area too small\00"
@.str.8 = [19 x i8] c"Error in file name\00"
@.str.9 = [33 x i8] c"Invalid internal file identifier\00"
@.str.10 = [13 x i8] c"Invalid name\00"
@.str.11 = [30 x i8] c"Invalid resultant string size\00"
@.str.12 = [20 x i8] c"Invalid record size\00"
@.str.13 = [11 x i8] c"Read error\00"
define void @check_rms_codes(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %50 [
i32 98728, label %8
i32 98938, label %11
i32 98962, label %14
i32 99018, label %17
i32 99050, label %20
i32 99380, label %23
i32 99532, label %26
i32 99588, label %29
i32 99628, label %32
i32 99684, label %35
i32 99804, label %38
i32 99988, label %41
i32 100004, label %44
i32 100164, label %47
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %50
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %50
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %50
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %50
20: ; preds = %3
%21 = load i8*, i8** %5
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %50
23: ; preds = %3
%24 = load i8*, i8** %5
%25 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %50
26: ; preds = %3
%27 = load i8*, i8** %5
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %50
29: ; preds = %3
%30 = load i8*, i8** %5
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %50
32: ; preds = %3
%33 = load i8*, i8** %5
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %50
35: ; preds = %3
%36 = load i8*, i8** %5
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
br label %50
38: ; preds = %3
%39 = load i8*, i8** %5
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %50
41: ; preds = %3
%42 = load i8*, i8** %5
%43 = call i32 @strcpy(i8* %42, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0))
br label %50
44: ; preds = %3
%45 = load i8*, i8** %5
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %50
47: ; preds = %3
%48 = load i8*, i8** %5
%49 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %50
50: ; preds = %3, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Record too large for buffer\00"
@.str.1 = [12 x i8] c"End of file\00"
@.str.2 = [15 x i8] c"File not found\00"
@.str.3 = [14 x i8] c"No more files\00"
@.str.4 = [26 x i8] c"Invalid wild card contect\00"
@.str.5 = [22 x i8] c"Fatal process deleted\00"
@.str.6 = [24 x i8] c"Error in directory name\00"
@.str.7 = [29 x i8] c"Expand string area too small\00"
@.str.8 = [19 x i8] c"Error in file name\00"
@.str.9 = [33 x i8] c"Invalid internal file identifier\00"
@.str.10 = [13 x i8] c"Invalid name\00"
@.str.11 = [30 x i8] c"Invalid resultant string size\00"
@.str.12 = [20 x i8] c"Invalid record size\00"
@.str.13 = [11 x i8] c"Read error\00"
define void @check_rms_codes(i32 %0, i8* %1, i8* nocapture readnone %2) {
switch i32 %0, label %20 [
i32 98728, label %17
i32 98938, label %4
i32 98962, label %5
i32 99018, label %6
i32 99050, label %7
i32 99380, label %8
i32 99532, label %9
i32 99588, label %10
i32 99628, label %11
i32 99684, label %12
i32 99804, label %13
i32 99988, label %14
i32 100004, label %15
i32 100164, label %16
]
4: ; preds = %3
br label %17
5: ; preds = %3
br label %17
6: ; preds = %3
br label %17
7: ; preds = %3
br label %17
8: ; preds = %3
br label %17
9: ; preds = %3
br label %17
10: ; preds = %3
br label %17
11: ; preds = %3
br label %17
12: ; preds = %3
br label %17
13: ; preds = %3
br label %17
14: ; preds = %3
br label %17
15: ; preds = %3
br label %17
16: ; preds = %3
br label %17
17: ; preds = %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16
%18 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), %16 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), %15 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), %14 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), %13 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), %12 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), %3 ]
%19 = tail call i32 @strcpy(i8* %1, i8* %18)
br label %20
20: ; preds = %17, %3
ret void
}