#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 */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ stderr;
int parse_plugin_output(char *out, double *progress, char *msg) {
  int pos, done, s, d;
  char ch;
  *progress = -1;
  msg[0] = '\0';
  pos = 0;
  while (out[pos] != '\0' && out[pos] != '[')
    pos++;
  if (out[pos] != '[') {
    fprintf(stderr, "*** parse err at : 0 : cannot find leading '['\n");
    return -1;
  }
  pos++;
  ch = out[pos++];
  if (ch == 'P')
    sscanf(out + pos, "%lf", progress);
  while (out[pos] != '\0' && out[pos] != '"' && out[pos] != ']')
    pos++;
  if (out[pos] == '"') {
    pos++;
    done = 0;
    s = pos;
    d = 0;
    while (!done) {
      if (out[s] != '\\' && out[s] != '"' && out[s] != ']' && out[s] != '\0')
        msg[d++] = out[s++];
      else if (out[s] == '\\') {
        msg[d] = out[s + 1];
        s += 2;
        d++;
      } else {
        msg[d] = '\0';
        done = 1;
      }
    }
  }
  switch (ch) {
  case 'P':
    if (*progress < 0 || *progress > 1) {
      fprintf(stderr, "*** parse err at : 1 : invalid progress : %f\n",
              *progress);
      return -1;
    }
    return 0;
  case 'W':
    if (msg[0] == '\0') {
      fprintf(stderr, "*** parse err at : 2 : warning report w/o msg\n");
      return -1;
    }
    return 1;
  case 'E':
    if (msg[0] == '\0') {
      fprintf(stderr, "*** parse err at : 3 : error report w/o msg\n");
      return -1;
    }
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<parse_plugin_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x32(%rbp)
je     1181 <parse_plugin_output+0x61>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5b,%eax
setne  %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    1191 <parse_plugin_output+0x71>
jmp    119f <parse_plugin_output+0x7f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <parse_plugin_output+0x32>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5b,%eax
je     11d7 <parse_plugin_output+0xb7>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x50,%eax
jne    1220 <parse_plugin_output+0x100>
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rdx
lea    0xe25(%rip),%rsi
call   1040 <sscanf@plt>
jmp    1225 <parse_plugin_output+0x105>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x33(%rbp)
je     126e <parse_plugin_output+0x14e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x22,%ecx
mov    %al,-0x33(%rbp)
je     126e <parse_plugin_output+0x14e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
setne  %al
mov    %al,-0x33(%rbp)
mov    -0x33(%rbp),%al
test   $0x1,%al
jne    127e <parse_plugin_output+0x15e>
jmp    128c <parse_plugin_output+0x16c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1225 <parse_plugin_output+0x105>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    13c0 <parse_plugin_output+0x2a0>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x28(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12d4 <parse_plugin_output+0x1b4>
jmp    13bb <parse_plugin_output+0x29b>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     1357 <parse_plugin_output+0x237>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     1357 <parse_plugin_output+0x237>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5d,%eax
je     1357 <parse_plugin_output+0x237>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1357 <parse_plugin_output+0x237>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x30(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    13b6 <parse_plugin_output+0x296>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    139e <parse_plugin_output+0x27e>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13b1 <parse_plugin_output+0x291>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x28(%rbp)
jmp    13b6 <parse_plugin_output+0x296>
jmp    12be <parse_plugin_output+0x19e>
jmp    13c0 <parse_plugin_output+0x2a0>
movsbl -0x31(%rbp),%eax
mov    %eax,-0x38(%rbp)
sub    $0x45,%eax
je     1498 <parse_plugin_output+0x378>
jmp    13d5 <parse_plugin_output+0x2b5>
mov    -0x38(%rbp),%eax
sub    $0x50,%eax
je     13f7 <parse_plugin_output+0x2d7>
jmp    13e6 <parse_plugin_output+0x2c6>
mov    -0x38(%rbp),%eax
sub    $0x57,%eax
je     1459 <parse_plugin_output+0x339>
jmp    14d7 <parse_plugin_output+0x3b7>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     1422 <parse_plugin_output+0x302>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xbf0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    144d <parse_plugin_output+0x32d>
mov    0x2bb7(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xc0a(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
movl   $0x0,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    148c <parse_plugin_output+0x36c>
mov    0x2b70(%rip),%rax
mov    (%rax),%edi
lea    0xbf9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
movl   $0x1,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    14cb <parse_plugin_output+0x3ab>
mov    0x2b31(%rip),%rax
mov    (%rax),%edi
lea    0xbe9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
movl   $0x2,-0x4(%rbp)
jmp    14de <parse_plugin_output+0x3be>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_plugin_output>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r13
movabs $0xbff0000000000000,%rax
mov    %rax,(%rsi)
movb   $0x0,(%rdx)
mov    $0x3,%ebp
mov    $0x2,%ebx
xchg   %ax,%ax
movzbl -0x2(%r13,%rbx,1),%eax
test   %al,%al
je     1167 <parse_plugin_output+0x47>
cmp    $0x5b,%al
je     1192 <parse_plugin_output+0x72>
add    $0x1,%ebp
add    $0x1,%rbx
jmp    1150 <parse_plugin_output+0x30>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x1(%rbx),%eax
movsbl 0x0(%r13,%rax,1),%r12d
cmp    $0x50,%r12d
jne    11b5 <parse_plugin_output+0x95>
mov    %ebx,%edi
add    %r13,%rdi
lea    0xe8b(%rip),%rsi
mov    %r14,%rdx
call   1040 <sscanf@plt>
mov    %ebx,%eax
add    %r13,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
test   %cl,%cl
je     1227 <parse_plugin_output+0x107>
cmp    $0x22,%cl
je     11da <parse_plugin_output+0xba>
cmp    $0x5d,%cl
je     1227 <parse_plugin_output+0x107>
add    $0x1,%ebp
add    $0x1,%rax
jmp    11c0 <parse_plugin_output+0xa0>
mov    %r15,%rax
jmp    11f1 <parse_plugin_output+0xd1>
nop
movzbl 0x1(%rdx,%r13,1),%ecx
mov    %cl,(%rax)
add    $0x2,%edx
add    $0x1,%rax
mov    %edx,%ebp
movslq %ebp,%rdx
movzbl 0x0(%r13,%rdx,1),%ecx
cmp    $0x5b,%cl
jle    1210 <parse_plugin_output+0xf0>
cmp    $0x5c,%cl
je     11e0 <parse_plugin_output+0xc0>
cmp    $0x5d,%cl
jne    1219 <parse_plugin_output+0xf9>
jmp    1224 <parse_plugin_output+0x104>
nopl   0x0(%rax,%rax,1)
test   %cl,%cl
je     1224 <parse_plugin_output+0x104>
cmp    $0x22,%cl
je     1224 <parse_plugin_output+0x104>
add    $0x1,%ebp
mov    %cl,(%rax)
add    $0x1,%rax
jmp    11f1 <parse_plugin_output+0xd1>
movb   $0x0,(%rax)
mov    $0xffffffff,%eax
cmp    $0x45,%r12d
je     127d <parse_plugin_output+0x15d>
cmp    $0x57,%r12d
je     12a1 <parse_plugin_output+0x181>
cmp    $0x50,%r12d
jne    1183 <parse_plugin_output+0x63>
movsd  (%r14),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1261 <parse_plugin_output+0x141>
xor    %eax,%eax
ucomisd 0xda5(%rip),%xmm0
jbe    1183 <parse_plugin_output+0x63>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
lea    0xdcb(%rip),%rsi
mov    $0x1,%al
call   1030 <fprintf@plt>
jmp    117e <parse_plugin_output+0x5e>
mov    $0x2,%eax
cmpb   $0x0,(%r15)
jne    1183 <parse_plugin_output+0x63>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
lea    0xdfd(%rip),%rsi
jmp    1177 <parse_plugin_output+0x57>
mov    $0x1,%eax
cmpb   $0x0,(%r15)
jne    1183 <parse_plugin_output+0x63>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
lea    0xdaa(%rip),%rsi
jmp    1177 <parse_plugin_output+0x57>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"*** parse err at : 0 : cannot find leading '['\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [46 x i8] c"*** parse err at : 1 : invalid progress : %f\0A\00"
@.str.3 = [47 x i8] c"*** parse err at : 2 : warning report w/o msg\0A\00"
@.str.4 = [45 x i8] c"*** parse err at : 3 : error report w/o msg\0A\00"
define i32 @parse_plugin_output(i8* %0, double* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i8* %0, i8** %5
store double* %1, double** %6
store i8* %2, i8** %7
%13 = load double*, double** %6
store double -1.000000e+00, double* %13
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 0, i8* %15
store i32 0, i32* %8
br label %16
16: ; preds = %34, %3
%17 = load i8*, i8** %5
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = load i8*, i8** %5
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 91
br label %32
32: ; preds = %24, %16
%33 = phi i1 [ false, %16 ], [ %31, %24 ]
br i1 %33, label %34, label %37
34: ; preds = %32
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %16
37: ; preds = %32
%38 = load i8*, i8** %5
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 91
br i1 %44, label %45, label %48
45: ; preds = %37
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %226
48: ; preds = %37
%49 = load i32, i32* %8
%50 = add nsw i32 %49, 1
store i32 %50, i32* %8
%51 = load i8*, i8** %5
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds i8, i8* %51, i64 %54
%56 = load i8, i8* %55
store i8 %56, i8* %12
%57 = load i8, i8* %12
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 80
br i1 %59, label %60, label %67
60: ; preds = %48
%61 = load i8*, i8** %5
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = load double*, double** %6
%66 = call i32 @sscanf(i8* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %65)
br label %67
67: ; preds = %60, %48
br label %68
68: ; preds = %94, %67
%69 = load i8*, i8** %5
%70 = load i32, i32* %8
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %92
76: ; preds = %68
%77 = load i8*, i8** %5
%78 = load i32, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp ne i32 %82, 34
br i1 %83, label %84, label %92
84: ; preds = %76
%85 = load i8*, i8** %5
%86 = load i32, i32* %8
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp ne i32 %90, 93
br label %92
92: ; preds = %84, %76, %68
%93 = phi i1 [ false, %76 ], [ false, %68 ], [ %91, %84 ]
br i1 %93, label %94, label %97
94: ; preds = %92
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %68
97: ; preds = %92
%98 = load i8*, i8** %5
%99 = load i32, i32* %8
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %98, i64 %100
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 34
br i1 %104, label %105, label %188
105: ; preds = %97
%106 = load i32, i32* %8
%107 = add nsw i32 %106, 1
store i32 %107, i32* %8
store i32 0, i32* %9
%108 = load i32, i32* %8
store i32 %108, i32* %10
store i32 0, i32* %11
br label %109
109: ; preds = %186, %105
%110 = load i32, i32* %9
%111 = icmp ne i32 %110, 0
%112 = xor i1 %111, true
br i1 %112, label %113, label %187
113: ; preds = %109
%114 = load i8*, i8** %5
%115 = load i32, i32* %10
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp ne i32 %119, 92
br i1 %120, label %121, label %157
121: ; preds = %113
%122 = load i8*, i8** %5
%123 = load i32, i32* %10
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %122, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp ne i32 %127, 34
br i1 %128, label %129, label %157
129: ; preds = %121
%130 = load i8*, i8** %5
%131 = load i32, i32* %10
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8, i8* %130, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp ne i32 %135, 93
br i1 %136, label %137, label %157
137: ; preds = %129
%138 = load i8*, i8** %5
%139 = load i32, i32* %10
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %138, i64 %140
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %157
145: ; preds = %137
%146 = load i8*, i8** %5
%147 = load i32, i32* %10
%148 = add nsw i32 %147, 1
store i32 %148, i32* %10
%149 = sext i32 %147 to i64
%150 = getelementptr inbounds i8, i8* %146, i64 %149
%151 = load i8, i8* %150
%152 = load i8*, i8** %7
%153 = load i32, i32* %11
%154 = add nsw i32 %153, 1
store i32 %154, i32* %11
%155 = sext i32 %153 to i64
%156 = getelementptr inbounds i8, i8* %152, i64 %155
store i8 %151, i8* %156
br label %186
157: ; preds = %137, %129, %121, %113
%158 = load i8*, i8** %5
%159 = load i32, i32* %10
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %158, i64 %160
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 92
br i1 %164, label %165, label %180
165: ; preds = %157
%166 = load i8*, i8** %5
%167 = load i32, i32* %10
%168 = add nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i8, i8* %166, i64 %169
%171 = load i8, i8* %170
%172 = load i8*, i8** %7
%173 = load i32, i32* %11
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %172, i64 %174
store i8 %171, i8* %175
%176 = load i32, i32* %10
%177 = add nsw i32 %176, 2
store i32 %177, i32* %10
%178 = load i32, i32* %11
%179 = add nsw i32 %178, 1
store i32 %179, i32* %11
br label %185
180: ; preds = %157
%181 = load i8*, i8** %7
%182 = load i32, i32* %11
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %181, i64 %183
store i8 0, i8* %184
store i32 1, i32* %9
br label %185
185: ; preds = %180, %165
br label %186
186: ; preds = %185, %145
br label %109
187: ; preds = %109
br label %188
188: ; preds = %187, %97
%189 = load i8, i8* %12
%190 = sext i8 %189 to i32
switch i32 %190, label %225 [
i32 80, label %191
i32 87, label %205
i32 69, label %215
]
191: ; preds = %188
%192 = load double*, double** %6
%193 = load double, double* %192
%194 = fcmp olt double %193, 0.000000e+00
br i1 %194, label %199, label %195
195: ; preds = %191
%196 = load double*, double** %6
%197 = load double, double* %196
%198 = fcmp ogt double %197, 1.000000e+00
br i1 %198, label %199, label %204
199: ; preds = %195, %191
%200 = load i32, i32* @stderr
%201 = load double*, double** %6
%202 = load double, double* %201
%203 = call i32 (i32, i8*, ...) @fprintf(i32 %200, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %202)
store i32 -1, i32* %4
br label %226
204: ; preds = %195
store i32 0, i32* %4
br label %226
205: ; preds = %188
%206 = load i8*, i8** %7
%207 = getelementptr inbounds i8, i8* %206, i64 0
%208 = load i8, i8* %207
%209 = sext i8 %208 to i32
%210 = icmp eq i32 %209, 0
br i1 %210, label %211, label %214
211: ; preds = %205
%212 = load i32, i32* @stderr
%213 = call i32 (i32, i8*, ...) @fprintf(i32 %212, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %226
214: ; preds = %205
store i32 1, i32* %4
br label %226
215: ; preds = %188
%216 = load i8*, i8** %7
%217 = getelementptr inbounds i8, i8* %216, i64 0
%218 = load i8, i8* %217
%219 = sext i8 %218 to i32
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %224
221: ; preds = %215
%222 = load i32, i32* @stderr
%223 = call i32 (i32, i8*, ...) @fprintf(i32 %222, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %4
br label %226
224: ; preds = %215
store i32 2, i32* %4
br label %226
225: ; preds = %188
store i32 -1, i32* %4
br label %226
226: ; preds = %225, %224, %221, %214, %211, %204, %199, %45
%227 = load i32, i32* %4
ret i32 %227
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"*** parse err at : 0 : cannot find leading '['\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [46 x i8] c"*** parse err at : 1 : invalid progress : %f\0A\00"
@.str.3 = [47 x i8] c"*** parse err at : 2 : warning report w/o msg\0A\00"
@.str.4 = [45 x i8] c"*** parse err at : 3 : error report w/o msg\0A\00"
define i32 @parse_plugin_output(i8* nocapture %0, double* %1, i8* nocapture %2) {
store double -1.000000e+00, double* %1
store i8 0, i8* %2
br label %4
4: ; preds = %8, %3
%5 = phi i64 [ %9, %8 ], [ 0, %3 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 91, label %13
i8 0, label %10
]
8: ; preds = %4
%9 = add nuw i64 %5, 1
br label %4
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %80
13: ; preds = %4
%14 = add i64 %5, 1
%15 = add i64 %5, 2
%16 = and i64 %14, 4294967295
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i8 %18, 80
%21 = and i64 %15, 4294967295
br i1 %20, label %22, label %25
22: ; preds = %13
%23 = getelementptr inbounds i8, i8* %0, i64 %21
%24 = tail call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
br label %25
25: ; preds = %13, %22
br label %26
26: ; preds = %25, %30
%27 = phi i64 [ %31, %30 ], [ %21, %25 ]
%28 = getelementptr inbounds i8, i8* %0, i64 %27
%29 = load i8, i8* %28
switch i8 %29, label %30 [
i8 34, label %32
i8 0, label %59
i8 93, label %59
]
30: ; preds = %26
%31 = add nuw i64 %27, 1
br label %26
32: ; preds = %26
%33 = trunc i64 %27 to i32
%34 = add nuw nsw i32 %33, 1
br label %35
35: ; preds = %53, %32
%36 = phi i32 [ 0, %32 ], [ %55, %53 ]
%37 = phi i32 [ %34, %32 ], [ %54, %53 ]
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %0, i64 %38
%40 = load i8, i8* %39
switch i8 %40, label %41 [
i8 92, label %45
i8 0, label %56
i8 34, label %56
i8 93, label %56
]
41: ; preds = %35
%42 = add nsw i32 %37, 1
%43 = zext i32 %36 to i64
%44 = getelementptr inbounds i8, i8* %2, i64 %43
store i8 %40, i8* %44
br label %53
45: ; preds = %35
%46 = add nsw i32 %37, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %0, i64 %47
%49 = load i8, i8* %48
%50 = zext i32 %36 to i64
%51 = getelementptr inbounds i8, i8* %2, i64 %50
store i8 %49, i8* %51
%52 = add nsw i32 %37, 2
br label %53
53: ; preds = %45, %41
%54 = phi i32 [ %52, %45 ], [ %42, %41 ]
%55 = add nuw nsw i32 %36, 1
br label %35
56: ; preds = %35, %35, %35
%57 = zext i32 %36 to i64
%58 = getelementptr inbounds i8, i8* %2, i64 %57
store i8 0, i8* %58
br label %59
59: ; preds = %26, %26, %56
switch i32 %19, label %80 [
i32 80, label %60
i32 87, label %68
i32 69, label %74
]
60: ; preds = %59
%61 = load double, double* %1
%62 = fcmp olt double %61, 0.000000e+00
%63 = fcmp ogt double %61, 1.000000e+00
%64 = or i1 %62, %63
br i1 %64, label %65, label %80
65: ; preds = %60
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %61)
br label %80
68: ; preds = %59
%69 = load i8, i8* %2
%70 = icmp eq i8 %69, 0
br i1 %70, label %71, label %80
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
br label %80
74: ; preds = %59
%75 = load i8, i8* %2
%76 = icmp eq i8 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = load i32, i32* @stderr
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
br label %80
80: ; preds = %59, %74, %68, %60, %77, %71, %65, %10
%81 = phi i32 [ -1, %10 ], [ -1, %77 ], [ -1, %71 ], [ -1, %65 ], [ 0, %60 ], [ 1, %68 ], [ 2, %74 ], [ -1, %59 ]
ret i32 %81
}