#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_bt_info(FILE *fp, char class) {
  int problem_size, niter;
  char *dt;
  if (class == 'S') {
    problem_size = 12;
    dt = "0.010d0";
    niter = 60;
  } else if (class == 'W') {
    problem_size = 24;
    dt = "0.0008d0";
    niter = 200;
  } else if (class == 'A') {
    problem_size = 64;
    dt = "0.0008d0";
    niter = 200;
  } else if (class == 'B') {
    problem_size = 102;
    dt = "0.0003d0";
    niter = 200;
  } else if (class == 'C') {
    problem_size = 162;
    dt = "0.0001d0";
    niter = 200;
  } else if (class == 'D') {
    problem_size = 408;
    dt = "0.00002d0";
    niter = 250;
  } else if (class == 'E') {
    problem_size = 1020;
    dt = "0.4d-5";
    niter = 250;
  } else {
    printf("setparams: Internal error: invalid class %c\n", class);
    exit(1);
  }
  fprintf(fp, "%sinteger problem_size, niter_default\n", "        ");
  fprintf(fp, "%sparameter (problem_size=%d, niter_default=%d)\n", "        ",
          problem_size, niter);
  fprintf(fp, "%sdouble precision dt_default\n", "        ");
  fprintf(fp, "%sparameter (dt_default = %s)\n", "        ", dt);
}


