#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, int nprocs, 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, npm\n", "        ");
  fprintf(fp, "%sparameter (m=%d, npm=%d)\n", "        ", m, nprocs);
}


x86 assembly (clang, -O0):
<write_ep_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x53,%eax
jne    115d <write_ep_info+0x2d>
movl   $0x18,-0x14(%rbp)
jmp    122b <write_ep_info+0xfb>
movsbl -0xd(%rbp),%eax
cmp    $0x57,%eax
jne    1176 <write_ep_info+0x46>
movl   $0x19,-0x14(%rbp)
jmp    1226 <write_ep_info+0xf6>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jne    118f <write_ep_info+0x5f>
movl   $0x1c,-0x14(%rbp)
jmp    1221 <write_ep_info+0xf1>
movsbl -0xd(%rbp),%eax
cmp    $0x42,%eax
jne    11a8 <write_ep_info+0x78>
movl   $0x1e,-0x14(%rbp)
jmp    121c <write_ep_info+0xec>
movsbl -0xd(%rbp),%eax
cmp    $0x43,%eax
jne    11c1 <write_ep_info+0x91>
movl   $0x20,-0x14(%rbp)
jmp    1217 <write_ep_info+0xe7>
movsbl -0xd(%rbp),%eax
cmp    $0x44,%eax
jne    11da <write_ep_info+0xaa>
movl   $0x24,-0x14(%rbp)
jmp    1212 <write_ep_info+0xe2>
movsbl -0xd(%rbp),%eax
cmp    $0x45,%eax
jne    11f3 <write_ep_info+0xc3>
movl   $0x28,-0x14(%rbp)
jmp    120d <write_ep_info+0xdd>
lea    0xe06(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1212 <write_ep_info+0xe2>
jmp    1217 <write_ep_info+0xe7>
jmp    121c <write_ep_info+0xec>
jmp    1221 <write_ep_info+0xf1>
jmp    1226 <write_ep_info+0xf6>
jmp    122b <write_ep_info+0xfb>
mov    -0x8(%rbp),%rdi
lea    0xdfc(%rip),%rsi
lea    0xe08(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0xd(%rbp),%ecx
lea    0xdfb(%rip),%rsi
lea    0xdeb(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdfd(%rip),%rsi
lea    0xdd2(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xdef(%rip),%rsi
lea    0xdb2(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ep_info>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    -0x41(%rdx),%eax
cmp    $0x16,%al
ja     11fa <write_ep_info+0xca>
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x18,%r15d
movzbl %al,%eax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1c,%r15d
jmp    1190 <write_ep_info+0x60>
mov    $0x1e,%r15d
jmp    1190 <write_ep_info+0x60>
mov    $0x20,%r15d
jmp    1190 <write_ep_info+0x60>
mov    $0x24,%r15d
jmp    1190 <write_ep_info+0x60>
mov    $0x28,%r15d
jmp    1190 <write_ep_info+0x60>
mov    $0x19,%r15d
movzbl %dl,%ebp
lea    0xef4(%rip),%rsi
lea    0xf00(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef5(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xefa(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %dl,%esi
lea    0xe58(%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 = [18 x i8] c"%sinteger m, npm\0A\00"
@.str.5 = [28 x i8] c"%sparameter (m=%d, npm=%d)\0A\00"
define void @write_ep_info(i32* %0, i32 %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 83
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 24, i32* %7
br label %52
12: ; preds = %3
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 87
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 25, i32* %7
br label %51
17: ; preds = %12
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 65
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 28, i32* %7
br label %50
22: ; preds = %17
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 66
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 30, i32* %7
br label %49
27: ; preds = %22
%28 = load i8, i8* %6
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 67
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 32, i32* %7
br label %48
32: ; preds = %27
%33 = load i8, i8* %6
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 68
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 36, i32* %7
br label %47
37: ; preds = %32
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 69
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 40, i32* %7
br label %46
42: ; preds = %37
%43 = load i8, i8* %6
%44 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %43)
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %41
br label %47
47: ; preds = %46, %36
br label %48
48: ; preds = %47, %31
br label %49
49: ; preds = %48, %26
br label %50
50: ; preds = %49, %21
br label %51
51: ; preds = %50, %16
br label %52
52: ; preds = %51, %11
%53 = load i32*, i32** %4
%54 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, 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))
%55 = load i32*, i32** %4
%56 = load i8, i8* %6
%57 = sext i8 %56 to i32
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %55, 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 %57)
%59 = load i32*, i32** %4
%60 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%61 = load i32*, i32** %4
%62 = load i32, i32* %7
%63 = load i32, i32* %5
%64 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %62, i32 %63)
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 = [18 x i8] c"%sinteger m, npm\0A\00"
@.str.5 = [28 x i8] c"%sparameter (m=%d, npm=%d)\0A\00"
define void @write_ep_info(i32* nocapture %0, i32 %1, i8 signext %2) {
switch i8 %2, label %10 [
i8 83, label %13
i8 87, label %4
i8 65, label %5
i8 66, label %6
i8 67, label %7
i8 68, label %8
i8 69, label %9
]
4: ; preds = %3
br label %13
5: ; preds = %3
br label %13
6: ; preds = %3
br label %13
7: ; preds = %3
br label %13
8: ; preds = %3
br label %13
9: ; preds = %3
br label %13
10: ; preds = %3
%11 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %3, %4, %6, %8, %9, %7, %5
%14 = phi i32 [ 25, %4 ], [ 28, %5 ], [ 30, %6 ], [ 32, %7 ], [ 36, %8 ], [ 40, %9 ], [ 24, %3 ]
%15 = zext i8 %2 to i32
%16 = 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))
%17 = 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 %15)
%18 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %1)
ret void
}