#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_cg_info(FILE *fp, char class) {
  int na, nonzer, niter;
  char *shift, *rcond = "1.0d-1";
  char *shiftS = "10.", *shiftW = "12.", *shiftA = "20.", *shiftB = "60.",
       *shiftC = "110.";
  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 {
    printf("setparams: Internal error: invalid class type %c\n", class);
    exit(1);
  }
  fprintf(fp, "%sinteger            na, nonzer, niter\n", "        ");
  fprintf(fp, "%sdouble precision   shift, rcond\n", "        ");
  fprintf(fp, "%sparameter(  na=%d,\n", "        ", na);
  fprintf(fp, "%s             nonzer=%d,\n", "     > ", nonzer);
  fprintf(fp, "%s             niter=%d,\n", "     > ", niter);
  fprintf(fp, "%s             shift=%s,\n", "     > ", shift);
  fprintf(fp, "%s             rcond=%s )\n", "     > ", rcond);
}


x86 assembly (clang, -O0):
<write_cg_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xea1(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe93(%rip),%rax
mov    %rax,-0x50(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x53,%eax
jne    11b3 <write_cg_info+0x83>
movl   $0x578,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    129d <write_cg_info+0x16d>
movsbl -0x9(%rbp),%eax
cmp    $0x57,%eax
jne    11e2 <write_cg_info+0xb2>
movl   $0x1b58,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1298 <write_cg_info+0x168>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    1211 <write_cg_info+0xe1>
movl   $0x36b0,-0x10(%rbp)
movl   $0xb,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1293 <write_cg_info+0x163>
movsbl -0x9(%rbp),%eax
cmp    $0x42,%eax
jne    1240 <write_cg_info+0x110>
movl   $0x124f8,-0x10(%rbp)
movl   $0xd,-0x14(%rbp)
movl   $0x4b,-0x18(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    128e <write_cg_info+0x15e>
movsbl -0x9(%rbp),%eax
cmp    $0x43,%eax
jne    126f <write_cg_info+0x13f>
movl   $0x249f0,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
movl   $0x4b,-0x18(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1289 <write_cg_info+0x159>
lea    0xda2(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    128e <write_cg_info+0x15e>
jmp    1293 <write_cg_info+0x163>
jmp    1298 <write_cg_info+0x168>
jmp    129d <write_cg_info+0x16d>
mov    -0x8(%rbp),%rdi
lea    0xda2(%rip),%rsi
lea    0xdc3(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdba(%rip),%rsi
lea    0xdaa(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
lea    0xdc1(%rip),%rsi
lea    0xd8e(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xdbb(%rip),%rsi
lea    0xdcf(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%ecx
lea    0xdc2(%rip),%rsi
lea    0xdb3(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
lea    0xdbf(%rip),%rsi
lea    0xd96(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rcx
lea    0xdbc(%rip),%rsi
lea    0xd79(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_cg_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     128e <write_cg_info+0x15e>
mov    %rdi,%rbx
mov    $0x578,%r13d
mov    $0x7,%r12d
mov    $0xf,%r14d
lea    0xf0e(%rip),%r15
movzbl %al,%eax
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x36b0,%r13d
mov    $0xb,%r12d
lea    0xedf(%rip),%r15
jmp    11d3 <write_cg_info+0xa3>
mov    $0x124f8,%r13d
mov    $0xd,%r12d
mov    $0x4b,%r14d
lea    0xec8(%rip),%r15
jmp    11d3 <write_cg_info+0xa3>
mov    $0x249f0,%r13d
mov    $0xf,%r12d
mov    $0x4b,%r14d
lea    0xeb1(%rip),%r15
jmp    11d3 <write_cg_info+0xa3>
mov    $0x1b58,%r13d
mov    $0x8,%r12d
lea    0xe90(%rip),%r15
lea    0xecc(%rip),%rsi
lea    0xeed(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef1(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef0(%rip),%rsi
lea    0xf04(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r12d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef5(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xef8(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xefb(%rip),%rsi
lea    0xde9(%rip),%rcx
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
movsbl %sil,%esi
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"1.0d-1\00"
@.str.1 = [4 x i8] c"10.\00"
@.str.2 = [4 x i8] c"12.\00"
@.str.3 = [4 x i8] c"20.\00"
@.str.4 = [4 x i8] c"60.\00"
@.str.5 = [5 x i8] c"110.\00"
@.str.6 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.7 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.8 = [9 x i8] c" \00"
@.str.9 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.10 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.11 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.12 = [8 x i8] c" > \00"
@.str.13 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.14 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.15 = [27 x i8] c"%s 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*
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 ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %13
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %14
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 83
br i1 %17, label %18, label %20
18: ; preds = %2
store i32 1400, i32* %5
store i32 7, i32* %6
store i32 15, i32* %7
%19 = load i8*, i8** %10
store i8* %19, i8** %8
br label %52
20: ; preds = %2
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 87
br i1 %23, label %24, label %26
24: ; preds = %20
store i32 7000, i32* %5
store i32 8, i32* %6
store i32 15, i32* %7
%25 = load i8*, i8** %11
store i8* %25, i8** %8
br label %51
26: ; preds = %20
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 65
br i1 %29, label %30, label %32
30: ; preds = %26
store i32 14000, i32* %5
store i32 11, i32* %6
store i32 15, i32* %7
%31 = load i8*, i8** %12
store i8* %31, i8** %8
br label %50
32: ; preds = %26
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 66
br i1 %35, label %36, label %38
36: ; preds = %32
store i32 75000, i32* %5
store i32 13, i32* %6
store i32 75, i32* %7
%37 = load i8*, i8** %13
store i8* %37, i8** %8
br label %49
38: ; preds = %32
%39 = load i8, i8* %4
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 67
br i1 %41, label %42, label %44
42: ; preds = %38
store i32 150000, i32* %5
store i32 15, i32* %6
store i32 75, i32* %7
%43 = load i8*, i8** %14
store i8* %43, i8** %8
br label %48
44: ; preds = %38
%45 = load i8, i8* %4
%46 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i8 signext %45)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %42
br label %49
49: ; preds = %48, %36
br label %50
50: ; preds = %49, %30
br label %51
51: ; preds = %50, %24
br label %52
52: ; preds = %51, %18
%53 = load i32*, i32** %3
%54 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([40 x i8], [40 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 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%57 = load i32*, i32** %3
%58 = load i32, i32* %5
%59 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %58)
%60 = load i32*, i32** %3
%61 = load i32, i32* %6
%62 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 %61)
%63 = load i32*, i32** %3
%64 = load i32, i32* %7
%65 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 %64)
%66 = load i32*, i32** %3
%67 = load i8*, i8** %8
%68 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %67)
%69 = load i32*, i32** %3
%70 = load i8*, i8** %9
%71 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %70)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"1.0d-1\00"
@.str.1 = [4 x i8] c"10.\00"
@.str.2 = [4 x i8] c"12.\00"
@.str.3 = [4 x i8] c"20.\00"
@.str.4 = [4 x i8] c"60.\00"
@.str.5 = [5 x i8] c"110.\00"
@.str.6 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.7 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.8 = [9 x i8] c" \00"
@.str.9 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.10 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.11 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.12 = [8 x i8] c" > \00"
@.str.13 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.14 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.15 = [27 x i8] c"%s rcond=%s )\0A\00"
define void @write_cg_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 ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i8 signext %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2, %3, %5, %6, %4
%11 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %2 ]
%12 = phi i32 [ 15, %3 ], [ 15, %4 ], [ 75, %5 ], [ 75, %6 ], [ 15, %2 ]
%13 = phi i32 [ 8, %3 ], [ 11, %4 ], [ 13, %5 ], [ 15, %6 ], [ 7, %2 ]
%14 = phi i32 [ 7000, %3 ], [ 14000, %4 ], [ 75000, %5 ], [ 150000, %6 ], [ 1400, %2 ]
%15 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%16 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, 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 ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %14)
%18 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 %13)
%19 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i32 %12)
%20 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %11)
%21 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}