#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 ilog2(int);
int ipow2(int);
int /*<<< orphan*/ printf(char *, char);
void write_cg_info(FILE *fp, int nprocs, char class) {
  int na, nonzer, niter;
  char *shift, *rcond = "1.0d-1";
  char *shiftS = "10.", *shiftW = "12.", *shiftA = "20.", *shiftB = "60.",
       *shiftC = "110.", *shiftD = "500.", *shiftE = "1.5d3";
  int num_proc_cols, num_proc_rows;
  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, "%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);
  num_proc_cols = num_proc_rows = ilog2(nprocs) / 2;
  if (num_proc_cols + num_proc_rows != ilog2(nprocs))
    num_proc_cols += 1;
  num_proc_cols = ipow2(num_proc_cols);
  num_proc_rows = ipow2(num_proc_rows);
  fprintf(fp, "\nc number of nodes for which this version is compiled\n");
  fprintf(fp, "%sinteger    nnodes_compiled\n", "        ");
  fprintf(fp, "%sparameter( nnodes_compiled = %d)\n", "        ", nprocs);
  fprintf(fp, "%sinteger    num_proc_cols, num_proc_rows\n", "        ");
  fprintf(fp, "%sparameter( num_proc_cols=%d, num_proc_rows=%d )\n", "        ",
          num_proc_cols, num_proc_rows);
}


