#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 *, char *, ...);
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, "%scharacter class\n", "        ");
  fprintf(fp, "%sparameter (class =\'%c\')\n", "        ", class);
  fprintf(fp, "%sinteger m\n", "        ");
  fprintf(fp, "%sparameter (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
lea    0xdfe(%rip),%rsi
lea    0xe0a(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%ecx
lea    0xdfd(%rip),%rsi
lea    0xded(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdff(%rip),%rsi
lea    0xdd4(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
lea    0xdf0(%rip),%rsi
lea    0xdb8(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ep_info>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     11f6 <write_ep_info+0xc6>
mov    %rdi,%rbx
mov    $0x18,%r14d
movzbl %al,%eax
lea    0xeab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1c,%r14d
jmp    118c <write_ep_info+0x5c>
mov    $0x1e,%r14d
jmp    118c <write_ep_info+0x5c>
mov    $0x20,%r14d
jmp    118c <write_ep_info+0x5c>
mov    $0x24,%r14d
jmp    118c <write_ep_info+0x5c>
mov    $0x28,%r14d
jmp    118c <write_ep_info+0x5c>
mov    $0x19,%r14d
movzbl %sil,%ebp
lea    0xef7(%rip),%rsi
lea    0xf03(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xefd(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xe5b(%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 = [19 x i8] c"%scharacter class\0A\00"
@.str.2 = [9 x i8] c" \00"
@.str.3 = [27 x i8] c"%sparameter (class ='%c')\0A\00"
@.str.4 = [13 x i8] c"%sinteger m\0A\00"
@.str.5 = [20 x i8] c"%sparameter (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 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%53 = load i32*, i32** %3
%54 = load i8, i8* %4
%55 = sext i8 %54 to i32
%56 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = load i32*, i32** %3
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32*, i32** %3
%60 = load i32, i32* %5
%61 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %60)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.1 = [19 x i8] c"%scharacter class\0A\00"
@.str.2 = [9 x i8] c" \00"
@.str.3 = [27 x i8] c"%sparameter (class ='%c')\0A\00"
@.str.4 = [13 x i8] c"%sinteger m\0A\00"
@.str.5 = [20 x i8] c"%sparameter (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 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%17 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret void
}