#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char);
void write_is_info(FILE *fp, char class) {
  if (class != 'S' && class != 'W' && class != 'A' && class != 'B' &&
      class != 'C') {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<write_is_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
je     118d <write_is_info+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
je     118d <write_is_info+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
je     118d <write_is_info+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
je     118d <write_is_info+0x6d>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
je     118d <write_is_info+0x6d>
lea    0xe86(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_is_info>:
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1136 <write_is_info+0x16>
movzbl %al,%eax
mov    $0x440007,%ecx
bt     %rax,%rcx
jae    1136 <write_is_info+0x16>
ret
push   %rax
movsbl %sil,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
define void @write_is_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 83
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 87
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 65
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 66
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 67
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %25)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %20, %16, %12, %8, %2
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
define void @write_is_info(i32* nocapture readnone %0, i8 signext %1) {
switch i8 %1, label %3 [
i8 87, label %6
i8 83, label %6
i8 67, label %6
i8 66, label %6
i8 65, label %6
]
3: ; preds = %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2, %2, %2, %2, %2
ret void
}