#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 {
    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    120d <write_ep_info+0xdd>
movsbl -0xd(%rbp),%eax
cmp    $0x57,%eax
jne    1176 <write_ep_info+0x46>
movl   $0x19,-0x14(%rbp)
jmp    1208 <write_ep_info+0xd8>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jne    118f <write_ep_info+0x5f>
movl   $0x1c,-0x14(%rbp)
jmp    1203 <write_ep_info+0xd3>
movsbl -0xd(%rbp),%eax
cmp    $0x42,%eax
jne    11a8 <write_ep_info+0x78>
movl   $0x1e,-0x14(%rbp)
jmp    11fe <write_ep_info+0xce>
movsbl -0xd(%rbp),%eax
cmp    $0x43,%eax
jne    11c1 <write_ep_info+0x91>
movl   $0x20,-0x14(%rbp)
jmp    11f9 <write_ep_info+0xc9>
movsbl -0xd(%rbp),%eax
cmp    $0x44,%eax
jne    11da <write_ep_info+0xaa>
movl   $0x24,-0x14(%rbp)
jmp    11f4 <write_ep_info+0xc4>
lea    0xe1f(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11f9 <write_ep_info+0xc9>
jmp    11fe <write_ep_info+0xce>
jmp    1203 <write_ep_info+0xd3>
jmp    1208 <write_ep_info+0xd8>
jmp    120d <write_ep_info+0xdd>
mov    -0x8(%rbp),%rdi
lea    0xe1a(%rip),%rsi
lea    0xe26(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
movsbl -0xd(%rbp),%ecx
lea    0xe19(%rip),%rsi
lea    0xe09(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe1b(%rip),%rsi
lea    0xdf0(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe0d(%rip),%rsi
lea    0xdd0(%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     11f2 <write_ep_info+0xc2>
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    1188 <write_ep_info+0x58>
mov    $0x1e,%r15d
jmp    1188 <write_ep_info+0x58>
mov    $0x20,%r15d
jmp    1188 <write_ep_info+0x58>
mov    $0x24,%r15d
jmp    1188 <write_ep_info+0x58>
mov    $0x19,%r15d
movzbl %dl,%ebp
lea    0xefc(%rip),%rsi
lea    0xf08(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xefd(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf02(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf00(%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    0xe60(%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 %46
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 %45
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 %44
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 %43
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 %42
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 %41
37: ; preds = %32
%38 = load i8, i8* %6
%39 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %38)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %36
br label %42
42: ; preds = %41, %31
br label %43
43: ; preds = %42, %26
br label %44
44: ; preds = %43, %21
br label %45
45: ; preds = %44, %16
br label %46
46: ; preds = %45, %11
%47 = load i32*, i32** %4
%48 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %47, 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))
%49 = load i32*, i32** %4
%50 = load i8, i8* %6
%51 = sext i8 %50 to i32
%52 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %49, 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 %51)
%53 = load i32*, i32** %4
%54 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, 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))
%55 = load i32*, i32** %4
%56 = load i32, i32* %7
%57 = load i32, i32* %5
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %55, 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 %56, i32 %57)
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 %9 [
i8 83, label %12
i8 87, label %4
i8 65, label %5
i8 66, label %6
i8 67, label %7
i8 68, label %8
]
4: ; preds = %3
br label %12
5: ; preds = %3
br label %12
6: ; preds = %3
br label %12
7: ; preds = %3
br label %12
8: ; preds = %3
br label %12
9: ; preds = %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3, %4, %6, %8, %7, %5
%13 = phi i32 [ 25, %4 ], [ 28, %5 ], [ 30, %6 ], [ 32, %7 ], [ 36, %8 ], [ 24, %3 ]
%14 = zext i8 %2 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 ([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))
%18 = 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 %13, i32 %1)
ret void
}