int libiso_msgs__sev_to_text(int severity, char **severity_name, int flag) {
  if (flag & 1) {
    *severity_name = "ALL ERRFILE DEBUG UPDATE NOTE HINT WARNING SORRY MISHAP "
                     "FAILURE FATAL ABORT NEVER";
    return (1);
  }
  *severity_name = "";
  if (severity >= 0x7fffffff)
    *severity_name = "NEVER";
  else if (severity >= 0x71000000)
    *severity_name = "ABORT";
  else if (severity >= 0x70000000)
    *severity_name = "FATAL";
  else if (severity >= 0x68000000)
    *severity_name = "FAILURE";
  else if (severity >= 0x64000000)
    *severity_name = "MISHAP";
  else if (severity >= 0x60000000)
    *severity_name = "SORRY";
  else if (severity >= 0x50000000)
    *severity_name = "WARNING";
  else if (severity >= 0x40000000)
    *severity_name = "HINT";
  else if (severity >= 0x30000000)
    *severity_name = "NOTE";
  else if (severity >= 0x20000000)
    *severity_name = "UPDATE";
  else if (severity >= 0x10000000)
    *severity_name = "DEBUG";
  else if (severity >= 0x08000000)
    *severity_name = "ERRFILE";
  else if (severity >= 0x00000000)
    *severity_name = "ALL";
  else {
    *severity_name = "";
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<libiso_msgs__sev_to_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <libiso_msgs__sev_to_text+0x37>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    133f <libiso_msgs__sev_to_text+0x23f>
mov    -0x10(%rbp),%rax
lea    0xf57(%rip),%rcx
mov    %rcx,(%rax)
cmpl   $0x7fffffff,-0x8(%rbp)
jl     1165 <libiso_msgs__sev_to_text+0x65>
mov    -0x10(%rbp),%rax
lea    0xeef(%rip),%rcx
mov    %rcx,(%rax)
jmp    1338 <libiso_msgs__sev_to_text+0x238>
cmpl   $0x71000000,-0x8(%rbp)
jl     1185 <libiso_msgs__sev_to_text+0x85>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
mov    %rcx,(%rax)
jmp    1333 <libiso_msgs__sev_to_text+0x233>
cmpl   $0x70000000,-0x8(%rbp)
jl     11a5 <libiso_msgs__sev_to_text+0xa5>
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rcx
mov    %rcx,(%rax)
jmp    132e <libiso_msgs__sev_to_text+0x22e>
cmpl   $0x68000000,-0x8(%rbp)
jl     11c5 <libiso_msgs__sev_to_text+0xc5>
mov    -0x10(%rbp),%rax
lea    0xea1(%rip),%rcx
mov    %rcx,(%rax)
jmp    1329 <libiso_msgs__sev_to_text+0x229>
cmpl   $0x64000000,-0x8(%rbp)
jl     11e5 <libiso_msgs__sev_to_text+0xe5>
mov    -0x10(%rbp),%rax
lea    0xe89(%rip),%rcx
mov    %rcx,(%rax)
jmp    1324 <libiso_msgs__sev_to_text+0x224>
cmpl   $0x60000000,-0x8(%rbp)
jl     1205 <libiso_msgs__sev_to_text+0x105>
mov    -0x10(%rbp),%rax
lea    0xe70(%rip),%rcx
mov    %rcx,(%rax)
jmp    131f <libiso_msgs__sev_to_text+0x21f>
cmpl   $0x50000000,-0x8(%rbp)
jl     1225 <libiso_msgs__sev_to_text+0x125>
mov    -0x10(%rbp),%rax
lea    0xe56(%rip),%rcx
mov    %rcx,(%rax)
jmp    131a <libiso_msgs__sev_to_text+0x21a>
cmpl   $0x40000000,-0x8(%rbp)
jl     1245 <libiso_msgs__sev_to_text+0x145>
mov    -0x10(%rbp),%rax
lea    0xe3e(%rip),%rcx
mov    %rcx,(%rax)
jmp    1315 <libiso_msgs__sev_to_text+0x215>
cmpl   $0x30000000,-0x8(%rbp)
jl     1265 <libiso_msgs__sev_to_text+0x165>
mov    -0x10(%rbp),%rax
lea    0xe23(%rip),%rcx
mov    %rcx,(%rax)
jmp    1310 <libiso_msgs__sev_to_text+0x210>
cmpl   $0x20000000,-0x8(%rbp)
jl     1285 <libiso_msgs__sev_to_text+0x185>
mov    -0x10(%rbp),%rax
lea    0xe08(%rip),%rcx
mov    %rcx,(%rax)
jmp    130b <libiso_msgs__sev_to_text+0x20b>
cmpl   $0x10000000,-0x8(%rbp)
jl     12a5 <libiso_msgs__sev_to_text+0x1a5>
mov    -0x10(%rbp),%rax
lea    0xdef(%rip),%rcx
mov    %rcx,(%rax)
jmp    1306 <libiso_msgs__sev_to_text+0x206>
cmpl   $0x8000000,-0x8(%rbp)
jl     12c5 <libiso_msgs__sev_to_text+0x1c5>
mov    -0x10(%rbp),%rax
lea    0xdd5(%rip),%rcx
mov    %rcx,(%rax)
jmp    1301 <libiso_msgs__sev_to_text+0x201>
cmpl   $0x0,-0x8(%rbp)
jl     12e2 <libiso_msgs__sev_to_text+0x1e2>
mov    -0x10(%rbp),%rax
lea    0xdc0(%rip),%rcx
mov    %rcx,(%rax)
jmp    12fc <libiso_msgs__sev_to_text+0x1fc>
mov    -0x10(%rbp),%rax
lea    0xdac(%rip),%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    133f <libiso_msgs__sev_to_text+0x23f>
jmp    1301 <libiso_msgs__sev_to_text+0x201>
jmp    1306 <libiso_msgs__sev_to_text+0x206>
jmp    130b <libiso_msgs__sev_to_text+0x20b>
jmp    1310 <libiso_msgs__sev_to_text+0x210>
jmp    1315 <libiso_msgs__sev_to_text+0x215>
jmp    131a <libiso_msgs__sev_to_text+0x21a>
jmp    131f <libiso_msgs__sev_to_text+0x21f>
jmp    1324 <libiso_msgs__sev_to_text+0x224>
jmp    1329 <libiso_msgs__sev_to_text+0x229>
jmp    132e <libiso_msgs__sev_to_text+0x22e>
jmp    1333 <libiso_msgs__sev_to_text+0x233>
jmp    1338 <libiso_msgs__sev_to_text+0x238>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libiso_msgs__sev_to_text>:
mov    $0x1,%eax
test   $0x1,%dl
jne    111d <libiso_msgs__sev_to_text+0x1d>
cmp    $0x7fffffff,%edi
jne    1128 <libiso_msgs__sev_to_text+0x28>
lea    0xf33(%rip),%rcx
mov    %rcx,(%rsi)
ret
lea    0xedc(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x70ffffff,%edi
jle    113b <libiso_msgs__sev_to_text+0x3b>
lea    0xf1b(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x6fffffff,%edi
jle    114e <libiso_msgs__sev_to_text+0x4e>
lea    0xf0e(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x67ffffff,%edi
jle    1161 <libiso_msgs__sev_to_text+0x61>
lea    0xf01(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x63ffffff,%edi
jle    1174 <libiso_msgs__sev_to_text+0x74>
lea    0xef6(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x5fffffff,%edi
jle    1187 <libiso_msgs__sev_to_text+0x87>
lea    0xeea(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x4fffffff,%edi
jle    119a <libiso_msgs__sev_to_text+0x9a>
lea    0xedd(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x3fffffff,%edi
jle    11ad <libiso_msgs__sev_to_text+0xad>
lea    0xed2(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x2fffffff,%edi
jle    11c0 <libiso_msgs__sev_to_text+0xc0>
lea    0xec4(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x1fffffff,%edi
jle    11d3 <libiso_msgs__sev_to_text+0xd3>
lea    0xeb6(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0xfffffff,%edi
jle    11e6 <libiso_msgs__sev_to_text+0xe6>
lea    0xeaa(%rip),%rcx
mov    %rcx,(%rsi)
ret
cmp    $0x7ffffff,%edi
jle    11f9 <libiso_msgs__sev_to_text+0xf9>
lea    0xe9d(%rip),%rcx
mov    %rcx,(%rsi)
ret
test   %edi,%edi
lea    0xe98(%rip),%rax
lea    0xe90(%rip),%rcx
cmovns %rax,%rcx
not    %edi
shr    $0x1f,%edi
mov    %edi,%eax
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
@.str = [82 x i8] c"ALL ERRFILE DEBUG UPDATE NOTE HINT WARNING SORRY MISHAP FAILURE FATAL ABORT NEVER\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"NEVER\00"
@.str.3 = [6 x i8] c"ABORT\00"
@.str.4 = [6 x i8] c"FATAL\00"
@.str.5 = [8 x i8] c"FAILURE\00"
@.str.6 = [7 x i8] c"MISHAP\00"
@.str.7 = [6 x i8] c"SORRY\00"
@.str.8 = [8 x i8] c"WARNING\00"
@.str.9 = [5 x i8] c"HINT\00"
@.str.10 = [5 x i8] c"NOTE\00"
@.str.11 = [7 x i8] c"UPDATE\00"
@.str.12 = [6 x i8] c"DEBUG\00"
@.str.13 = [8 x i8] c"ERRFILE\00"
@.str.14 = [4 x i8] c"ALL\00"
define i32 @libiso_msgs__sev_to_text(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8**, i8*** %6
store i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8** %12
store i32 1, i32* %4
br label %94
13: ; preds = %3
%14 = load i8**, i8*** %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %14
%15 = load i32, i32* %5
%16 = icmp sge i32 %15, 2147483647
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i8**, i8*** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %18
br label %93
19: ; preds = %13
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 1895825408
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i8**, i8*** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %23
br label %92
24: ; preds = %19
%25 = load i32, i32* %5
%26 = icmp sge i32 %25, 1879048192
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = load i8**, i8*** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %28
br label %91
29: ; preds = %24
%30 = load i32, i32* %5
%31 = icmp sge i32 %30, 1744830464
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = load i8**, i8*** %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %33
br label %90
34: ; preds = %29
%35 = load i32, i32* %5
%36 = icmp sge i32 %35, 1677721600
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = load i8**, i8*** %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %38
br label %89
39: ; preds = %34
%40 = load i32, i32* %5
%41 = icmp sge i32 %40, 1610612736
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = load i8**, i8*** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %43
br label %88
44: ; preds = %39
%45 = load i32, i32* %5
%46 = icmp sge i32 %45, 1342177280
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = load i8**, i8*** %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8** %48
br label %87
49: ; preds = %44
%50 = load i32, i32* %5
%51 = icmp sge i32 %50, 1073741824
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = load i8**, i8*** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8** %53
br label %86
54: ; preds = %49
%55 = load i32, i32* %5
%56 = icmp sge i32 %55, 805306368
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = load i8**, i8*** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %58
br label %85
59: ; preds = %54
%60 = load i32, i32* %5
%61 = icmp sge i32 %60, 536870912
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = load i8**, i8*** %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i8** %63
br label %84
64: ; preds = %59
%65 = load i32, i32* %5
%66 = icmp sge i32 %65, 268435456
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = load i8**, i8*** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %68
br label %83
69: ; preds = %64
%70 = load i32, i32* %5
%71 = icmp sge i32 %70, 134217728
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = load i8**, i8*** %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8** %73
br label %82
74: ; preds = %69
%75 = load i32, i32* %5
%76 = icmp sge i32 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = load i8**, i8*** %6
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8** %78
br label %81
79: ; preds = %74
%80 = load i8**, i8*** %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %80
store i32 0, i32* %4
br label %94
81: ; preds = %77
br label %82
82: ; preds = %81, %72
br label %83
83: ; preds = %82, %67
br label %84
84: ; preds = %83, %62
br label %85
85: ; preds = %84, %57
br label %86
86: ; preds = %85, %52
br label %87
87: ; preds = %86, %47
br label %88
88: ; preds = %87, %42
br label %89
89: ; preds = %88, %37
br label %90
90: ; preds = %89, %32
br label %91
91: ; preds = %90, %27
br label %92
92: ; preds = %91, %22
br label %93
93: ; preds = %92, %17
store i32 1, i32* %4
br label %94
94: ; preds = %93, %79, %11
%95 = load i32, i32* %4
ret i32 %95
}

LLVM IR (-O2):
@.str = [82 x i8] c"ALL ERRFILE DEBUG UPDATE NOTE HINT WARNING SORRY MISHAP FAILURE FATAL ABORT NEVER\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"NEVER\00"
@.str.3 = [6 x i8] c"ABORT\00"
@.str.4 = [6 x i8] c"FATAL\00"
@.str.5 = [8 x i8] c"FAILURE\00"
@.str.6 = [7 x i8] c"MISHAP\00"
@.str.7 = [6 x i8] c"SORRY\00"
@.str.8 = [8 x i8] c"WARNING\00"
@.str.9 = [5 x i8] c"HINT\00"
@.str.10 = [5 x i8] c"NOTE\00"
@.str.11 = [7 x i8] c"UPDATE\00"
@.str.12 = [6 x i8] c"DEBUG\00"
@.str.13 = [8 x i8] c"ERRFILE\00"
@.str.14 = [4 x i8] c"ALL\00"
define i32 @libiso_msgs__sev_to_text(i32 %0, i8** nocapture writeonly %1, i32 %2) {
%4 = and i32 %2, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %35
6: ; preds = %3
%7 = icmp eq i32 %0, 2147483647
br i1 %7, label %35, label %8
8: ; preds = %6
%9 = icmp sgt i32 %0, 1895825407
br i1 %9, label %35, label %10
10: ; preds = %8
%11 = icmp sgt i32 %0, 1879048191
br i1 %11, label %35, label %12
12: ; preds = %10
%13 = icmp sgt i32 %0, 1744830463
br i1 %13, label %35, label %14
14: ; preds = %12
%15 = icmp sgt i32 %0, 1677721599
br i1 %15, label %35, label %16
16: ; preds = %14
%17 = icmp sgt i32 %0, 1610612735
br i1 %17, label %35, label %18
18: ; preds = %16
%19 = icmp sgt i32 %0, 1342177279
br i1 %19, label %35, label %20
20: ; preds = %18
%21 = icmp sgt i32 %0, 1073741823
br i1 %21, label %35, label %22
22: ; preds = %20
%23 = icmp sgt i32 %0, 805306367
br i1 %23, label %35, label %24
24: ; preds = %22
%25 = icmp sgt i32 %0, 536870911
br i1 %25, label %35, label %26
26: ; preds = %24
%27 = icmp sgt i32 %0, 268435455
br i1 %27, label %35, label %28
28: ; preds = %26
%29 = icmp sgt i32 %0, 134217727
br i1 %29, label %35, label %30
30: ; preds = %28
%31 = icmp sgt i32 %0, -1
%32 = select i1 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%33 = xor i32 %0, -1
%34 = lshr i32 %33, 31
br label %35
35: ; preds = %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %3
%36 = phi i8* [ getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %10 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %14 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), %22 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), %24 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %26 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), %28 ], [ %32, %30 ]
%37 = phi i32 [ 1, %3 ], [ 1, %6 ], [ 1, %8 ], [ 1, %10 ], [ 1, %12 ], [ 1, %14 ], [ 1, %16 ], [ 1, %18 ], [ 1, %20 ], [ 1, %22 ], [ 1, %24 ], [ 1, %26 ], [ 1, %28 ], [ %34, %30 ]
store i8* %36, i8** %1
ret i32 %37
}