#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";
  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, "#define\tNA\t%d\n", na);
  fprintf(fp, "#define\tNONZER\t%d\n", nonzer);
  fprintf(fp, "#define\tNITER\t%d\n", niter);
  fprintf(fp, "#define\tSHIFT\t%s\n", shift);
  fprintf(fp, "#define\tRCOND\t%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    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)
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    0xda6(%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
mov    -0x10(%rbp),%edx
lea    0xda3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd9b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd97(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xd93(%rip),%rsi
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   %rbx
push   %rax
lea    -0x41(%rsi),%eax
cmp    $0x16,%al
ja     1233 <write_cg_info+0x103>
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    11c5 <write_cg_info+0x95>
mov    $0x124f8,%edx
mov    $0xd,%ebp
mov    $0x4b,%r14d
lea    0xed4(%rip),%r15
jmp    11c5 <write_cg_info+0x95>
mov    $0x249f0,%edx
mov    $0xf,%ebp
mov    $0x4b,%r14d
lea    0xec0(%rip),%r15
jmp    11c5 <write_cg_info+0x95>
mov    $0x1b58,%edx
mov    $0x8,%ebp
lea    0xe9e(%rip),%r15
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xed8(%rip),%rsi
lea    0xe3d(%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    0xe3a(%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 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.7 = [15 x i8] c"#define\09NA\09%d\0A\00"
@.str.8 = [19 x i8] c"#define\09NONZER\09%d\0A\00"
@.str.9 = [18 x i8] c"#define\09NITER\09%d\0A\00"
@.str.10 = [18 x i8] c"#define\09SHIFT\09%s\0A\00"
@.str.11 = [18 x i8] c"#define\09RCOND\09%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 ([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
%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 = load i32, i32* %5
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %54)
%56 = load i32*, i32** %3
%57 = load i32, i32* %6
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %57)
%59 = load i32*, i32** %3
%60 = load i32, i32* %7
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %60)
%62 = load i32*, i32** %3
%63 = load i8*, i8** %8
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* %63)
%65 = load i32*, i32** %3
%66 = load i8*, i8** %9
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %66)
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 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.7 = [15 x i8] c"#define\09NA\09%d\0A\00"
@.str.8 = [19 x i8] c"#define\09NONZER\09%d\0A\00"
@.str.9 = [18 x i8] c"#define\09NITER\09%d\0A\00"
@.str.10 = [18 x i8] c"#define\09SHIFT\09%s\0A\00"
@.str.11 = [18 x i8] c"#define\09RCOND\09%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 ([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 ([5 x i8], [5 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*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %14)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %13)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %12)
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i8* %11)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}