#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_cg_info(FILE *fp, char class) {
  int na, nonzer, niter;
  char *shift, *rcond = "1.0e-1";
  char *shiftS = "10.0", *shiftW = "12.0", *shiftA = "20.0", *shiftB = "60.0",
       *shiftC = "110.0", *shiftD = "500.0", *shiftE = "1.5e3";
  if (class == 'S') {
    na = 1400;
    nonzer = 7;
    niter = 15;
    shift = shiftS;
  } else if (class == 'W') {
    na = 7000;
    nonzer = 8;
    niter = 15;
    shift = shiftW;
  } else if (class == 'A') {
    na = 14000;
    nonzer = 11;
    niter = 15;
    shift = shiftA;
  } else if (class == 'B') {
    na = 75000;
    nonzer = 13;
    niter = 75;
    shift = shiftB;
  } else if (class == 'C') {
    na = 150000;
    nonzer = 15;
    niter = 75;
    shift = shiftC;
  } else if (class == 'D') {
    na = 1500000;
    nonzer = 21;
    niter = 100;
    shift = shiftD;
  } else if (class == 'E') {
    na = 9000000;
    nonzer = 26;
    niter = 100;
    shift = shiftE;
  } else {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  fprintf(fp, "#define NA      %d\n", na);
  fprintf(fp, "#define NONZER  %d\n", nonzer);
  fprintf(fp, "#define NITER   %d\n", niter);
  fprintf(fp, "#define SHIFT   %s\n", shift);
  fprintf(fp, "#define RCOND   %s\n", rcond);
}


