#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 */

/* Variables and functions */
double ibm2flt(unsigned char *);
char *k5toa(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
void ensemble(unsigned char *pds, int mode) {
  int pdslen;
  unsigned char ctmp;
  char char_end;
  pdslen = ((int)((pds[0] << 16) + (pds[1] << 8) + pds[2]));
  char_end = mode == 2 ? ' ' : ':';
  if ((pds[4]) == 98) {
  } else if ((pds[4]) == 7 && pdslen >= 45 && pds[40] == 1) {
    if (pds[41] == 1) {
      if (mode != 2) {
        printf("ens%c0:", pds[42] == 1 ? '+' : '-');
      } else {
        printf("%s-res_ens_control ", pds[42] == 1 ? "hi" : "low");
      }
    } else if (pds[41] == 2 || pds[41] == 3) {
      if (mode != 2) {
        printf("ens%c%d:", pds[41] == 3 ? '+' : '-', pds[42]);
      } else {
        printf("ens_perturbation=%c%d ", pds[41] == 3 ? '+' : '-', pds[42]);
      }
    } else if (pds[41] == 5) {
      if ((pds[8]) != 191 && (pds[8]) != 192) {
        if (mode != 2 || pdslen < 61) {
          printf("ens-mean%c", char_end);
        } else {
          printf("ensemble-mean(%d members) ", pds[60]);
        }
      }
    } else {
      printf("ens %d/%d/%d/%d:", pds[41], pds[42], pds[43], pds[44]);
    }
    if (((pds[8]) == 191 || (pds[8]) == 192) && pdslen >= 47) {
      ctmp = (pds[8]);
      (pds[8]) = pds[45];
      if (pds[46] == 1 && pdslen >= 51) {
        printf("prob(%s<%f)%c", k5toa(pds), ibm2flt(pds + 47), char_end);
      } else if (pds[46] == 2 && pdslen >= 54) {
        printf("prob(%s>%f)%c", k5toa(pds), ibm2flt(pds + 51), char_end);
      } else if (pds[46] == 3 && pdslen >= 54) {
        printf("prob(%f<%s<%f)%c", ibm2flt(pds + 47), k5toa(pds),
               ibm2flt(pds + 51), char_end);
      }
      (pds[8]) = ctmp;
    }
  }
}


x86 assembly (clang, -O0):
<ensemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x3a,%eax
mov    $0x20,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x62,%eax
jne    118f <ensemble+0x5f>
jmp    14e9 <ensemble+0x3b9>
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x7,%eax
jne    14e4 <ensemble+0x3b4>
cmpl   $0x2d,-0x10(%rbp)
jl     14e4 <ensemble+0x3b4>
mov    -0x8(%rbp),%rax
movzbl 0x28(%rax),%eax
cmp    $0x1,%eax
jne    14e4 <ensemble+0x3b4>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%eax
cmp    $0x1,%eax
jne    1231 <ensemble+0x101>
cmpl   $0x2,-0xc(%rbp)
je     1201 <ensemble+0xd1>
mov    -0x8(%rbp),%rax
movzbl 0x2a(%rax),%ecx
mov    $0x2d,%esi
mov    $0x2b,%eax
cmp    $0x1,%ecx
cmove  %eax,%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122c <ensemble+0xfc>
mov    -0x8(%rbp),%rax
movzbl 0x2a(%rax),%ecx
lea    0xe0f(%rip),%rsi
lea    0xe05(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rsi
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    137e <ensemble+0x24e>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%eax
cmp    $0x2,%eax
je     1253 <ensemble+0x123>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%eax
cmp    $0x3,%eax
jne    12c3 <ensemble+0x193>
cmpl   $0x2,-0xc(%rbp)
je     1290 <ensemble+0x160>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%ecx
mov    $0x2d,%esi
mov    $0x2b,%eax
cmp    $0x3,%ecx
cmove  %eax,%esi
mov    -0x8(%rbp),%rax
movzbl 0x2a(%rax),%edx
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12be <ensemble+0x18e>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%ecx
mov    $0x2d,%esi
mov    $0x2b,%eax
cmp    $0x3,%ecx
cmove  %eax,%esi
mov    -0x8(%rbp),%rax
movzbl 0x2a(%rax),%edx
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1379 <ensemble+0x249>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%eax
cmp    $0x5,%eax
jne    1345 <ensemble+0x215>
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
cmp    $0xbf,%eax
je     1340 <ensemble+0x210>
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
cmp    $0xc0,%eax
je     1340 <ensemble+0x210>
cmpl   $0x2,-0xc(%rbp)
jne    130e <ensemble+0x1de>
cmpl   $0x3d,-0x10(%rbp)
jge    1325 <ensemble+0x1f5>
movsbl -0x12(%rbp),%esi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    133b <ensemble+0x20b>
mov    -0x8(%rbp),%rax
movzbl 0x3c(%rax),%esi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1340 <ensemble+0x210>
jmp    1374 <ensemble+0x244>
mov    -0x8(%rbp),%rax
movzbl 0x29(%rax),%esi
mov    -0x8(%rbp),%rax
movzbl 0x2a(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x2b(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0x2c(%rax),%r8d
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1379 <ensemble+0x249>
jmp    137e <ensemble+0x24e>
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
cmp    $0xbf,%eax
je     13a4 <ensemble+0x274>
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%eax
cmp    $0xc0,%eax
jne    14df <ensemble+0x3af>
cmpl   $0x2f,-0x10(%rbp)
jl     14df <ensemble+0x3af>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2d(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x2e(%rax),%eax
cmp    $0x1,%eax
jne    1416 <ensemble+0x2e6>
cmpl   $0x33,-0x10(%rbp)
jl     1416 <ensemble+0x2e6>
mov    -0x8(%rbp),%rdi
call   1040 <k5toa@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2f,%rdi
call   1050 <ibm2flt@plt>
mov    -0x20(%rbp),%rsi
movsbl -0x12(%rbp),%edx
lea    0xc70(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    14d5 <ensemble+0x3a5>
mov    -0x8(%rbp),%rax
movzbl 0x2e(%rax),%eax
cmp    $0x2,%eax
jne    1466 <ensemble+0x336>
cmpl   $0x36,-0x10(%rbp)
jl     1466 <ensemble+0x336>
mov    -0x8(%rbp),%rdi
call   1040 <k5toa@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x33,%rdi
call   1050 <ibm2flt@plt>
mov    -0x28(%rbp),%rsi
movsbl -0x12(%rbp),%edx
lea    0xc2e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    14d0 <ensemble+0x3a0>
mov    -0x8(%rbp),%rax
movzbl 0x2e(%rax),%eax
cmp    $0x3,%eax
jne    14cb <ensemble+0x39b>
cmpl   $0x36,-0x10(%rbp)
jl     14cb <ensemble+0x39b>
mov    -0x8(%rbp),%rdi
add    $0x2f,%rdi
call   1050 <ibm2flt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <k5toa@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x33,%rdi
call   1050 <ibm2flt@plt>
mov    -0x38(%rbp),%rsi
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsbl -0x12(%rbp),%edx
lea    0xbd2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    14d0 <ensemble+0x3a0>
jmp    14d5 <ensemble+0x3a5>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
jmp    14e4 <ensemble+0x3b4>
jmp    14e9 <ensemble+0x3b9>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensemble>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
mov    $0x20,%eax
mov    $0x3a,%ebp
cmove  %eax,%ebp
mov    0x4(%rdi),%al
cmp    $0x62,%al
je     12f1 <ensemble+0x1c1>
cmp    $0x7,%al
jne    12f1 <ensemble+0x1c1>
mov    %rdi,%rbx
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%r14d
or     %ecx,%r14d
cmp    $0x2d,%r14d
jb     12f1 <ensemble+0x1c1>
cmpb   $0x1,0x28(%rbx)
jne    12f1 <ensemble+0x1c1>
mov    0x29(%rbx),%al
lea    -0x2(%rax),%ecx
cmp    $0x2,%cl
jb     11ce <ensemble+0x9e>
cmp    $0x5,%al
je     11ed <ensemble+0xbd>
cmp    $0x1,%al
jne    120e <ensemble+0xde>
mov    0x2a(%rbx),%al
cmp    $0x2,%esi
jne    1240 <ensemble+0x110>
cmp    $0x1,%al
lea    0xe6c(%rip),%rax
lea    0xe68(%rip),%rsi
cmove  %rax,%rsi
lea    0xe46(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1268 <ensemble+0x138>
xor    %ecx,%ecx
cmp    $0x3,%al
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0x2b,%eax
movzbl 0x2a(%rbx),%edx
cmp    $0x2,%esi
jne    122e <ensemble+0xfe>
lea    0xe41(%rip),%rdi
jmp    1235 <ensemble+0x105>
mov    0x8(%rbx),%al
add    $0x41,%al
cmp    $0x2,%al
jb     1268 <ensemble+0x138>
cmp    $0x2,%esi
jne    1256 <ensemble+0x126>
cmp    $0x3c,%r14d
jbe    1256 <ensemble+0x126>
movzbl 0x3c(%rbx),%esi
lea    0xe42(%rip),%rdi
jmp    1261 <ensemble+0x131>
movzbl %al,%esi
movzbl 0x2a(%rbx),%edx
movzbl 0x2b(%rbx),%ecx
movzbl 0x2c(%rbx),%r8d
lea    0xe44(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1268 <ensemble+0x138>
lea    0xdee(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1268 <ensemble+0x138>
xor    %ecx,%ecx
cmp    $0x1,%al
setne  %cl
lea    (%rcx,%rcx,1),%esi
add    $0x2b,%esi
lea    0xdac(%rip),%rdi
jmp    1261 <ensemble+0x131>
movzbl %bpl,%esi
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%r15b
cmp    $0xbf,%r15b
jne    127a <ensemble+0x14a>
cmp    $0x2f,%r14d
jae    1286 <ensemble+0x156>
jmp    12f1 <ensemble+0x1c1>
cmp    $0xc0,%r15b
jne    12f1 <ensemble+0x1c1>
cmp    $0x2e,%r14d
jbe    12f1 <ensemble+0x1c1>
mov    0x2d(%rbx),%cl
mov    0x2e(%rbx),%al
mov    %cl,0x8(%rbx)
cmp    $0x1,%al
jne    12ba <ensemble+0x18a>
cmp    $0x33,%r14d
jb     12ba <ensemble+0x18a>
mov    %rbx,%rdi
call   1040 <k5toa@plt>
mov    %rax,%r14
lea    0x2f(%rbx),%rdi
call   1050 <ibm2flt@plt>
movzbl %bpl,%edx
lea    0xdc2(%rip),%rdi
jmp    12e3 <ensemble+0x1b3>
cmp    $0x2,%al
jne    12fc <ensemble+0x1cc>
cmp    $0x36,%r14d
jb     12fc <ensemble+0x1cc>
mov    %rbx,%rdi
call   1040 <k5toa@plt>
mov    %rax,%r14
lea    0x33(%rbx),%rdi
call   1050 <ibm2flt@plt>
movzbl %bpl,%edx
lea    0xda5(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r15b,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x3,%al
jne    12ed <ensemble+0x1bd>
cmp    $0x36,%r14d
jb     12ed <ensemble+0x1bd>
lea    0x2f(%rbx),%rdi
call   1050 <ibm2flt@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <k5toa@plt>
mov    %rax,%r14
lea    0x33(%rbx),%rdi
call   1050 <ibm2flt@plt>
movaps %xmm0,%xmm1
movzbl %bpl,%edx
lea    0xd60(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %r14,%rsi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    12ed <ensemble+0x1bd>

LLVM IR (-O0):
@.str = [8 x i8] c"ens%c0:\00"
@.str.1 = [20 x i8] c"%s-res_ens_control \00"
@.str.2 = [3 x i8] c"hi\00"
@.str.3 = [4 x i8] c"low\00"
@.str.4 = [9 x i8] c"ens%c%d:\00"
@.str.5 = [23 x i8] c"ens_perturbation=%c%d \00"
@.str.6 = [11 x i8] c"ens-mean%c\00"
@.str.7 = [27 x i8] c"ensemble-mean(%d members) \00"
@.str.8 = [17 x i8] c"ens %d/%d/%d/%d:\00"
@.str.9 = [14 x i8] c"prob(%s<%f)%c\00"
@.str.10 = [14 x i8] c"prob(%s>%f)%c\00"
@.str.11 = [17 x i8] c"prob(%f<%s<%f)%c\00"
define void @ensemble(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = add nsw i32 %12, %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = add nsw i32 %18, %22
store i32 %23, i32* %5
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 2
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 32, i32 58
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 98
br i1 %33, label %34, label %35
34: ; preds = %2
br label %264
35: ; preds = %2
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = icmp eq i32 %39, 7
br i1 %40, label %41, label %263
41: ; preds = %35
%42 = load i32, i32* %5
%43 = icmp sge i32 %42, 45
br i1 %43, label %44, label %263
44: ; preds = %41
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i64 40
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %263
50: ; preds = %44
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 41
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %78
56: ; preds = %50
%57 = load i32, i32* %4
%58 = icmp ne i32 %57, 2
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 42
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = icmp eq i32 %63, 1
%65 = zext i1 %64 to i64
%66 = select i1 %64, i32 43, i32 45
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %66)
br label %77
68: ; preds = %56
%69 = load i8*, i8** %3
%70 = getelementptr inbounds i8, i8* %69, i64 42
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = icmp eq i32 %72, 1
%74 = zext i1 %73 to i64
%75 = select i1 %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %68, %59
br label %176
78: ; preds = %50
%79 = load i8*, i8** %3
%80 = getelementptr inbounds i8, i8* %79, i64 41
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = icmp eq i32 %82, 2
br i1 %83, label %90, label %84
84: ; preds = %78
%85 = load i8*, i8** %3
%86 = getelementptr inbounds i8, i8* %85, i64 41
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = icmp eq i32 %88, 3
br i1 %89, label %90, label %120
90: ; preds = %84, %78
%91 = load i32, i32* %4
%92 = icmp ne i32 %91, 2
br i1 %92, label %93, label %106
93: ; preds = %90
%94 = load i8*, i8** %3
%95 = getelementptr inbounds i8, i8* %94, i64 41
%96 = load i8, i8* %95
%97 = zext i8 %96 to i32
%98 = icmp eq i32 %97, 3
%99 = zext i1 %98 to i64
%100 = select i1 %98, i32 43, i32 45
%101 = load i8*, i8** %3
%102 = getelementptr inbounds i8, i8* %101, i64 42
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %100, i32 %104)
br label %119
106: ; preds = %90
%107 = load i8*, i8** %3
%108 = getelementptr inbounds i8, i8* %107, i64 41
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = icmp eq i32 %110, 3
%112 = zext i1 %111 to i64
%113 = select i1 %111, i32 43, i32 45
%114 = load i8*, i8** %3
%115 = getelementptr inbounds i8, i8* %114, i64 42
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %113, i32 %117)
br label %119
119: ; preds = %106, %93
br label %175
120: ; preds = %84
%121 = load i8*, i8** %3
%122 = getelementptr inbounds i8, i8* %121, i64 41
%123 = load i8, i8* %122
%124 = zext i8 %123 to i32
%125 = icmp eq i32 %124, 5
br i1 %125, label %126, label %156
126: ; preds = %120
%127 = load i8*, i8** %3
%128 = getelementptr inbounds i8, i8* %127, i64 8
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = icmp ne i32 %130, 191
br i1 %131, label %132, label %155
132: ; preds = %126
%133 = load i8*, i8** %3
%134 = getelementptr inbounds i8, i8* %133, i64 8
%135 = load i8, i8* %134
%136 = zext i8 %135 to i32
%137 = icmp ne i32 %136, 192
br i1 %137, label %138, label %155
138: ; preds = %132
%139 = load i32, i32* %4
%140 = icmp ne i32 %139, 2
br i1 %140, label %144, label %141
141: ; preds = %138
%142 = load i32, i32* %5
%143 = icmp slt i32 %142, 61
br i1 %143, label %144, label %148
144: ; preds = %141, %138
%145 = load i8, i8* %7
%146 = sext i8 %145 to i32
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %146)
br label %154
148: ; preds = %141
%149 = load i8*, i8** %3
%150 = getelementptr inbounds i8, i8* %149, i64 60
%151 = load i8, i8* %150
%152 = zext i8 %151 to i32
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %152)
br label %154
154: ; preds = %148, %144
br label %155
155: ; preds = %154, %132, %126
br label %174
156: ; preds = %120
%157 = load i8*, i8** %3
%158 = getelementptr inbounds i8, i8* %157, i64 41
%159 = load i8, i8* %158
%160 = zext i8 %159 to i32
%161 = load i8*, i8** %3
%162 = getelementptr inbounds i8, i8* %161, i64 42
%163 = load i8, i8* %162
%164 = zext i8 %163 to i32
%165 = load i8*, i8** %3
%166 = getelementptr inbounds i8, i8* %165, i64 43
%167 = load i8, i8* %166
%168 = zext i8 %167 to i32
%169 = load i8*, i8** %3
%170 = getelementptr inbounds i8, i8* %169, i64 44
%171 = load i8, i8* %170
%172 = zext i8 %171 to i32
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 %160, i32 %164, i32 %168, i32 %172)
br label %174
174: ; preds = %156, %155
br label %175
175: ; preds = %174, %119
br label %176
176: ; preds = %175, %77
%177 = load i8*, i8** %3
%178 = getelementptr inbounds i8, i8* %177, i64 8
%179 = load i8, i8* %178
%180 = zext i8 %179 to i32
%181 = icmp eq i32 %180, 191
br i1 %181, label %188, label %182
182: ; preds = %176
%183 = load i8*, i8** %3
%184 = getelementptr inbounds i8, i8* %183, i64 8
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = icmp eq i32 %186, 192
br i1 %187, label %188, label %262
188: ; preds = %182, %176
%189 = load i32, i32* %5
%190 = icmp sge i32 %189, 47
br i1 %190, label %191, label %262
191: ; preds = %188
%192 = load i8*, i8** %3
%193 = getelementptr inbounds i8, i8* %192, i64 8
%194 = load i8, i8* %193
store i8 %194, i8* %6
%195 = load i8*, i8** %3
%196 = getelementptr inbounds i8, i8* %195, i64 45
%197 = load i8, i8* %196
%198 = load i8*, i8** %3
%199 = getelementptr inbounds i8, i8* %198, i64 8
store i8 %197, i8* %199
%200 = load i8*, i8** %3
%201 = getelementptr inbounds i8, i8* %200, i64 46
%202 = load i8, i8* %201
%203 = zext i8 %202 to i32
%204 = icmp eq i32 %203, 1
br i1 %204, label %205, label %217
205: ; preds = %191
%206 = load i32, i32* %5
%207 = icmp sge i32 %206, 51
br i1 %207, label %208, label %217
208: ; preds = %205
%209 = load i8*, i8** %3
%210 = call i8* @k5toa(i8* %209)
%211 = load i8*, i8** %3
%212 = getelementptr inbounds i8, i8* %211, i64 47
%213 = call double @ibm2flt(i8* %212)
%214 = load i8, i8* %7
%215 = sext i8 %214 to i32
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %210, double %213, i32 %215)
br label %258
217: ; preds = %205, %191
%218 = load i8*, i8** %3
%219 = getelementptr inbounds i8, i8* %218, i64 46
%220 = load i8, i8* %219
%221 = zext i8 %220 to i32
%222 = icmp eq i32 %221, 2
br i1 %222, label %223, label %235
223: ; preds = %217
%224 = load i32, i32* %5
%225 = icmp sge i32 %224, 54
br i1 %225, label %226, label %235
226: ; preds = %223
%227 = load i8*, i8** %3
%228 = call i8* @k5toa(i8* %227)
%229 = load i8*, i8** %3
%230 = getelementptr inbounds i8, i8* %229, i64 51
%231 = call double @ibm2flt(i8* %230)
%232 = load i8, i8* %7
%233 = sext i8 %232 to i32
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %228, double %231, i32 %233)
br label %257
235: ; preds = %223, %217
%236 = load i8*, i8** %3
%237 = getelementptr inbounds i8, i8* %236, i64 46
%238 = load i8, i8* %237
%239 = zext i8 %238 to i32
%240 = icmp eq i32 %239, 3
br i1 %240, label %241, label %256
241: ; preds = %235
%242 = load i32, i32* %5
%243 = icmp sge i32 %242, 54
br i1 %243, label %244, label %256
244: ; preds = %241
%245 = load i8*, i8** %3
%246 = getelementptr inbounds i8, i8* %245, i64 47
%247 = call double @ibm2flt(i8* %246)
%248 = load i8*, i8** %3
%249 = call i8* @k5toa(i8* %248)
%250 = load i8*, i8** %3
%251 = getelementptr inbounds i8, i8* %250, i64 51
%252 = call double @ibm2flt(i8* %251)
%253 = load i8, i8* %7
%254 = sext i8 %253 to i32
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), double %247, i8* %249, double %252, i32 %254)
br label %256
256: ; preds = %244, %241, %235
br label %257
257: ; preds = %256, %226
br label %258
258: ; preds = %257, %208
%259 = load i8, i8* %6
%260 = load i8*, i8** %3
%261 = getelementptr inbounds i8, i8* %260, i64 8
store i8 %259, i8* %261
br label %262
262: ; preds = %258, %188, %182
br label %263
263: ; preds = %262, %44, %41, %35
br label %264
264: ; preds = %263, %34
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ens%c0:\00"
@.str.1 = [20 x i8] c"%s-res_ens_control \00"
@.str.2 = [3 x i8] c"hi\00"
@.str.3 = [4 x i8] c"low\00"
@.str.4 = [9 x i8] c"ens%c%d:\00"
@.str.5 = [23 x i8] c"ens_perturbation=%c%d \00"
@.str.6 = [11 x i8] c"ens-mean%c\00"
@.str.7 = [27 x i8] c"ensemble-mean(%d members) \00"
@.str.8 = [17 x i8] c"ens %d/%d/%d/%d:\00"
@.str.9 = [14 x i8] c"prob(%s<%f)%c\00"
@.str.10 = [14 x i8] c"prob(%s>%f)%c\00"
@.str.11 = [17 x i8] c"prob(%f<%s<%f)%c\00"
define void @ensemble(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 16
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = icmp eq i32 %1, 2
%16 = select i1 %15, i8 32, i8 58
%17 = getelementptr inbounds i8, i8* %0, i64 4
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 98
br i1 %19, label %126, label %20
20: ; preds = %2
%21 = icmp eq i8 %18, 7
%22 = icmp ugt i32 %14, 44
%23 = select i1 %21, i1 %22, i1 false
br i1 %23, label %24, label %126
24: ; preds = %20
%25 = getelementptr inbounds i8, i8* %0, i64 40
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 1
br i1 %27, label %28, label %126
28: ; preds = %24
%29 = getelementptr inbounds i8, i8* %0, i64 41
%30 = load i8, i8* %29
switch i8 %30, label %68 [
i8 1, label %31
i8 2, label %41
i8 3, label %41
i8 5, label %51
]
31: ; preds = %28
%32 = getelementptr inbounds i8, i8* %0, i64 42
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 1
br i1 %15, label %38, label %35
35: ; preds = %31
%36 = select i1 %34, i32 43, i32 45
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %80
38: ; preds = %31
%39 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %39)
br label %80
41: ; preds = %28, %28
%42 = icmp eq i8 %30, 3
%43 = select i1 %42, i32 43, i32 45
%44 = getelementptr inbounds i8, i8* %0, i64 42
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
br i1 %15, label %49, label %47
47: ; preds = %41
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %43, i32 %46)
br label %80
49: ; preds = %41
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i32 %43, i32 %46)
br label %80
51: ; preds = %28
%52 = getelementptr inbounds i8, i8* %0, i64 8
%53 = load i8, i8* %52
%54 = add i8 %53, 65
%55 = icmp ult i8 %54, 2
br i1 %55, label %80, label %56
56: ; preds = %51
%57 = icmp ne i32 %1, 2
%58 = icmp ult i32 %14, 61
%59 = select i1 %57, i1 true, i1 %58
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = zext i8 %16 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %61)
br label %80
63: ; preds = %56
%64 = getelementptr inbounds i8, i8* %0, i64 60
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %66)
br label %80
68: ; preds = %28
%69 = zext i8 %30 to i32
%70 = getelementptr inbounds i8, i8* %0, i64 42
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = getelementptr inbounds i8, i8* %0, i64 43
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = getelementptr inbounds i8, i8* %0, i64 44
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 %69, i32 %72, i32 %75, i32 %78)
br label %80
80: ; preds = %51, %49, %47, %63, %60, %68, %35, %38
%81 = getelementptr inbounds i8, i8* %0, i64 8
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, -65
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = icmp eq i8 %82, -64
%86 = icmp ugt i32 %14, 46
%87 = select i1 %85, i1 %86, i1 false
br i1 %87, label %90, label %126
88: ; preds = %80
%89 = icmp ugt i32 %14, 46
br i1 %89, label %90, label %126
90: ; preds = %84, %88
%91 = getelementptr inbounds i8, i8* %0, i64 45
%92 = load i8, i8* %91
store i8 %92, i8* %81
%93 = getelementptr inbounds i8, i8* %0, i64 46
%94 = load i8, i8* %93
%95 = icmp eq i8 %94, 1
%96 = icmp ugt i32 %14, 50
%97 = select i1 %95, i1 %96, i1 false
br i1 %97, label %98, label %104
98: ; preds = %90
%99 = tail call i8* @k5toa(i8* %0)
%100 = getelementptr inbounds i8, i8* %0, i64 47
%101 = tail call double @ibm2flt(i8* %100)
%102 = zext i8 %16 to i32
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %99, double %101, i32 %102)
br label %125
104: ; preds = %90
%105 = icmp eq i8 %94, 2
%106 = icmp ugt i32 %14, 53
%107 = select i1 %105, i1 %106, i1 false
br i1 %107, label %108, label %114
108: ; preds = %104
%109 = tail call i8* @k5toa(i8* %0)
%110 = getelementptr inbounds i8, i8* %0, i64 51
%111 = tail call double @ibm2flt(i8* %110)
%112 = zext i8 %16 to i32
%113 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %109, double %111, i32 %112)
br label %125
114: ; preds = %104
%115 = icmp eq i8 %94, 3
%116 = select i1 %115, i1 %106, i1 false
br i1 %116, label %117, label %125
117: ; preds = %114
%118 = getelementptr inbounds i8, i8* %0, i64 47
%119 = tail call double @ibm2flt(i8* %118)
%120 = tail call i8* @k5toa(i8* %0)
%121 = getelementptr inbounds i8, i8* %0, i64 51
%122 = tail call double @ibm2flt(i8* %121)
%123 = zext i8 %16 to i32
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.11, i64 0, i64 0), double %119, i8* %120, double %122, i32 %123)
br label %125
125: ; preds = %108, %117, %114, %98
store i8 %82, i8* %81
br label %126
126: ; preds = %20, %24, %125, %88, %84, %2
ret void
}