x86 assembly (clang, -O0):
<write_cg_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe7c(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe75(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe6e(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe68(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe62(%rip),%rax
mov    %rax,-0x68(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x53,%eax
jne    11ee <write_cg_info+0x9e>
movl   $0x578,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1340 <write_cg_info+0x1f0>
movsbl -0xd(%rbp),%eax
cmp    $0x57,%eax
jne    121d <write_cg_info+0xcd>
movl   $0x1b58,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    133b <write_cg_info+0x1eb>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jne    124c <write_cg_info+0xfc>
movl   $0x36b0,-0x14(%rbp)
movl   $0xb,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1336 <write_cg_info+0x1e6>
movsbl -0xd(%rbp),%eax
cmp    $0x42,%eax
jne    127b <write_cg_info+0x12b>
movl   $0x124f8,-0x14(%rbp)
movl   $0xd,-0x18(%rbp)
movl   $0x4b,-0x1c(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1331 <write_cg_info+0x1e1>
movsbl -0xd(%rbp),%eax
cmp    $0x43,%eax
jne    12aa <write_cg_info+0x15a>
movl   $0x249f0,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
movl   $0x4b,-0x1c(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    132c <write_cg_info+0x1dc>
movsbl -0xd(%rbp),%eax
cmp    $0x44,%eax
jne    12d9 <write_cg_info+0x189>
movl   $0x16e360,-0x14(%rbp)
movl   $0x15,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1327 <write_cg_info+0x1d7>
movsbl -0xd(%rbp),%eax
cmp    $0x45,%eax
jne    1308 <write_cg_info+0x1b8>
movl   $0x895440,-0x14(%rbp)
movl   $0x1a,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1322 <write_cg_info+0x1d2>
lea    0xd14(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    1327 <write_cg_info+0x1d7>
jmp    132c <write_cg_info+0x1dc>
jmp    1331 <write_cg_info+0x1e1>
jmp    1336 <write_cg_info+0x1e6>
jmp    133b <write_cg_info+0x1eb>
jmp    1340 <write_cg_info+0x1f0>
mov    -0x8(%rbp),%rdi
lea    0xd0a(%rip),%rsi
lea    0xd2b(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd22(%rip),%rsi
lea    0xd12(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xd29(%rip),%rsi
lea    0xcf6(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%ecx
lea    0xd23(%rip),%rsi
lea    0xd37(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0xd2a(%rip),%rsi
lea    0xd1b(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rcx
lea    0xd27(%rip),%rsi
lea    0xcfe(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rcx
lea    0xd24(%rip),%rsi
lea    0xce1(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1030 <ilog2@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x70(%rbp)
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
add    -0x70(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ilog2@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
je     143d <write_cg_info+0x2ed>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%edi
call   1060 <ipow2@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x70(%rbp),%edi
call   1060 <ipow2@plt>
mov    %eax,-0x70(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xcd3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xcf8(%rip),%rsi
lea    0xc06(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xcfa(%rip),%rsi
lea    0xbea(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd05(%rip),%rsi
lea    0xbd1(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%r8d
lea    0xd10(%rip),%rsi
lea    0xbb1(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
add    $0x80,%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
mov    %esi,0x4(%rsp)
lea    -0x41(%rdx),%eax
cmp    $0x16,%al
ja     139a <write_cg_info+0x23a>
mov    %rdi,%r12
mov    $0x578,%ebp
mov    $0x7,%r14d
mov    $0xf,%ebx
lea    0xedc(%rip),%r13
movzbl %al,%eax
lea    0xe62(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x36b0,%ebp
mov    $0xb,%r14d
lea    0xeae(%rip),%r13
jmp    1231 <write_cg_info+0xd1>
mov    $0x124f8,%ebp
mov    $0xd,%r14d
mov    $0x4b,%ebx
lea    0xe99(%rip),%r13
jmp    1231 <write_cg_info+0xd1>
mov    $0x249f0,%ebp
mov    $0xf,%r14d
mov    $0x4b,%ebx
lea    0xe84(%rip),%r13
jmp    1231 <write_cg_info+0xd1>
mov    $0x16e360,%ebp
mov    $0x15,%r14d
mov    $0x64,%ebx
lea    0xe70(%rip),%r13
jmp    1231 <write_cg_info+0xd1>
mov    $0x895440,%ebp
mov    $0x1a,%r14d
mov    $0x64,%ebx
lea    0xe5c(%rip),%r13
jmp    1231 <write_cg_info+0xd1>
mov    $0x1b58,%ebp
mov    $0x8,%r14d
lea    0xe32(%rip),%r13
lea    0xe79(%rip),%rsi
lea    0xe9a(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe8f(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe9e(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe9e(%rip),%rsi
lea    0xeb2(%rip),%rbp
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xea3(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xea7(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeaa(%rip),%rsi
lea    0xd8d(%rip),%rcx
mov    %r12,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x4(%rsp),%r13d
mov    %r13d,%edi
call   1030 <ilog2@plt>
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
mov    %ebp,%ebx
sar    %ebx
and    $0xfffffffe,%ebp
mov    %r13d,%edi
call   1030 <ilog2@plt>
xor    %edi,%edi
cmp    %eax,%ebp
setne  %dil
add    %ebx,%edi
call   1060 <ipow2@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1060 <ipow2@plt>
mov    %eax,%ebp
lea    0xe6c(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
lea    0xe8a(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe94(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %r13d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xea1(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeb8(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fprintf@plt>
movsbl %dl,%esi
lea    0xcdb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <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 = [5 x i8] c"500.\00"
@.str.7 = [6 x i8] c"1.5d3\00"
@.str.8 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.9 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.10 = [9 x i8] c" \00"
@.str.11 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.12 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.13 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.14 = [8 x i8] c" > \00"
@.str.15 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.16 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.17 = [27 x i8] c"%s rcond=%s )\0A\00"
@.str.18 = [55 x i8] c"\0Ac number of nodes for which this version is compiled\0A\00"
@.str.19 = [30 x i8] c"%sinteger nnodes_compiled\0A\00"
@.str.20 = [36 x i8] c"%sparameter( nnodes_compiled = %d)\0A\00"
@.str.21 = [43 x i8] c"%sinteger num_proc_cols, num_proc_rows\0A\00"
@.str.22 = [51 x i8] c"%sparameter( num_proc_cols=%d, num_proc_rows=%d )\0A\00"
define void @write_cg_info(i32* %0, i32 %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %13
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %15
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %16
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %17
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %18
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 83
br i1 %23, label %24, label %26
24: ; preds = %3
store i32 1400, i32* %7
store i32 7, i32* %8
store i32 15, i32* %9
%25 = load i8*, i8** %12
store i8* %25, i8** %10
br label %72
26: ; preds = %3
%27 = load i8, i8* %6
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 87
br i1 %29, label %30, label %32
30: ; preds = %26
store i32 7000, i32* %7
store i32 8, i32* %8
store i32 15, i32* %9
%31 = load i8*, i8** %13
store i8* %31, i8** %10
br label %71
32: ; preds = %26
%33 = load i8, i8* %6
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 65
br i1 %35, label %36, label %38
36: ; preds = %32
store i32 14000, i32* %7
store i32 11, i32* %8
store i32 15, i32* %9
%37 = load i8*, i8** %14
store i8* %37, i8** %10
br label %70
38: ; preds = %32
%39 = load i8, i8* %6
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 66
br i1 %41, label %42, label %44
42: ; preds = %38
store i32 75000, i32* %7
store i32 13, i32* %8
store i32 75, i32* %9
%43 = load i8*, i8** %15
store i8* %43, i8** %10
br label %69
44: ; preds = %38
%45 = load i8, i8* %6
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 67
br i1 %47, label %48, label %50
48: ; preds = %44
store i32 150000, i32* %7
store i32 15, i32* %8
store i32 75, i32* %9
%49 = load i8*, i8** %16
store i8* %49, i8** %10
br label %68
50: ; preds = %44
%51 = load i8, i8* %6
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 68
br i1 %53, label %54, label %56
54: ; preds = %50
store i32 1500000, i32* %7
store i32 21, i32* %8
store i32 100, i32* %9
%55 = load i8*, i8** %17
store i8* %55, i8** %10
br label %67
56: ; preds = %50
%57 = load i8, i8* %6
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 69
br i1 %59, label %60, label %62
60: ; preds = %56
store i32 9000000, i32* %7
store i32 26, i32* %8
store i32 100, i32* %9
%61 = load i8*, i8** %18
store i8* %61, i8** %10
br label %66
62: ; preds = %56
%63 = load i8, i8* %6
%64 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i8 signext %63)
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %60
br label %67
67: ; preds = %66, %54
br label %68
68: ; preds = %67, %48
br label %69
69: ; preds = %68, %42
br label %70
70: ; preds = %69, %36
br label %71
71: ; preds = %70, %30
br label %72
72: ; preds = %71, %24
%73 = load i32*, i32** %4
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%75 = load i32*, i32** %4
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%77 = load i32*, i32** %4
%78 = load i32, i32* %7
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %78)
%80 = load i32*, i32** %4
%81 = load i32, i32* %8
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %81)
%83 = load i32*, i32** %4
%84 = load i32, i32* %9
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %84)
%86 = load i32*, i32** %4
%87 = load i8*, i8** %10
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %87)
%89 = load i32*, i32** %4
%90 = load i8*, i8** %11
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %90)
%92 = load i32, i32* %5
%93 = call i32 @ilog2(i32 %92)
%94 = sdiv i32 %93, 2
store i32 %94, i32* %20
store i32 %94, i32* %19
%95 = load i32, i32* %19
%96 = load i32, i32* %20
%97 = add nsw i32 %95, %96
%98 = load i32, i32* %5
%99 = call i32 @ilog2(i32 %98)
%100 = icmp ne i32 %97, %99
br i1 %100, label %101, label %104
101: ; preds = %72
%102 = load i32, i32* %19
%103 = add nsw i32 %102, 1
store i32 %103, i32* %19
br label %104
104: ; preds = %101, %72
%105 = load i32, i32* %19
%106 = call i32 @ipow2(i32 %105)
store i32 %106, i32* %19
%107 = load i32, i32* %20
%108 = call i32 @ipow2(i32 %107)
store i32 %108, i32* %20
%109 = load i32*, i32** %4
%110 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.18, i64 0, i64 0))
%111 = load i32*, i32** %4
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %111, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%113 = load i32*, i32** %4
%114 = load i32, i32* %5
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %114)
%116 = load i32*, i32** %4
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%118 = load i32*, i32** %4
%119 = load i32, i32* %19
%120 = load i32, i32* %20
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %119, i32 %120)
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 = [5 x i8] c"500.\00"
@.str.7 = [6 x i8] c"1.5d3\00"
@.str.8 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.9 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.10 = [9 x i8] c" \00"
@.str.11 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.12 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.13 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.14 = [8 x i8] c" > \00"
@.str.15 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.16 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.17 = [27 x i8] c"%s rcond=%s )\0A\00"
@.str.18 = [55 x i8] c"\0Ac number of nodes for which this version is compiled\0A\00"
@.str.19 = [30 x i8] c"%sinteger nnodes_compiled\0A\00"
@.str.20 = [36 x i8] c"%sparameter( nnodes_compiled = %d)\0A\00"
@.str.21 = [43 x i8] c"%sinteger num_proc_cols, num_proc_rows\0A\00"
@.str.22 = [51 x i8] c"%sparameter( num_proc_cols=%d, num_proc_rows=%d )\0A\00"
define void @write_cg_info(i32* nocapture %0, i32 %1, i8 signext %2) {
switch i8 %2, label %10 [
i8 83, label %13
i8 87, label %4
i8 65, label %5
i8 66, label %6
i8 67, label %7
i8 68, label %8
i8 69, label %9
]
4: ; preds = %3
br label %13
5: ; preds = %3
br label %13
6: ; preds = %3
br label %13
7: ; preds = %3
br label %13
8: ; preds = %3
br label %13
9: ; preds = %3
br label %13
10: ; preds = %3
%11 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i8 signext %2)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %3, %4, %6, %8, %9, %7, %5
%14 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ]
%15 = phi i32 [ 15, %4 ], [ 15, %5 ], [ 75, %6 ], [ 75, %7 ], [ 100, %8 ], [ 100, %9 ], [ 15, %3 ]
%16 = phi i32 [ 8, %4 ], [ 11, %5 ], [ 13, %6 ], [ 15, %7 ], [ 21, %8 ], [ 26, %9 ], [ 7, %3 ]
%17 = phi i32 [ 7000, %4 ], [ 14000, %5 ], [ 75000, %6 ], [ 150000, %7 ], [ 1500000, %8 ], [ 9000000, %9 ], [ 1400, %3 ]
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %17)
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %16)
%22 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %15)
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %14)
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%25 = tail call i32 @ilog2(i32 %1)
%26 = sdiv i32 %25, 2
%27 = shl nsw i32 %26, 1
%28 = tail call i32 @ilog2(i32 %1)
%29 = icmp ne i32 %27, %28
%30 = zext i1 %29 to i32
%31 = add nsw i32 %26, %30
%32 = tail call i32 @ipow2(i32 %31)
%33 = tail call i32 @ipow2(i32 %26)
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.18, i64 0, i64 0), i64 54, i64 1, i32* %0)
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %1)
%37 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%38 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %32, i32 %33)
ret void
}