#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 *, ...);
int /*<<< orphan*/ printf(char *, char);
void write_lu_info(FILE *fp, char class) {
  int isiz1, isiz2, itmax, inorm, problem_size;
  char *dt_default;
  if (class == 'S') {
    problem_size = 12;
    dt_default = "0.5d0";
    itmax = 50;
  } else if (class == 'W') {
    problem_size = 33;
    dt_default = "1.5d-3";
    itmax = 300;
  } else if (class == 'A') {
    problem_size = 64;
    dt_default = "2.0d0";
    itmax = 250;
  } else if (class == 'B') {
    problem_size = 102;
    dt_default = "2.0d0";
    itmax = 250;
  } else if (class == 'C') {
    problem_size = 162;
    dt_default = "2.0d0";
    itmax = 250;
  } else if (class == 'D') {
    problem_size = 408;
    dt_default = "1.0d0";
    itmax = 300;
  } else if (class == 'E') {
    problem_size = 1020;
    dt_default = "0.5d0";
    itmax = 300;
  } else {
    printf("setparams: Internal error: invalid class %c\n", class);
    exit(1);
  }
  inorm = itmax;
  isiz1 = problem_size;
  isiz2 = problem_size;
  fprintf(fp, "\nc full problem size\n");
  fprintf(fp, "%sinteger isiz1, isiz2, isiz3\n", "        ");
  fprintf(fp, "%sparameter (isiz1=%d, isiz2=%d, isiz3=%d)\n", "        ", isiz1,
          isiz2, problem_size);
  fprintf(fp, "\nc number of iterations and how often to print the norm\n");
  fprintf(fp, "%sinteger itmax_default, inorm_default\n", "        ");
  fprintf(fp, "%sparameter (itmax_default=%d, inorm_default=%d)\n", "        ",
          itmax, inorm);
  fprintf(fp, "%sdouble precision dt_default\n", "        ");
  fprintf(fp, "%sparameter (dt_default = %s)\n", "        ", dt_default);
}


