#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.";
  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 {
    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    $0x70,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe9e(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe86(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe78(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe71(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe6b(%rip),%rax
mov    %rax,-0x60(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x53,%eax
jne    11e0 <write_cg_info+0x90>
movl   $0x578,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12fe <write_cg_info+0x1ae>
movsbl -0xd(%rbp),%eax
cmp    $0x57,%eax
jne    120f <write_cg_info+0xbf>
movl   $0x1b58,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12f9 <write_cg_info+0x1a9>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jne    123e <write_cg_info+0xee>
movl   $0x36b0,-0x14(%rbp)
movl   $0xb,-0x18(%rbp)
movl   $0xf,-0x1c(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12f4 <write_cg_info+0x1a4>
movsbl -0xd(%rbp),%eax
cmp    $0x42,%eax
jne    126d <write_cg_info+0x11d>
movl   $0x124f8,-0x14(%rbp)
movl   $0xd,-0x18(%rbp)
movl   $0x4b,-0x1c(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12ef <write_cg_info+0x19f>
movsbl -0xd(%rbp),%eax
cmp    $0x43,%eax
jne    129c <write_cg_info+0x14c>
movl   $0x249f0,-0x14(%rbp)
movl   $0xf,-0x18(%rbp)
movl   $0x4b,-0x1c(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12ea <write_cg_info+0x19a>
movsbl -0xd(%rbp),%eax
cmp    $0x44,%eax
jne    12cb <write_cg_info+0x17b>
movl   $0x16e360,-0x14(%rbp)
movl   $0x15,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12e5 <write_cg_info+0x195>
lea    0xd4b(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    12ea <write_cg_info+0x19a>
jmp    12ef <write_cg_info+0x19f>
jmp    12f4 <write_cg_info+0x1a4>
jmp    12f9 <write_cg_info+0x1a9>
jmp    12fe <write_cg_info+0x1ae>
mov    -0x8(%rbp),%rdi
lea    0xd46(%rip),%rsi
lea    0xd67(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd5e(%rip),%rsi
lea    0xd4e(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
lea    0xd65(%rip),%rsi
lea    0xd32(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%ecx
lea    0xd5f(%rip),%rsi
lea    0xd73(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0xd66(%rip),%rsi
lea    0xd57(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rcx
lea    0xd63(%rip),%rsi
lea    0xd3a(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rcx
lea    0xd60(%rip),%rsi
lea    0xd1d(%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,-0x68(%rbp)
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
add    -0x68(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ilog2@plt>
mov    %eax,%ecx
mov    -0x6c(%rbp),%eax
cmp    %ecx,%eax
je     13fb <write_cg_info+0x2ab>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   1060 <ipow2@plt>
mov    %eax,-0x64(%rbp)
mov    -0x68(%rbp),%edi
call   1060 <ipow2@plt>
mov    %eax,-0x68(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd34(%rip),%rsi
lea    0xc42(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xd36(%rip),%rsi
lea    0xc26(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xd41(%rip),%rsi
lea    0xc0d(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x64(%rbp),%ecx
mov    -0x68(%rbp),%r8d
lea    0xd4c(%rip),%rsi
lea    0xbed(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
add    $0x70,%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     138f <write_cg_info+0x22f>
mov    %rdi,%r12
mov    $0x578,%r14d
mov    $0x7,%r15d
mov    $0xf,%ebx
lea    0xedb(%rip),%r13
movzbl %al,%eax
lea    0xe61(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x36b0,%r14d
mov    $0xb,%r15d
lea    0xeac(%rip),%r13
jmp    121e <write_cg_info+0xbe>
mov    $0x124f8,%r14d
mov    $0xd,%r15d
mov    $0x4b,%ebx
lea    0xe96(%rip),%r13
jmp    121e <write_cg_info+0xbe>
mov    $0x249f0,%r14d
mov    $0xf,%r15d
mov    $0x4b,%ebx
lea    0xe80(%rip),%r13
jmp    121e <write_cg_info+0xbe>
mov    $0x16e360,%r14d
mov    $0x15,%r15d
mov    $0x64,%ebx
lea    0xe6b(%rip),%r13
jmp    121e <write_cg_info+0xbe>
mov    $0x1b58,%r14d
mov    $0x8,%r15d
lea    0xe45(%rip),%r13
lea    0xe86(%rip),%rsi
lea    0xea7(%rip),%rbp
mov    %r12,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe9c(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeab(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeaa(%rip),%rsi
lea    0xebe(%rip),%rbp
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %r15d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeaf(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeb3(%rip),%rsi
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeb6(%rip),%rsi
lea    0xd9f(%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    0xe78(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
lea    0xe96(%rip),%rsi
mov    %r12,%rdi
lea    0xda1(%rip),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe99(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
mov    %r13d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xea6(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xebd(%rip),%rsi
mov    %r12,%rdi
mov    %rbx,%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    0xce0(%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 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.8 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.9 = [9 x i8] c" \00"
@.str.10 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.11 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.12 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.13 = [8 x i8] c" > \00"
@.str.14 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.15 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.16 = [27 x i8] c"%s rcond=%s )\0A\00"
@.str.17 = [55 x i8] c"\0Ac number of nodes for which this version is compiled\0A\00"
@.str.18 = [30 x i8] c"%sinteger nnodes_compiled\0A\00"
@.str.19 = [36 x i8] c"%sparameter( nnodes_compiled = %d)\0A\00"
@.str.20 = [43 x i8] c"%sinteger num_proc_cols, num_proc_rows\0A\00"
@.str.21 = [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 i32
%19 = 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
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 83
br i1 %22, label %23, label %25
23: ; preds = %3
store i32 1400, i32* %7
store i32 7, i32* %8
store i32 15, i32* %9
%24 = load i8*, i8** %12
store i8* %24, i8** %10
br label %64
25: ; preds = %3
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 87
br i1 %28, label %29, label %31
29: ; preds = %25
store i32 7000, i32* %7
store i32 8, i32* %8
store i32 15, i32* %9
%30 = load i8*, i8** %13
store i8* %30, i8** %10
br label %63
31: ; preds = %25
%32 = load i8, i8* %6
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 65
br i1 %34, label %35, label %37
35: ; preds = %31
store i32 14000, i32* %7
store i32 11, i32* %8
store i32 15, i32* %9
%36 = load i8*, i8** %14
store i8* %36, i8** %10
br label %62
37: ; preds = %31
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 66
br i1 %40, label %41, label %43
41: ; preds = %37
store i32 75000, i32* %7
store i32 13, i32* %8
store i32 75, i32* %9
%42 = load i8*, i8** %15
store i8* %42, i8** %10
br label %61
43: ; preds = %37
%44 = load i8, i8* %6
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 67
br i1 %46, label %47, label %49
47: ; preds = %43
store i32 150000, i32* %7
store i32 15, i32* %8
store i32 75, i32* %9
%48 = load i8*, i8** %16
store i8* %48, i8** %10
br label %60
49: ; preds = %43
%50 = load i8, i8* %6
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 68
br i1 %52, label %53, label %55
53: ; preds = %49
store i32 1500000, i32* %7
store i32 21, i32* %8
store i32 100, i32* %9
%54 = load i8*, i8** %17
store i8* %54, i8** %10
br label %59
55: ; preds = %49
%56 = load i8, i8* %6
%57 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8 signext %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %53
br label %60
60: ; preds = %59, %47
br label %61
61: ; preds = %60, %41
br label %62
62: ; preds = %61, %35
br label %63
63: ; preds = %62, %29
br label %64
64: ; preds = %63, %23
%65 = load i32*, i32** %4
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%67 = load i32*, i32** %4
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%69 = load i32*, i32** %4
%70 = load i32, i32* %7
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %70)
%72 = load i32*, i32** %4
%73 = load i32, i32* %8
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %73)
%75 = load i32*, i32** %4
%76 = load i32, i32* %9
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, 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.13, i64 0, i64 0), i32 %76)
%78 = load i32*, i32** %4
%79 = load i8*, i8** %10
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, 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.13, i64 0, i64 0), i8* %79)
%81 = load i32*, i32** %4
%82 = load i8*, i8** %11
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* %82)
%84 = load i32, i32* %5
%85 = call i32 @ilog2(i32 %84)
%86 = sdiv i32 %85, 2
store i32 %86, i32* %19
store i32 %86, i32* %18
%87 = load i32, i32* %18
%88 = load i32, i32* %19
%89 = add nsw i32 %87, %88
%90 = load i32, i32* %5
%91 = call i32 @ilog2(i32 %90)
%92 = icmp ne i32 %89, %91
br i1 %92, label %93, label %96
93: ; preds = %64
%94 = load i32, i32* %18
%95 = add nsw i32 %94, 1
store i32 %95, i32* %18
br label %96
96: ; preds = %93, %64
%97 = load i32, i32* %18
%98 = call i32 @ipow2(i32 %97)
store i32 %98, i32* %18
%99 = load i32, i32* %19
%100 = call i32 @ipow2(i32 %99)
store i32 %100, i32* %19
%101 = load i32*, i32** %4
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.17, i64 0, i64 0))
%103 = load i32*, i32** %4
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %103, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%105 = load i32*, i32** %4
%106 = load i32, i32* %5
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %106)
%108 = load i32*, i32** %4
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%110 = load i32*, i32** %4
%111 = load i32, i32* %18
%112 = load i32, i32* %19
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %110, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %111, i32 %112)
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 = [50 x i8] c"setparams: Internal error: invalid class type %c\0A\00"
@.str.8 = [40 x i8] c"%sinteger na, nonzer, niter\0A\00"
@.str.9 = [9 x i8] c" \00"
@.str.10 = [35 x i8] c"%sdouble precision shift, rcond\0A\00"
@.str.11 = [22 x i8] c"%sparameter( na=%d,\0A\00"
@.str.12 = [27 x i8] c"%s nonzer=%d,\0A\00"
@.str.13 = [8 x i8] c" > \00"
@.str.14 = [26 x i8] c"%s niter=%d,\0A\00"
@.str.15 = [26 x i8] c"%s shift=%s,\0A\00"
@.str.16 = [27 x i8] c"%s rcond=%s )\0A\00"
@.str.17 = [55 x i8] c"\0Ac number of nodes for which this version is compiled\0A\00"
@.str.18 = [30 x i8] c"%sinteger nnodes_compiled\0A\00"
@.str.19 = [36 x i8] c"%sparameter( nnodes_compiled = %d)\0A\00"
@.str.20 = [43 x i8] c"%sinteger num_proc_cols, num_proc_rows\0A\00"
@.str.21 = [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 %9 [
i8 83, label %12
i8 87, label %4
i8 65, label %5
i8 66, label %6
i8 67, label %7
i8 68, label %8
]
4: ; preds = %3
br label %12
5: ; preds = %3
br label %12
6: ; preds = %3
br label %12
7: ; preds = %3
br label %12
8: ; preds = %3
br label %12
9: ; preds = %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8 signext %2)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3, %4, %6, %8, %7, %5
%13 = 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 ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %3 ]
%14 = phi i32 [ 15, %4 ], [ 15, %5 ], [ 75, %6 ], [ 75, %7 ], [ 100, %8 ], [ 15, %3 ]
%15 = phi i32 [ 8, %4 ], [ 11, %5 ], [ 13, %6 ], [ 15, %7 ], [ 21, %8 ], [ 7, %3 ]
%16 = phi i32 [ 7000, %4 ], [ 14000, %5 ], [ 75000, %6 ], [ 150000, %7 ], [ 1500000, %8 ], [ 1400, %3 ]
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%18 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %16)
%20 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %15)
%21 = tail call i32 (i32*, 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.13, i64 0, i64 0), i32 %14)
%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.13, i64 0, i64 0), i8* %13)
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = tail call i32 @ilog2(i32 %1)
%25 = sdiv i32 %24, 2
%26 = shl nsw i32 %25, 1
%27 = tail call i32 @ilog2(i32 %1)
%28 = icmp ne i32 %26, %27
%29 = zext i1 %28 to i32
%30 = add nsw i32 %25, %29
%31 = tail call i32 @ipow2(i32 %30)
%32 = tail call i32 @ipow2(i32 %25)
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.17, i64 0, i64 0), i64 54, i64 1, i32* %0)
%34 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%35 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %1)
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%37 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %31, i32 %32)
ret void
}