x86 assembly (clang, -O0):
<write_cg_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9c(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe91(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe8c(%rip),%rax
mov    %rax,-0x60(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
jne    11c9 <write_cg_info+0x99>
movl   $0x578,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    131b <write_cg_info+0x1eb>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    11f8 <write_cg_info+0xc8>
movl   $0x1b58,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1316 <write_cg_info+0x1e6>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    1227 <write_cg_info+0xf7>
movl   $0x36b0,-0x10(%rbp)
movl   $0xb,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1311 <write_cg_info+0x1e1>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    1256 <write_cg_info+0x126>
movl   $0x124f8,-0x10(%rbp)
movl   $0xd,-0x14(%rbp)
movl   $0x4b,-0x18(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    130c <write_cg_info+0x1dc>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    1285 <write_cg_info+0x155>
movl   $0x249f0,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movl   $0x4b,-0x18(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1307 <write_cg_info+0x1d7>
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
jne    12b4 <write_cg_info+0x184>
movl   $0x16e360,-0x10(%rbp)
movl   $0x15,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1302 <write_cg_info+0x1d2>
movsbl -0x9(%rbp),%eax
cmp    $0x45,%eax
jne    12e3 <write_cg_info+0x1b3>
movl   $0x895440,-0x10(%rbp)
movl   $0x1a,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    12fd <write_cg_info+0x1cd>
lea    0xd3e(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1302 <write_cg_info+0x1d2>
jmp    1307 <write_cg_info+0x1d7>
jmp    130c <write_cg_info+0x1dc>
jmp    1311 <write_cg_info+0x1e1>
jmp    1316 <write_cg_info+0x1e6>
jmp    131b <write_cg_info+0x1eb>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xd31(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd2f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd2d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_cg_info>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1265 <write_cg_info+0x135>
mov    %rdi,%rbx
mov    $0x578,%edx
mov    $0x7,%ebp
mov    $0xf,%r14d
lea    0xf17(%rip),%r15
movzbl %al,%eax
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x36b0,%edx
mov    $0xb,%ebp
lea    0xee8(%rip),%r15
jmp    11f7 <write_cg_info+0xc7>
mov    $0x124f8,%edx
mov    $0xd,%ebp
mov    $0x4b,%r14d
lea    0xed4(%rip),%r15
jmp    11f7 <write_cg_info+0xc7>
mov    $0x249f0,%edx
mov    $0xf,%ebp
mov    $0x4b,%r14d
lea    0xec0(%rip),%r15
jmp    11f7 <write_cg_info+0xc7>
mov    $0x16e360,%edx
mov    $0x15,%ebp
mov    $0x64,%r14d
lea    0xead(%rip),%r15
jmp    11f7 <write_cg_info+0xc7>
mov    $0x895440,%edx
mov    $0x1a,%ebp
mov    $0x64,%r14d
lea    0xe9a(%rip),%r15
jmp    11f7 <write_cg_info+0xc7>
mov    $0x1b58,%edx
mov    $0x8,%ebp
lea    0xe6c(%rip),%r15
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebc(%rip),%rsi
lea    0xe0b(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"1.0e-1\00"
@.str.1 = [5 x i8] c"10.0\00"
@.str.2 = [5 x i8] c"12.0\00"
@.str.3 = [5 x i8] c"20.0\00"
@.str.4 = [5 x i8] c"60.0\00"
@.str.5 = [6 x i8] c"110.0\00"
@.str.6 = [6 x i8] c"500.0\00"
@.str.7 = [6 x i8] c"1.5e3\00"
@.str.8 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.9 = [20 x i8] c"#define NA %d\0A\00"
@.str.10 = [20 x i8] c"#define NONZER %d\0A\00"
@.str.11 = [20 x i8] c"#define NITER %d\0A\00"
@.str.12 = [20 x i8] c"#define SHIFT %s\0A\00"
@.str.13 = [20 x i8] c"#define RCOND %s\0A\00"
define void @write_cg_info(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i32* %0, i32** %3
store i8 %1, i8* %4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %13
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %16
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 83
br i1 %19, label %20, label %22
20: ; preds = %2
store i32 1400, i32* %5
store i32 7, i32* %6
store i32 15, i32* %7
%21 = load i8*, i8** %10
store i8* %21, i8** %8
br label %68
22: ; preds = %2
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 87
br i1 %25, label %26, label %28
26: ; preds = %22
store i32 7000, i32* %5
store i32 8, i32* %6
store i32 15, i32* %7
%27 = load i8*, i8** %11
store i8* %27, i8** %8
br label %67
28: ; preds = %22
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 65
br i1 %31, label %32, label %34
32: ; preds = %28
store i32 14000, i32* %5
store i32 11, i32* %6
store i32 15, i32* %7
%33 = load i8*, i8** %12
store i8* %33, i8** %8
br label %66
34: ; preds = %28
%35 = load i8, i8* %4
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 66
br i1 %37, label %38, label %40
38: ; preds = %34
store i32 75000, i32* %5
store i32 13, i32* %6
store i32 75, i32* %7
%39 = load i8*, i8** %13
store i8* %39, i8** %8
br label %65
40: ; preds = %34
%41 = load i8, i8* %4
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 67
br i1 %43, label %44, label %46
44: ; preds = %40
store i32 150000, i32* %5
store i32 15, i32* %6
store i32 75, i32* %7
%45 = load i8*, i8** %14
store i8* %45, i8** %8
br label %64
46: ; preds = %40
%47 = load i8, i8* %4
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 68
br i1 %49, label %50, label %52
50: ; preds = %46
store i32 1500000, i32* %5
store i32 21, i32* %6
store i32 100, i32* %7
%51 = load i8*, i8** %15
store i8* %51, i8** %8
br label %63
52: ; preds = %46
%53 = load i8, i8* %4
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 69
br i1 %55, label %56, label %58
56: ; preds = %52
store i32 9000000, i32* %5
store i32 26, i32* %6
store i32 100, i32* %7
%57 = load i8*, i8** %16
store i8* %57, i8** %8
br label %62
58: ; preds = %52
%59 = load i8, i8* %4
%60 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i8 signext %59)
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %56
br label %63
63: ; preds = %62, %50
br label %64
64: ; preds = %63, %44
br label %65
65: ; preds = %64, %38
br label %66
66: ; preds = %65, %32
br label %67
67: ; preds = %66, %26
br label %68
68: ; preds = %67, %20
%69 = load i32*, i32** %3
%70 = load i32, i32* %5
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %70)
%72 = load i32*, i32** %3
%73 = load i32, i32* %6
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %73)
%75 = load i32*, i32** %3
%76 = load i32, i32* %7
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %76)
%78 = load i32*, i32** %3
%79 = load i8*, i8** %8
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %79)
%81 = load i32*, i32** %3
%82 = load i8*, i8** %9
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %82)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"1.0e-1\00"
@.str.1 = [5 x i8] c"10.0\00"
@.str.2 = [5 x i8] c"12.0\00"
@.str.3 = [5 x i8] c"20.0\00"
@.str.4 = [5 x i8] c"60.0\00"
@.str.5 = [6 x i8] c"110.0\00"
@.str.6 = [6 x i8] c"500.0\00"
@.str.7 = [6 x i8] c"1.5e3\00"
@.str.8 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.9 = [20 x i8] c"#define NA %d\0A\00"
@.str.10 = [20 x i8] c"#define NONZER %d\0A\00"
@.str.11 = [20 x i8] c"#define NITER %d\0A\00"
@.str.12 = [20 x i8] c"#define SHIFT %s\0A\00"
@.str.13 = [20 x i8] c"#define RCOND %s\0A\00"
define void @write_cg_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 ([50 x i8], [50 x i8]* @.str.8, 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 i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ]
%14 = phi i32 [ 15, %3 ], [ 15, %4 ], [ 75, %5 ], [ 75, %6 ], [ 100, %7 ], [ 100, %8 ], [ 15, %2 ]
%15 = phi i32 [ 8, %3 ], [ 11, %4 ], [ 13, %5 ], [ 15, %6 ], [ 21, %7 ], [ 26, %8 ], [ 7, %2 ]
%16 = phi i32 [ 7000, %3 ], [ 14000, %4 ], [ 75000, %5 ], [ 150000, %6 ], [ 1500000, %7 ], [ 9000000, %8 ], [ 1400, %2 ]
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %16)
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %15)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i32 %14)
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %13)
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}