x86 assembly (clang, -O0):
<write_bt_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
jne    116d <write_bt_info+0x3d>
movl   $0xc,-0x10(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x3c,-0x14(%rbp)
jmp    12a7 <write_bt_info+0x177>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1198 <write_bt_info+0x68>
movl   $0x18,-0x10(%rbp)
lea    0xe80(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xc8,-0x14(%rbp)
jmp    12a2 <write_bt_info+0x172>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    11c3 <write_bt_info+0x93>
movl   $0x40,-0x10(%rbp)
lea    0xe55(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xc8,-0x14(%rbp)
jmp    129d <write_bt_info+0x16d>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11ee <write_bt_info+0xbe>
movl   $0x66,-0x10(%rbp)
lea    0xe33(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xc8,-0x14(%rbp)
jmp    1298 <write_bt_info+0x168>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    1219 <write_bt_info+0xe9>
movl   $0xa2,-0x10(%rbp)
lea    0xe11(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xc8,-0x14(%rbp)
jmp    1293 <write_bt_info+0x163>
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
jne    1244 <write_bt_info+0x114>
movl   $0x198,-0x10(%rbp)
lea    0xdef(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xfa,-0x14(%rbp)
jmp    128e <write_bt_info+0x15e>
movsbl -0x9(%rbp),%eax
cmp    $0x45,%eax
jne    126f <write_bt_info+0x13f>
movl   $0x3fc,-0x10(%rbp)
lea    0xdce(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0xfa,-0x14(%rbp)
jmp    1289 <write_bt_info+0x159>
lea    0xdbe(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    128e <write_bt_info+0x15e>
jmp    1293 <write_bt_info+0x163>
jmp    1298 <write_bt_info+0x168>
jmp    129d <write_bt_info+0x16d>
jmp    12a2 <write_bt_info+0x172>
jmp    12a7 <write_bt_info+0x177>
mov    -0x8(%rbp),%rdi
lea    0xdaf(%rip),%rsi
lea    0xdcf(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xdbf(%rip),%rsi
lea    0xdaf(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdd7(%rip),%rsi
lea    0xd96(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
lea    0xdd9(%rip),%rsi
lea    0xd79(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bt_info>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1250 <write_bt_info+0x120>
mov    %rdi,%rbx
lea    0xf0f(%rip),%r14
mov    $0x3c,%r15d
mov    $0xc,%r12d
movzbl %al,%eax
lea    0xe9d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef1(%rip),%r14
mov    $0xc8,%r15d
mov    $0x40,%r12d
jmp    11e8 <write_bt_info+0xb8>
lea    0xee5(%rip),%r14
mov    $0xc8,%r15d
mov    $0x66,%r12d
jmp    11e8 <write_bt_info+0xb8>
lea    0xed9(%rip),%r14
mov    $0xc8,%r15d
mov    $0xa2,%r12d
jmp    11e8 <write_bt_info+0xb8>
lea    0xecd(%rip),%r14
mov    $0xfa,%r15d
mov    $0x198,%r12d
jmp    11e8 <write_bt_info+0xb8>
lea    0xec2(%rip),%r14
mov    $0xfa,%r15d
mov    $0x3fc,%r12d
jmp    11e8 <write_bt_info+0xb8>
lea    0xe88(%rip),%r14
mov    $0xc8,%r15d
mov    $0x18,%r12d
lea    0xece(%rip),%rsi
lea    0xeee(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xefa(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf05(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0.010d0\00"
@.str.1 = [9 x i8] c"0.0008d0\00"
@.str.2 = [9 x i8] c"0.0003d0\00"
@.str.3 = [9 x i8] c"0.0001d0\00"
@.str.4 = [10 x i8] c"0.00002d0\00"
@.str.5 = [7 x i8] c"0.4d-5\00"
@.str.6 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.7 = [39 x i8] c"%sinteger problem_size, niter_default\0A\00"
@.str.8 = [9 x i8] c" \00"
@.str.9 = [49 x i8] c"%sparameter (problem_size=%d, niter_default=%d)\0A\00"
@.str.10 = [31 x i8] c"%sdouble precision dt_default\0A\00"
@.str.11 = [31 x i8] c"%sparameter (dt_default = %s)\0A\00"
define void @write_bt_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %3
store i8 %1, i8* %4
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 83
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 12, i32* %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 60, i32* %6
br label %52
12: ; preds = %2
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 87
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 24, i32* %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i32 200, i32* %6
br label %51
17: ; preds = %12
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 65
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 64, i32* %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i32 200, i32* %6
br label %50
22: ; preds = %17
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 66
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 102, i32* %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %7
store i32 200, i32* %6
br label %49
27: ; preds = %22
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 67
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 162, i32* %5
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %7
store i32 200, i32* %6
br label %48
32: ; preds = %27
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 68
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 408, i32* %5
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8** %7
store i32 250, i32* %6
br label %47
37: ; preds = %32
%38 = load i8, i8* %4
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 69
br i1 %40, label %41, label %42
41: ; preds = %37
store i32 1020, i32* %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %7
store i32 250, i32* %6
br label %46
42: ; preds = %37
%43 = load i8, i8* %4
%44 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.6, 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** %3
%54 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%55 = load i32*, i32** %3
%56 = load i32, i32* %5
%57 = load i32, i32* %6
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %56, i32 %57)
%59 = load i32*, i32** %3
%60 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%61 = load i32*, i32** %3
%62 = load i8*, i8** %7
%63 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %62)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.010d0\00"
@.str.1 = [9 x i8] c"0.0008d0\00"
@.str.2 = [9 x i8] c"0.0003d0\00"
@.str.3 = [9 x i8] c"0.0001d0\00"
@.str.4 = [10 x i8] c"0.00002d0\00"
@.str.5 = [7 x i8] c"0.4d-5\00"
@.str.6 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.7 = [39 x i8] c"%sinteger problem_size, niter_default\0A\00"
@.str.8 = [9 x i8] c" \00"
@.str.9 = [49 x i8] c"%sparameter (problem_size=%d, niter_default=%d)\0A\00"
@.str.10 = [31 x i8] c"%sdouble precision dt_default\0A\00"
@.str.11 = [31 x i8] c"%sparameter (dt_default = %s)\0A\00"
define void @write_bt_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 ([45 x i8], [45 x i8]* @.str.6, 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 [ 24, %3 ], [ 64, %4 ], [ 102, %5 ], [ 162, %6 ], [ 408, %7 ], [ 1020, %8 ], [ 12, %2 ]
%14 = phi i32 [ 200, %3 ], [ 200, %4 ], [ 200, %5 ], [ 200, %6 ], [ 250, %7 ], [ 250, %8 ], [ 60, %2 ]
%15 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %2 ]
%16 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %13, i32 %14)
%18 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%19 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %15)
ret void
}