#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*/ sprintf(char *, char *, unsigned int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
                             int flag) {
  if (quality == 0x3fffffff || quality == 0x28000000 || quality == 0x20000000)
    strcpy(name, "0 ");
  else if (quality <= bad_limit)
    strcpy(name, "- ");
  else
    strcpy(name, "+ ");
  if (quality == 0x7fffffff)
    strcat(name, "good");
  else if (quality == 0x70000000)
    strcat(name, "md5_match");
  else if (quality == 0x60000000)
    strcat(name, "slow");
  else if (quality == 0x50000000)
    strcat(name, "partial");
  else if (quality == 0x40000000)
    strcat(name, "valid");
  else if (quality == 0x3fffffff)
    strcat(name, "untested");
  else if (quality == 0x3ffffffe)
    strcat(name, "invalid");
  else if (quality == 0x28000000)
    strcat(name, "tao_end");
  else if (quality == 0x20000000)
    strcat(name, "off_track");
  else if (quality == 0x10000000)
    strcat(name, "md5_mismatch");
  else if (quality == 0x00000000)
    strcat(name, "unreadable");
  else
    sprintf(name, "0 0x%8.8X", (unsigned int)quality);
  return (name);
}


x86 assembly (clang, -O0):
<Spotlist__quality_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x3fffffff,-0x4(%rbp)
je     116c <Spotlist__quality_name+0x3c>
cmpl   $0x28000000,-0x4(%rbp)
je     116c <Spotlist__quality_name+0x3c>
cmpl   $0x20000000,-0x4(%rbp)
jne    1181 <Spotlist__quality_name+0x51>
mov    -0x10(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b7 <Spotlist__quality_name+0x87>
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11a2 <Spotlist__quality_name+0x72>
mov    -0x10(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b2 <Spotlist__quality_name+0x82>
mov    -0x10(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b7 <Spotlist__quality_name+0x87>
cmpl   $0x7fffffff,-0x4(%rbp)
jne    11d9 <Spotlist__quality_name+0xa9>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1040 <strcat@plt>
jmp    136f <Spotlist__quality_name+0x23f>
cmpl   $0x70000000,-0x4(%rbp)
jne    11fb <Spotlist__quality_name+0xcb>
mov    -0x10(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcat@plt>
jmp    136a <Spotlist__quality_name+0x23a>
cmpl   $0x60000000,-0x4(%rbp)
jne    121d <Spotlist__quality_name+0xed>
mov    -0x10(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   1040 <strcat@plt>
jmp    1365 <Spotlist__quality_name+0x235>
cmpl   $0x50000000,-0x4(%rbp)
jne    123f <Spotlist__quality_name+0x10f>
mov    -0x10(%rbp),%rdi
lea    0xde8(%rip),%rsi
call   1040 <strcat@plt>
jmp    1360 <Spotlist__quality_name+0x230>
cmpl   $0x40000000,-0x4(%rbp)
jne    1261 <Spotlist__quality_name+0x131>
mov    -0x10(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1040 <strcat@plt>
jmp    135b <Spotlist__quality_name+0x22b>
cmpl   $0x3fffffff,-0x4(%rbp)
jne    1283 <Spotlist__quality_name+0x153>
mov    -0x10(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   1040 <strcat@plt>
jmp    1356 <Spotlist__quality_name+0x226>
cmpl   $0x3ffffffe,-0x4(%rbp)
jne    12a5 <Spotlist__quality_name+0x175>
mov    -0x10(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   1040 <strcat@plt>
jmp    1351 <Spotlist__quality_name+0x221>
cmpl   $0x28000000,-0x4(%rbp)
jne    12c7 <Spotlist__quality_name+0x197>
mov    -0x10(%rbp),%rdi
lea    0xd79(%rip),%rsi
call   1040 <strcat@plt>
jmp    134c <Spotlist__quality_name+0x21c>
cmpl   $0x20000000,-0x4(%rbp)
jne    12e9 <Spotlist__quality_name+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xd5f(%rip),%rsi
call   1040 <strcat@plt>
jmp    1347 <Spotlist__quality_name+0x217>
cmpl   $0x10000000,-0x4(%rbp)
jne    130b <Spotlist__quality_name+0x1db>
mov    -0x10(%rbp),%rdi
lea    0xd47(%rip),%rsi
call   1040 <strcat@plt>
jmp    1342 <Spotlist__quality_name+0x212>
cmpl   $0x0,-0x4(%rbp)
jne    132a <Spotlist__quality_name+0x1fa>
mov    -0x10(%rbp),%rdi
lea    0xd35(%rip),%rsi
call   1040 <strcat@plt>
jmp    133d <Spotlist__quality_name+0x20d>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xd28(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1342 <Spotlist__quality_name+0x212>
jmp    1347 <Spotlist__quality_name+0x217>
jmp    134c <Spotlist__quality_name+0x21c>
jmp    1351 <Spotlist__quality_name+0x221>
jmp    1356 <Spotlist__quality_name+0x226>
jmp    135b <Spotlist__quality_name+0x22b>
jmp    1360 <Spotlist__quality_name+0x230>
jmp    1365 <Spotlist__quality_name+0x235>
jmp    136a <Spotlist__quality_name+0x23a>
jmp    136f <Spotlist__quality_name+0x23f>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spotlist__quality_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rsi
cmp    $0x20000000,%edi
je     116b <Spotlist__quality_name+0x3b>
cmp    $0x28000000,%ebp
je     116b <Spotlist__quality_name+0x3b>
cmp    $0x3fffffff,%ebp
je     116b <Spotlist__quality_name+0x3b>
cmp    %edx,%ebp
lea    0xea6(%rip),%rax
lea    0xe9c(%rip),%rsi
cmovg  %rax,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
cmp    $0x3ffffffe,%ebp
jle    11b3 <Spotlist__quality_name+0x83>
cmp    $0x5fffffff,%ebp
jg     11e0 <Spotlist__quality_name+0xb0>
cmp    $0x3fffffff,%ebp
je     1216 <Spotlist__quality_name+0xe6>
cmp    $0x40000000,%ebp
je     121f <Spotlist__quality_name+0xef>
cmp    $0x50000000,%ebp
jne    1265 <Spotlist__quality_name+0x135>
lea    0xe6f(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
cmp    $0x1fffffff,%ebp
jle    1201 <Spotlist__quality_name+0xd1>
cmp    $0x20000000,%ebp
je     1228 <Spotlist__quality_name+0xf8>
cmp    $0x28000000,%ebp
je     1231 <Spotlist__quality_name+0x101>
cmp    $0x3ffffffe,%ebp
jne    1265 <Spotlist__quality_name+0x135>
lea    0xe50(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
cmp    $0x60000000,%ebp
je     123a <Spotlist__quality_name+0x10a>
cmp    $0x70000000,%ebp
je     1243 <Spotlist__quality_name+0x113>
cmp    $0x7fffffff,%ebp
jne    1265 <Spotlist__quality_name+0x135>
lea    0xe0a(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
test   %ebp,%ebp
je     124c <Spotlist__quality_name+0x11c>
cmp    $0x10000000,%ebp
jne    1265 <Spotlist__quality_name+0x135>
lea    0xe34(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xe08(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xe0a(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xe0f(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xdfe(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xdd7(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xdc4(%rip),%rsi
jmp    1253 <Spotlist__quality_name+0x123>
lea    0xe02(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xdf4(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1050 <sprintf@plt>
jmp    125b <Spotlist__quality_name+0x12b>

LLVM IR (-O0):
@.str = [3 x i8] c"0 \00"
@.str.1 = [3 x i8] c"- \00"
@.str.2 = [3 x i8] c"+ \00"
@.str.3 = [5 x i8] c"good\00"
@.str.4 = [10 x i8] c"md5_match\00"
@.str.5 = [5 x i8] c"slow\00"
@.str.6 = [8 x i8] c"partial\00"
@.str.7 = [6 x i8] c"valid\00"
@.str.8 = [9 x i8] c"untested\00"
@.str.9 = [8 x i8] c"invalid\00"
@.str.10 = [8 x i8] c"tao_end\00"
@.str.11 = [10 x i8] c"off_track\00"
@.str.12 = [13 x i8] c"md5_mismatch\00"
@.str.13 = [11 x i8] c"unreadable\00"
@.str.14 = [10 x i8] c"0 0x%8.8X\00"
define i8* @Spotlist__quality_name(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1073741823
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 671088640
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 536870912
br i1 %16, label %17, label %20
17: ; preds = %14, %11, %4
%18 = load i8*, i8** %6
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %31
20: ; preds = %14
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i8*, i8** %6
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %30
27: ; preds = %20
%28 = load i8*, i8** %6
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30, %17
%32 = load i32, i32* %5
%33 = icmp eq i32 %32, 2147483647
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i8*, i8** %6
%36 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %111
37: ; preds = %31
%38 = load i32, i32* %5
%39 = icmp eq i32 %38, 1879048192
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i8*, i8** %6
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %110
43: ; preds = %37
%44 = load i32, i32* %5
%45 = icmp eq i32 %44, 1610612736
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i8*, i8** %6
%48 = call i32 @strcat(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %109
49: ; preds = %43
%50 = load i32, i32* %5
%51 = icmp eq i32 %50, 1342177280
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i8*, i8** %6
%54 = call i32 @strcat(i8* %53, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %108
55: ; preds = %49
%56 = load i32, i32* %5
%57 = icmp eq i32 %56, 1073741824
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %6
%60 = call i32 @strcat(i8* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %107
61: ; preds = %55
%62 = load i32, i32* %5
%63 = icmp eq i32 %62, 1073741823
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i8*, i8** %6
%66 = call i32 @strcat(i8* %65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %106
67: ; preds = %61
%68 = load i32, i32* %5
%69 = icmp eq i32 %68, 1073741822
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i8*, i8** %6
%72 = call i32 @strcat(i8* %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %105
73: ; preds = %67
%74 = load i32, i32* %5
%75 = icmp eq i32 %74, 671088640
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i8*, i8** %6
%78 = call i32 @strcat(i8* %77, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %104
79: ; preds = %73
%80 = load i32, i32* %5
%81 = icmp eq i32 %80, 536870912
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i8*, i8** %6
%84 = call i32 @strcat(i8* %83, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %103
85: ; preds = %79
%86 = load i32, i32* %5
%87 = icmp eq i32 %86, 268435456
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = load i8*, i8** %6
%90 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
br label %102
91: ; preds = %85
%92 = load i32, i32* %5
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %91
%95 = load i8*, i8** %6
%96 = call i32 @strcat(i8* %95, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %101
97: ; preds = %91
%98 = load i8*, i8** %6
%99 = load i32, i32* %5
%100 = call i32 @sprintf(i8* %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %97, %94
br label %102
102: ; preds = %101, %88
br label %103
103: ; preds = %102, %82
br label %104
104: ; preds = %103, %76
br label %105
105: ; preds = %104, %70
br label %106
106: ; preds = %105, %64
br label %107
107: ; preds = %106, %58
br label %108
108: ; preds = %107, %52
br label %109
109: ; preds = %108, %46
br label %110
110: ; preds = %109, %40
br label %111
111: ; preds = %110, %34
%112 = load i8*, i8** %6
ret i8* %112
}

LLVM IR (-O2):
@.str = [3 x i8] c"0 \00"
@.str.1 = [3 x i8] c"- \00"
@.str.2 = [3 x i8] c"+ \00"
@.str.3 = [5 x i8] c"good\00"
@.str.4 = [10 x i8] c"md5_match\00"
@.str.5 = [5 x i8] c"slow\00"
@.str.6 = [8 x i8] c"partial\00"
@.str.7 = [6 x i8] c"valid\00"
@.str.8 = [9 x i8] c"untested\00"
@.str.9 = [8 x i8] c"invalid\00"
@.str.10 = [8 x i8] c"tao_end\00"
@.str.11 = [10 x i8] c"off_track\00"
@.str.12 = [13 x i8] c"md5_mismatch\00"
@.str.13 = [11 x i8] c"unreadable\00"
@.str.14 = [10 x i8] c"0 0x%8.8X\00"
define i8* @Spotlist__quality_name(i32 %0, i8* returned %1, i32 %2, i32 %3) {
switch i32 %0, label %5 [
i32 1073741823, label %8
i32 671088640, label %8
i32 536870912, label %8
]
5: ; preds = %4
%6 = icmp sgt i32 %0, %2
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
br label %8
8: ; preds = %5, %4, %4, %4
%9 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %4 ], [ %7, %5 ]
%10 = tail call i32 @strcpy(i8* %1, i8* %9)
switch i32 %0, label %33 [
i32 2147483647, label %11
i32 1879048192, label %13
i32 1610612736, label %15
i32 1342177280, label %17
i32 1073741824, label %19
i32 1073741823, label %21
i32 1073741822, label %23
i32 671088640, label %25
i32 536870912, label %27
i32 268435456, label %29
i32 0, label %31
]
11: ; preds = %8
%12 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %35
13: ; preds = %8
%14 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %35
15: ; preds = %8
%16 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %35
17: ; preds = %8
%18 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %35
19: ; preds = %8
%20 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %35
21: ; preds = %8
%22 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %35
23: ; preds = %8
%24 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %35
25: ; preds = %8
%26 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %35
27: ; preds = %8
%28 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %35
29: ; preds = %8
%30 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
br label %35
31: ; preds = %8
%32 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %35
33: ; preds = %8
%34 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i32 %0)
br label %35
35: ; preds = %13, %17, %21, %25, %29, %33, %31, %27, %23, %19, %15, %11
ret i8* %1
}