#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 {
    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    11ed <write_ep_info+0xbd>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1174 <write_ep_info+0x44>
movl   $0x19,-0x10(%rbp)
jmp    11e8 <write_ep_info+0xb8>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    118d <write_ep_info+0x5d>
movl   $0x1c,-0x10(%rbp)
jmp    11e3 <write_ep_info+0xb3>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11a6 <write_ep_info+0x76>
movl   $0x1e,-0x10(%rbp)
jmp    11de <write_ep_info+0xae>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    11bf <write_ep_info+0x8f>
movl   $0x20,-0x10(%rbp)
jmp    11d9 <write_ep_info+0xa9>
lea    0xe3a(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11de <write_ep_info+0xae>
jmp    11e3 <write_ep_info+0xb3>
jmp    11e8 <write_ep_info+0xb8>
jmp    11ed <write_ep_info+0xbd>
mov    -0x8(%rbp),%rdi
lea    0xe3a(%rip),%rsi
lea    0xe46(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%ecx
lea    0xe39(%rip),%rsi
lea    0xe29(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3b(%rip),%rsi
lea    0xe10(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
lea    0xe2c(%rip),%rsi
lea    0xdf4(%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     11e6 <write_ep_info+0xb6>
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    117c <write_ep_info+0x4c>
mov    $0x1e,%r14d
jmp    117c <write_ep_info+0x4c>
mov    $0x20,%r14d
jmp    117c <write_ep_info+0x4c>
mov    $0x19,%r14d
movzbl %sil,%ebp
lea    0xf07(%rip),%rsi
lea    0xf13(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf08(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf0d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf06(%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    0xe6b(%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 %38
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 %37
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 %36
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 %35
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 %34
30: ; preds = %25
%31 = load i8, i8* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %31)
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %29
br label %35
35: ; preds = %34, %24
br label %36
36: ; preds = %35, %19
br label %37
37: ; preds = %36, %14
br label %38
38: ; preds = %37, %9
%39 = load i32*, i32** %3
%40 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %39, 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))
%41 = load i32*, i32** %3
%42 = load i8, i8* %4
%43 = sext i8 %42 to i32
%44 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %41, 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 %43)
%45 = load i32*, i32** %3
%46 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %45, 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))
%47 = load i32*, i32** %3
%48 = load i32, i32* %5
%49 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %47, 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 %48)
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 %7 [
i8 83, label %10
i8 87, label %3
i8 65, label %4
i8 66, label %5
i8 67, label %6
]
3: ; preds = %2
br label %10
4: ; preds = %2
br label %10
5: ; preds = %2
br label %10
6: ; preds = %2
br label %10
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2, %3, %5, %6, %4
%11 = phi i32 [ 25, %3 ], [ 28, %4 ], [ 30, %5 ], [ 32, %6 ], [ 24, %2 ]
%12 = zext i8 %1 to i32
%13 = 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))
%14 = 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 %12)
%15 = 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))
%16 = 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 %11)
ret void
}