#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*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ printf(char *, char);
void write_ep_info(FILE *fp, char class) {
  int m;
  if (class == 'S') {
    m = 24;
  } else if (class == 'W') {
    m = 25;
  } else if (class == 'A') {
    m = 28;
  } else if (class == 'B') {
    m = 30;
  } else if (class == 'C') {
    m = 32;
  } else if (class == 'D') {
    m = 36;
  } else if (class == 'E') {
    m = 40;
  } else {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  fprintf(fp, "#define CLASS  \'%c\'\n", class);
  fprintf(fp, "#define M      %d\n", m);
}


x86 assembly (clang, -O0):
<write_ep_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
jne    115b <write_ep_info+0x2b>
movl   $0x18,-0x10(%rbp)
jmp    1229 <write_ep_info+0xf9>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1174 <write_ep_info+0x44>
movl   $0x19,-0x10(%rbp)
jmp    1224 <write_ep_info+0xf4>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    118d <write_ep_info+0x5d>
movl   $0x1c,-0x10(%rbp)
jmp    121f <write_ep_info+0xef>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11a6 <write_ep_info+0x76>
movl   $0x1e,-0x10(%rbp)
jmp    121a <write_ep_info+0xea>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    11bf <write_ep_info+0x8f>
movl   $0x20,-0x10(%rbp)
jmp    1215 <write_ep_info+0xe5>
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
jne    11d8 <write_ep_info+0xa8>
movl   $0x24,-0x10(%rbp)
jmp    1210 <write_ep_info+0xe0>
movsbl -0x9(%rbp),%eax
cmp    $0x45,%eax
jne    11f1 <write_ep_info+0xc1>
movl   $0x28,-0x10(%rbp)
jmp    120b <write_ep_info+0xdb>
lea    0xe08(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1210 <write_ep_info+0xe0>
jmp    1215 <write_ep_info+0xe5>
jmp    121a <write_ep_info+0xea>
jmp    121f <write_ep_info+0xef>
jmp    1224 <write_ep_info+0xf4>
jmp    1229 <write_ep_info+0xf9>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%edx
lea    0xdfa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xdfc(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ep_info>:
push   %rbp
push   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     11a7 <write_ep_info+0x77>
mov    %rdi,%rbx
mov    $0x18,%ebp
movzbl %al,%eax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1c,%ebp
jmp    117d <write_ep_info+0x4d>
mov    $0x1e,%ebp
jmp    117d <write_ep_info+0x4d>
mov    $0x20,%ebp
jmp    117d <write_ep_info+0x4d>
mov    $0x24,%ebp
jmp    117d <write_ep_info+0x4d>
mov    $0x28,%ebp
jmp    117d <write_ep_info+0x4d>
mov    $0x19,%ebp
movzbl %sil,%edx
lea    0xf06(%rip),%rsi
mov    %rbx,%rdi
call   1040 <fprintf@plt>
lea    0xf0c(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.1 = [21 x i8] c"#define CLASS '%c'\0A\00"
@.str.2 = [19 x i8] c"#define M %d\0A\00"
define void @write_ep_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 83
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 24, i32* %5
br label %50
10: ; preds = %2
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 87
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 25, i32* %5
br label %49
15: ; preds = %10
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 65
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 28, i32* %5
br label %48
20: ; preds = %15
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 66
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 30, i32* %5
br label %47
25: ; preds = %20
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 67
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 32, i32* %5
br label %46
30: ; preds = %25
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 68
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 36, i32* %5
br label %45
35: ; preds = %30
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 69
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 40, i32* %5
br label %44
40: ; preds = %35
%41 = load i8, i8* %4
%42 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %41)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %39
br label %45
45: ; preds = %44, %34
br label %46
46: ; preds = %45, %29
br label %47
47: ; preds = %46, %24
br label %48
48: ; preds = %47, %19
br label %49
49: ; preds = %48, %14
br label %50
50: ; preds = %49, %9
%51 = load i32*, i32** %3
%52 = load i8, i8* %4
%53 = sext i8 %52 to i32
%54 = call i32 @fprintf(i32* %51, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = load i32*, i32** %3
%56 = load i32, i32* %5
%57 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %56)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.1 = [21 x i8] c"#define CLASS '%c'\0A\00"
@.str.2 = [19 x i8] c"#define M %d\0A\00"
define void @write_ep_info(i32* nocapture %0, i8 signext %1) {
switch i8 %1, label %9 [
i8 83, label %12
i8 87, label %3
i8 65, label %4
i8 66, label %5
i8 67, label %6
i8 68, label %7
i8 69, label %8
]
3: ; preds = %2
br label %12
4: ; preds = %2
br label %12
5: ; preds = %2
br label %12
6: ; preds = %2
br label %12
7: ; preds = %2
br label %12
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2, %3, %5, %7, %8, %6, %4
%13 = phi i32 [ 25, %3 ], [ 28, %4 ], [ 30, %5 ], [ 32, %6 ], [ 36, %7 ], [ 40, %8 ], [ 24, %2 ]
%14 = zext i8 %1 to i32
%15 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret void
}