#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 strlen(char *);
int ic_parse_wkst(char *_in) {
  if (!_in || strlen(_in) != 2)
    goto error;
  switch (_in[0]) {
  case 's':
  case 'S':
    switch (_in[1]) {
    case 'a':
    case 'A':
      return 6;
    case 'u':
    case 'U':
      return 0;
    default:
      goto error;
    }
  case 'm':
  case 'M':
    if (_in[1] != 'o' && _in[1] != 'O')
      goto error;
    return 1;
  case 't':
  case 'T':
    switch (_in[1]) {
    case 'h':
    case 'H':
      return 4;
    case 'u':
    case 'U':
      return 2;
    default:
      goto error;
    }
  case 'w':
  case 'W':
    if (_in[1] != 'e' && _in[1] != 'E')
      goto error;
    return 3;
  case 'f':
  case 'F':
    if (_in[1] != 'r' && _in[1] != 'R')
      goto error;
    return 5;
    break;
  default:
    goto error;
  }
error:
  return 1;
}


x86 assembly (clang, -O0):
<ic_parse_wkst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <ic_parse_wkst+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
je     113e <ic_parse_wkst+0x2e>
jmp    12db <ic_parse_wkst+0x1cb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffba,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x31,%eax
ja     12d6 <ic_parse_wkst+0x1c6>
mov    -0x18(%rbp),%rax
lea    0xe9e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x41,%eax
je     11b7 <ic_parse_wkst+0xa7>
jmp    1184 <ic_parse_wkst+0x74>
mov    -0x1c(%rbp),%eax
sub    $0x55,%eax
je     11c3 <ic_parse_wkst+0xb3>
jmp    1195 <ic_parse_wkst+0x85>
mov    -0x1c(%rbp),%eax
sub    $0x61,%eax
je     11b7 <ic_parse_wkst+0xa7>
jmp    11a6 <ic_parse_wkst+0x96>
mov    -0x1c(%rbp),%eax
sub    $0x75,%eax
je     11c3 <ic_parse_wkst+0xb3>
jmp    11cf <ic_parse_wkst+0xbf>
movl   $0x6,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
movl   $0x0,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
jmp    12db <ic_parse_wkst+0x1cb>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
je     11fb <ic_parse_wkst+0xeb>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4f,%eax
je     11fb <ic_parse_wkst+0xeb>
jmp    12db <ic_parse_wkst+0x1cb>
movl   $0x1,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x20(%rbp)
sub    $0x48,%eax
je     1253 <ic_parse_wkst+0x143>
jmp    1220 <ic_parse_wkst+0x110>
mov    -0x20(%rbp),%eax
sub    $0x55,%eax
je     125f <ic_parse_wkst+0x14f>
jmp    1231 <ic_parse_wkst+0x121>
mov    -0x20(%rbp),%eax
sub    $0x68,%eax
je     1253 <ic_parse_wkst+0x143>
jmp    1242 <ic_parse_wkst+0x132>
mov    -0x20(%rbp),%eax
sub    $0x75,%eax
je     125f <ic_parse_wkst+0x14f>
jmp    126b <ic_parse_wkst+0x15b>
movl   $0x4,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
movl   $0x2,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
jmp    12db <ic_parse_wkst+0x1cb>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x65,%eax
je     1297 <ic_parse_wkst+0x187>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x45,%eax
je     1297 <ic_parse_wkst+0x187>
jmp    12db <ic_parse_wkst+0x1cb>
movl   $0x3,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x72,%eax
je     12ca <ic_parse_wkst+0x1ba>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x52,%eax
je     12ca <ic_parse_wkst+0x1ba>
jmp    12db <ic_parse_wkst+0x1cb>
movl   $0x5,-0x4(%rbp)
jmp    12e2 <ic_parse_wkst+0x1d2>
jmp    12db <ic_parse_wkst+0x1cb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_parse_wkst>:
push   %rbx
test   %rdi,%rdi
je     11cb <ic_parse_wkst+0xbb>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    11cb <ic_parse_wkst+0xbb>
movsbl (%rbx),%ecx
add    $0xffffffba,%ecx
cmp    $0x31,%ecx
ja     11cb <ic_parse_wkst+0xbb>
mov    $0x1,%eax
lea    0xeba(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    0x1(%rbx),%al
and    $0xdf,%al
xor    %ecx,%ecx
cmp    $0x52,%al
sete   %cl
lea    0x1(,%rcx,4),%eax
pop    %rbx
ret
movsbl 0x1(%rbx),%ecx
mov    $0x6,%eax
cmp    $0x60,%ecx
jg     11ac <ic_parse_wkst+0x9c>
cmp    $0x41,%ecx
je     1162 <ic_parse_wkst+0x52>
cmp    $0x55,%ecx
je     11b6 <ic_parse_wkst+0xa6>
jmp    11cb <ic_parse_wkst+0xbb>
movsbl 0x1(%rbx),%ecx
mov    $0x4,%eax
cmp    $0x67,%ecx
jg     11ba <ic_parse_wkst+0xaa>
cmp    $0x48,%ecx
je     1162 <ic_parse_wkst+0x52>
cmp    $0x55,%ecx
je     11c4 <ic_parse_wkst+0xb4>
jmp    11cb <ic_parse_wkst+0xbb>
mov    0x1(%rbx),%al
and    $0xdf,%al
xor    %ecx,%ecx
cmp    $0x45,%al
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0x1,%eax
pop    %rbx
ret
cmp    $0x61,%ecx
je     1162 <ic_parse_wkst+0x52>
cmp    $0x75,%ecx
jne    11cb <ic_parse_wkst+0xbb>
xor    %eax,%eax
pop    %rbx
ret
cmp    $0x68,%ecx
je     1162 <ic_parse_wkst+0x52>
cmp    $0x75,%ecx
jne    11cb <ic_parse_wkst+0xbb>
mov    $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ic_parse_wkst(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6, %1
br label %75
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
switch i32 %15, label %74 [
i32 115, label %16
i32 83, label %16
i32 109, label %24
i32 77, label %24
i32 116, label %38
i32 84, label %38
i32 119, label %46
i32 87, label %46
i32 102, label %60
i32 70, label %60
]
16: ; preds = %11, %11
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %23 [
i32 97, label %21
i32 65, label %21
i32 117, label %22
i32 85, label %22
]
21: ; preds = %16, %16
store i32 6, i32* %2
br label %76
22: ; preds = %16, %16
store i32 0, i32* %2
br label %76
23: ; preds = %16
br label %75
24: ; preds = %11, %11
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 111
br i1 %29, label %30, label %37
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 79
br i1 %35, label %36, label %37
36: ; preds = %30
br label %75
37: ; preds = %30, %24
store i32 1, i32* %2
br label %76
38: ; preds = %11, %11
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
switch i32 %42, label %45 [
i32 104, label %43
i32 72, label %43
i32 117, label %44
i32 85, label %44
]
43: ; preds = %38, %38
store i32 4, i32* %2
br label %76
44: ; preds = %38, %38
store i32 2, i32* %2
br label %76
45: ; preds = %38
br label %75
46: ; preds = %11, %11
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 101
br i1 %51, label %52, label %59
52: ; preds = %46
%53 = load i8*, i8** %3
%54 = getelementptr inbounds i8, i8* %53, i64 1
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 69
br i1 %57, label %58, label %59
58: ; preds = %52
br label %75
59: ; preds = %52, %46
store i32 3, i32* %2
br label %76
60: ; preds = %11, %11
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i64 1
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp ne i32 %64, 114
br i1 %65, label %66, label %73
66: ; preds = %60
%67 = load i8*, i8** %3
%68 = getelementptr inbounds i8, i8* %67, i64 1
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 82
br i1 %71, label %72, label %73
72: ; preds = %66
br label %75
73: ; preds = %66, %60
store i32 5, i32* %2
br label %76
74: ; preds = %11
br label %75
75: ; preds = %74, %72, %58, %45, %36, %23, %10
store i32 1, i32* %2
br label %76
76: ; preds = %75, %73, %59, %44, %43, %37, %22, %21
%77 = load i32, i32* %2
ret i32 %77
}

LLVM IR (-O2):
define i32 @ic_parse_wkst(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %31, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %31
6: ; preds = %3
%7 = load i8, i8* %0
%8 = sext i8 %7 to i32
switch i32 %8, label %31 [
i32 115, label %9
i32 83, label %9
i32 109, label %32
i32 77, label %32
i32 116, label %14
i32 84, label %14
i32 119, label %19
i32 87, label %19
i32 102, label %25
i32 70, label %25
]
9: ; preds = %6, %6
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %31 [
i32 97, label %32
i32 65, label %32
i32 117, label %13
i32 85, label %13
]
13: ; preds = %9, %9
br label %32
14: ; preds = %6, %6
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %31 [
i32 104, label %32
i32 72, label %32
i32 117, label %18
i32 85, label %18
]
18: ; preds = %14, %14
br label %32
19: ; preds = %6, %6
%20 = getelementptr inbounds i8, i8* %0, i64 1
%21 = load i8, i8* %20
%22 = and i8 %21, -33
%23 = icmp eq i8 %22, 69
%24 = select i1 %23, i32 3, i32 1
br label %32
25: ; preds = %6, %6
%26 = getelementptr inbounds i8, i8* %0, i64 1
%27 = load i8, i8* %26
%28 = and i8 %27, -33
%29 = icmp eq i8 %28, 82
%30 = select i1 %29, i32 5, i32 1
br label %32
31: ; preds = %6, %14, %9, %1, %3
br label %32
32: ; preds = %6, %6, %25, %19, %14, %14, %9, %9, %31, %18, %13
%33 = phi i32 [ 1, %31 ], [ 2, %18 ], [ 0, %13 ], [ 6, %9 ], [ 6, %9 ], [ 4, %14 ], [ 4, %14 ], [ %24, %19 ], [ %30, %25 ], [ 1, %6 ], [ 1, %6 ]
ret i32 %33
}