x86 assembly (clang, -O0):
<write_lu_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
jne    116d <write_lu_info+0x3d>
movl   $0xc,-0x20(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x32,-0x18(%rbp)
jmp    12a7 <write_lu_info+0x177>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1198 <write_lu_info+0x68>
movl   $0x21,-0x20(%rbp)
lea    0xe7e(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x12c,-0x18(%rbp)
jmp    12a2 <write_lu_info+0x172>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    11c3 <write_lu_info+0x93>
movl   $0x40,-0x20(%rbp)
lea    0xe5a(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    129d <write_lu_info+0x16d>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11ee <write_lu_info+0xbe>
movl   $0x66,-0x20(%rbp)
lea    0xe2f(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    1298 <write_lu_info+0x168>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    1219 <write_lu_info+0xe9>
movl   $0xa2,-0x20(%rbp)
lea    0xe04(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    1293 <write_lu_info+0x163>
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
jne    1244 <write_lu_info+0x114>
movl   $0x198,-0x20(%rbp)
lea    0xddf(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x12c,-0x18(%rbp)
jmp    128e <write_lu_info+0x15e>
movsbl -0x9(%rbp),%eax
cmp    $0x45,%eax
jne    126f <write_lu_info+0x13f>
movl   $0x3fc,-0x20(%rbp)
lea    0xda1(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x12c,-0x18(%rbp)
jmp    1289 <write_lu_info+0x159>
lea    0xda3(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    128e <write_lu_info+0x15e>
jmp    1293 <write_lu_info+0x163>
jmp    1298 <write_lu_info+0x168>
jmp    129d <write_lu_info+0x16d>
jmp    12a2 <write_lu_info+0x172>
jmp    12a7 <write_lu_info+0x177>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd86(%rip),%rsi
lea    0xd9e(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xd8a(%rip),%rsi
lea    0xd7a(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc4(%rip),%rsi
lea    0xd4f(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xdcc(%rip),%rsi
lea    0xd2f(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xde5(%rip),%rsi
lea    0xd16(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rcx
lea    0xde7(%rip),%rsi
lea    0xcf9(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lu_info>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     12a8 <write_lu_info+0x168>
mov    %rdi,%rbx
lea    0xeff(%rip),%r14
mov    $0xc,%ebp
mov    $0x32,%r15d
movzbl %al,%eax
lea    0xe8e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee7(%rip),%r14
mov    $0x40,%ebp
mov    $0xfa,%r15d
jmp    11de <write_lu_info+0x9e>
lea    0xed3(%rip),%r14
mov    $0x66,%ebp
mov    $0xfa,%r15d
jmp    11de <write_lu_info+0x9e>
lea    0xebf(%rip),%r14
mov    $0xa2,%ebp
mov    $0xfa,%r15d
jmp    11de <write_lu_info+0x9e>
lea    0xeb1(%rip),%r14
mov    $0x198,%ebp
jmp    11d8 <write_lu_info+0x98>
mov    $0x3fc,%ebp
jmp    11d8 <write_lu_info+0x98>
lea    0xe8f(%rip),%r14
mov    $0x21,%ebp
mov    $0x12c,%r15d
lea    0xebd(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xeba(%rip),%rsi
lea    0xed2(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %ebp,%ecx
mov    %ebp,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xed7(%rip),%rdi
mov    $0x38,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xef7(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf0b(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf23(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xf2e(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%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    0xdc2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"0.5d0\00"
@.str.1 = [7 x i8] c"1.5d-3\00"
@.str.2 = [6 x i8] c"2.0d0\00"
@.str.3 = [6 x i8] c"1.0d0\00"
@.str.4 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.5 = [22 x i8] c"\0Ac full problem size\0A\00"
@.str.6 = [31 x i8] c"%sinteger isiz1, isiz2, isiz3\0A\00"
@.str.7 = [9 x i8] c" \00"
@.str.8 = [44 x i8] c"%sparameter (isiz1=%d, isiz2=%d, isiz3=%d)\0A\00"
@.str.9 = [57 x i8] c"\0Ac number of iterations and how often to print the norm\0A\00"
@.str.10 = [40 x i8] c"%sinteger itmax_default, inorm_default\0A\00"
@.str.11 = [50 x i8] c"%sparameter (itmax_default=%d, inorm_default=%d)\0A\00"
@.str.12 = [31 x i8] c"%sdouble precision dt_default\0A\00"
@.str.13 = [31 x i8] c"%sparameter (dt_default = %s)\0A\00"
define void @write_lu_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %3
store i8 %1, i8* %4
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 83
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 12, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10
store i32 50, i32* %7
br label %55
15: ; preds = %2
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 87
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 33, i32* %9
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i32 300, i32* %7
br label %54
20: ; preds = %15
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 65
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 64, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %10
store i32 250, i32* %7
br label %53
25: ; preds = %20
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 66
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 102, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %10
store i32 250, i32* %7
br label %52
30: ; preds = %25
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 67
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 162, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %10
store i32 250, i32* %7
br label %51
35: ; preds = %30
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 68
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 408, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %10
store i32 300, i32* %7
br label %50
40: ; preds = %35
%41 = load i8, i8* %4
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 69
br i1 %43, label %44, label %45
44: ; preds = %40
store i32 1020, i32* %9
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %10
store i32 300, i32* %7
br label %49
45: ; preds = %40
%46 = load i8, i8* %4
%47 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i8 signext %46)
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %44
br label %50
50: ; preds = %49, %39
br label %51
51: ; preds = %50, %34
br label %52
52: ; preds = %51, %29
br label %53
53: ; preds = %52, %24
br label %54
54: ; preds = %53, %19
br label %55
55: ; preds = %54, %14
%56 = load i32, i32* %7
store i32 %56, i32* %8
%57 = load i32, i32* %9
store i32 %57, i32* %5
%58 = load i32, i32* %9
store i32 %58, i32* %6
%59 = load i32*, i32** %3
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%61 = load i32*, i32** %3
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%63 = load i32*, i32** %3
%64 = load i32, i32* %5
%65 = load i32, i32* %6
%66 = load i32, i32* %9
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %64, i32 %65, i32 %66)
%68 = load i32*, i32** %3
%69 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0))
%70 = load i32*, i32** %3
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%72 = load i32*, i32** %3
%73 = load i32, i32* %7
%74 = load i32, i32* %8
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %73, i32 %74)
%76 = load i32*, i32** %3
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%78 = load i32*, i32** %3
%79 = load i8*, i8** %10
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %79)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.5d0\00"
@.str.1 = [7 x i8] c"1.5d-3\00"
@.str.2 = [6 x i8] c"2.0d0\00"
@.str.3 = [6 x i8] c"1.0d0\00"
@.str.4 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.5 = [22 x i8] c"\0Ac full problem size\0A\00"
@.str.6 = [31 x i8] c"%sinteger isiz1, isiz2, isiz3\0A\00"
@.str.7 = [9 x i8] c" \00"
@.str.8 = [44 x i8] c"%sparameter (isiz1=%d, isiz2=%d, isiz3=%d)\0A\00"
@.str.9 = [57 x i8] c"\0Ac number of iterations and how often to print the norm\0A\00"
@.str.10 = [40 x i8] c"%sinteger itmax_default, inorm_default\0A\00"
@.str.11 = [50 x i8] c"%sparameter (itmax_default=%d, inorm_default=%d)\0A\00"
@.str.12 = [31 x i8] c"%sdouble precision dt_default\0A\00"
@.str.13 = [31 x i8] c"%sparameter (dt_default = %s)\0A\00"
define void @write_lu_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.4, 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 [ 300, %3 ], [ 250, %4 ], [ 250, %5 ], [ 250, %6 ], [ 300, %7 ], [ 300, %8 ], [ 50, %2 ]
%14 = phi i32 [ 33, %3 ], [ 64, %4 ], [ 102, %5 ], [ 162, %6 ], [ 408, %7 ], [ 1020, %8 ], [ 12, %2 ]
%15 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ]
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i64 21, i64 1, i32* %0)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %14, i32 %14, i32 %14)
%19 = tail call i64 @fwrite(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0), i64 56, i64 1, i32* %0)
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %13, i32 %13)
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %15)
ret void
}