#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;
  int xdiv, ydiv;
  char *dt_default;
  if (class == 'S') {
    problem_size = 12;
    dt_default = "0.5";
    itmax = 50;
  } else if (class == 'W') {
    problem_size = 33;
    dt_default = "1.5e-3";
    itmax = 300;
  } else if (class == 'A') {
    problem_size = 64;
    dt_default = "2.0";
    itmax = 250;
  } else if (class == 'B') {
    problem_size = 102;
    dt_default = "2.0";
    itmax = 250;
  } else if (class == 'C') {
    problem_size = 162;
    dt_default = "2.0";
    itmax = 250;
  } else {
    printf("setparams: Internal error: invalid class %c\n", class);
    exit(1);
  }
  inorm = itmax;
  isiz1 = problem_size;
  isiz2 = problem_size;
  fprintf(fp, "\n/* full problem size */\n");
  fprintf(fp, "#define\tISIZ1\t%d\n", problem_size);
  fprintf(fp, "#define\tISIZ2\t%d\n", problem_size);
  fprintf(fp, "#define\tISIZ3\t%d\n", problem_size);
  fprintf(fp, "/* number of iterations and how often to print the norm */\n");
  fprintf(fp, "#define\tITMAX_DEFAULT\t%d\n", itmax);
  fprintf(fp, "#define\tINORM_DEFAULT\t%d\n", inorm);
  fprintf(fp, "#define\tDT_DEFAULT\t%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,-0x30(%rbp)
movl   $0x32,-0x18(%rbp)
jmp    1247 <write_lu_info+0x117>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    1198 <write_lu_info+0x68>
movl   $0x21,-0x20(%rbp)
lea    0xe7c(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x12c,-0x18(%rbp)
jmp    1242 <write_lu_info+0x112>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    11c3 <write_lu_info+0x93>
movl   $0x40,-0x20(%rbp)
lea    0xe58(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    123d <write_lu_info+0x10d>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    11ee <write_lu_info+0xbe>
movl   $0x66,-0x20(%rbp)
lea    0xe2d(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    1238 <write_lu_info+0x108>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    1219 <write_lu_info+0xe9>
movl   $0xa2,-0x20(%rbp)
lea    0xe02(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0xfa,-0x18(%rbp)
jmp    1233 <write_lu_info+0x103>
lea    0xdef(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1238 <write_lu_info+0x108>
jmp    123d <write_lu_info+0x10d>
jmp    1242 <write_lu_info+0x112>
jmp    1247 <write_lu_info+0x117>
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    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%edx
lea    0xdd7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdd7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xe07(%rip),%rsi
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   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1279 <write_lu_info+0x139>
mov    %rdi,%rbx
lea    0xf00(%rip),%r14
mov    $0x32,%r15d
mov    $0xc,%ebp
movzbl %al,%eax
lea    0xe8f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee6(%rip),%r14
mov    $0xfa,%r15d
mov    $0x40,%ebp
jmp    11c8 <write_lu_info+0x88>
lea    0xed2(%rip),%r14
mov    $0xfa,%r15d
mov    $0x66,%ebp
jmp    11c8 <write_lu_info+0x88>
lea    0xebe(%rip),%r14
mov    $0xfa,%r15d
mov    $0xa2,%ebp
jmp    11c8 <write_lu_info+0x88>
lea    0xea3(%rip),%r14
mov    $0x12c,%r15d
mov    $0x21,%ebp
lea    0xec9(%rip),%rdi
mov    $0x19,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec7(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xeea(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef0(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"0.5\00"
@.str.1 = [7 x i8] c"1.5e-3\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.4 = [26 x i8] c"\0A/* full problem size */\0A\00"
@.str.5 = [18 x i8] c"#define\09ISIZ1\09%d\0A\00"
@.str.6 = [18 x i8] c"#define\09ISIZ2\09%d\0A\00"
@.str.7 = [18 x i8] c"#define\09ISIZ3\09%d\0A\00"
@.str.8 = [60 x i8] c"/* number of iterations and how often to print the norm */\0A\00"
@.str.9 = [26 x i8] c"#define\09ITMAX_DEFAULT\09%d\0A\00"
@.str.10 = [26 x i8] c"#define\09INORM_DEFAULT\09%d\0A\00"
@.str.11 = [23 x i8] c"#define\09DT_DEFAULT\09%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 i32
%11 = alloca i32
%12 = alloca i8*
store i32* %0, i32** %3
store i8 %1, i8* %4
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 83
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 12, i32* %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %12
store i32 50, i32* %7
br label %45
17: ; preds = %2
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 87
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 33, i32* %9
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %12
store i32 300, i32* %7
br label %44
22: ; preds = %17
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 65
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 64, i32* %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %12
store i32 250, i32* %7
br label %43
27: ; preds = %22
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 66
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 102, i32* %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %12
store i32 250, i32* %7
br label %42
32: ; preds = %27
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 67
br i1 %35, label %36, label %37
36: ; preds = %32
store i32 162, i32* %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %12
store i32 250, i32* %7
br label %41
37: ; preds = %32
%38 = load i8, i8* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, 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
%46 = load i32, i32* %7
store i32 %46, i32* %8
%47 = load i32, i32* %9
store i32 %47, i32* %5
%48 = load i32, i32* %9
store i32 %48, i32* %6
%49 = load i32*, i32** %3
%50 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%51 = load i32*, i32** %3
%52 = load i32, i32* %9
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %51, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = load i32*, i32** %3
%55 = load i32, i32* %9
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %55)
%57 = load i32*, i32** %3
%58 = load i32, i32* %9
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %58)
%60 = load i32*, i32** %3
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
%62 = load i32*, i32** %3
%63 = load i32, i32* %7
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %63)
%65 = load i32*, i32** %3
%66 = load i32, i32* %8
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %66)
%68 = load i32*, i32** %3
%69 = load i8*, i8** %12
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %69)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"0.5\00"
@.str.1 = [7 x i8] c"1.5e-3\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [45 x i8] c"setparams: Internal error: invalid class %c\0A\00"
@.str.4 = [26 x i8] c"\0A/* full problem size */\0A\00"
@.str.5 = [18 x i8] c"#define\09ISIZ1\09%d\0A\00"
@.str.6 = [18 x i8] c"#define\09ISIZ2\09%d\0A\00"
@.str.7 = [18 x i8] c"#define\09ISIZ3\09%d\0A\00"
@.str.8 = [60 x i8] c"/* number of iterations and how often to print the norm */\0A\00"
@.str.9 = [26 x i8] c"#define\09ITMAX_DEFAULT\09%d\0A\00"
@.str.10 = [26 x i8] c"#define\09INORM_DEFAULT\09%d\0A\00"
@.str.11 = [23 x i8] c"#define\09DT_DEFAULT\09%s\0A\00"
define void @write_lu_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 ([45 x i8], [45 x i8]* @.str.3, 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 [ 33, %3 ], [ 64, %4 ], [ 102, %5 ], [ 162, %6 ], [ 12, %2 ]
%12 = phi i32 [ 300, %3 ], [ 250, %4 ], [ 250, %5 ], [ 250, %6 ], [ 50, %2 ]
%13 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %2 ]
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i64 25, i64 1, i32* %0)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %11)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %11)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), i64 59, i64 1, i32* %0)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %12)
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %12)
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8* %13)
ret void
}