#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 */
scalar_t__ ERANGE;
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ isfinite(float);
float *malloc(int);
int /*<<< orphan*/ memcpy(float *, float *, int);
int /*<<< orphan*/ stderr;
float strtof(char const *, char **);
float *tempered_util__parse_calibration_string(char const *string,
                                               int *found_count,
                                               bool print_errors) {
  if (string == NULL || found_count == NULL) {
    if (found_count != NULL) {
      *found_count = -1;
    }
    if (print_errors) {
      fprintf(stderr, "parse_calibration_string: Invalid parameters.\n");
    }
    return NULL;
  }
  int count = 1, i;
  for (i = 0; string[i] != '\0'; i++) {
    if (string[i] == ':') {
      count++;
    }
  }
  float values[count];
  char const *startptr = string;
  char *endptr;
  for (i = 0; i < count; i++) {
    if (*startptr == ':' || *startptr == '\0') {
      values[i] = 0;
      startptr++;
      continue;
    }
    errno = 0;
    values[i] = strtof(startptr, &endptr);
    if (errno != 0) {
      *found_count = -2;
      if (print_errors) {
        if (errno == ERANGE) {
          fprintf(stderr, "Calibration: value is out of range.\n");
        } else {
          fprintf(stderr, "Calibration: parsing value failed: %s\n", startptr);
        }
      }
      return NULL;
    }
    if (*endptr != ':' && *endptr != '\0') {
      *found_count = -3;
      if (print_errors) {
        fprintf(stderr, "Calibration: parsing value failed: %s\n", startptr);
      }
      return NULL;
    }
    if (!isfinite(values[i])) {
      *found_count = -4;
      if (print_errors) {
        fprintf(stderr, "Calibration: values must be finite.\n");
      }
      return NULL;
    }
    startptr = endptr;
    startptr++;
  }
  float *heap_values = malloc((count < 2 ? 2 : count) * sizeof(float));
  if (heap_values == NULL) {
    *found_count = -5;
    if (print_errors) {
      fprintf(stderr, "Calibration: unable to allocate memory.\n");
    }
    return NULL;
  }
  memcpy(heap_values, values, count * sizeof(float));
  if (count < 2) {
    heap_values[1] = 1;
  }
  *found_count = (count < 2 ? 2 : count);
  return heap_values;
}


x86 assembly (clang, -O0):
<tempered_util__parse_calibration_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1179 <tempered_util__parse_calibration_string+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    11bc <tempered_util__parse_calibration_string+0x6c>
cmpq   $0x0,-0x18(%rbp)
je     118e <tempered_util__parse_calibration_string+0x3e>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     11af <tempered_util__parse_calibration_string+0x5f>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1512 <tempered_util__parse_calibration_string+0x3c2>
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1210 <tempered_util__parse_calibration_string+0xc0>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    11fd <tempered_util__parse_calibration_string+0xad>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1202 <tempered_util__parse_calibration_string+0xb2>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ca <tempered_util__parse_calibration_string+0x7a>
mov    -0x20(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1429 <tempered_util__parse_calibration_string+0x2d9>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     1272 <tempered_util__parse_calibration_string+0x122>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1293 <tempered_util__parse_calibration_string+0x143>
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    141b <tempered_util__parse_calibration_string+0x2cb>
mov    0x2d36(%rip),%rax
movq   $0x0,(%rax)
mov    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1030 <strtof@plt>
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    0x2d0e(%rip),%rax
cmpq   $0x0,(%rax)
je     134a <tempered_util__parse_calibration_string+0x1fa>
mov    -0x18(%rbp),%rax
movl   $0xfffffffe,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1336 <tempered_util__parse_calibration_string+0x1e6>
mov    0x2ce9(%rip),%rax
mov    (%rax),%rax
mov    0x2cf7(%rip),%rcx
cmp    (%rcx),%rax
jne    1316 <tempered_util__parse_calibration_string+0x1c6>
mov    0x2cd7(%rip),%rax
mov    (%rax),%edi
lea    0xd29(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1331 <tempered_util__parse_calibration_string+0x1e1>
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xd2e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1336 <tempered_util__parse_calibration_string+0x1e6>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    150b <tempered_util__parse_calibration_string+0x3bb>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     13ad <tempered_util__parse_calibration_string+0x25d>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13ad <tempered_util__parse_calibration_string+0x25d>
mov    -0x18(%rbp),%rax
movl   $0xfffffffd,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1399 <tempered_util__parse_calibration_string+0x249>
mov    0x2c53(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xcc6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    150b <tempered_util__parse_calibration_string+0x3bb>
mov    -0x60(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1060 <isfinite@plt>
cmp    $0x0,%eax
jne    1407 <tempered_util__parse_calibration_string+0x2b7>
mov    -0x18(%rbp),%rax
movl   $0xfffffffc,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     13f3 <tempered_util__parse_calibration_string+0x2a3>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
lea    0xc93(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    150b <tempered_util__parse_calibration_string+0x3bb>
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1246 <tempered_util__parse_calibration_string+0xf6>
cmpl   $0x2,-0x20(%rbp)
jge    1440 <tempered_util__parse_calibration_string+0x2f0>
mov    $0x2,%eax
mov    %eax,-0x64(%rbp)
jmp    1446 <tempered_util__parse_calibration_string+0x2f6>
mov    -0x20(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    14a4 <tempered_util__parse_calibration_string+0x354>
mov    -0x18(%rbp),%rax
movl   $0xfffffffb,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1490 <tempered_util__parse_calibration_string+0x340>
mov    0x2b58(%rip),%rax
mov    (%rax),%edi
lea    0xc1b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x4c(%rbp)
jmp    150b <tempered_util__parse_calibration_string+0x3bb>
mov    -0x60(%rbp),%rsi
mov    -0x58(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
cmpl   $0x2,-0x20(%rbp)
jge    14d6 <tempered_util__parse_calibration_string+0x386>
mov    -0x58(%rbp),%rax
movss  0xb2f(%rip),%xmm0
movss  %xmm0,0x4(%rax)
cmpl   $0x2,-0x20(%rbp)
jge    14ed <tempered_util__parse_calibration_string+0x39d>
mov    $0x2,%eax
mov    %eax,-0x68(%rbp)
jmp    14f3 <tempered_util__parse_calibration_string+0x3a3>
mov    -0x20(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempered_util__parse_calibration_string>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
test   %rdi,%rdi
je     1285 <tempered_util__parse_calibration_string+0x135>
test   %rsi,%rsi
je     1285 <tempered_util__parse_calibration_string+0x135>
mov    %rdi,%r12
mov    %edx,-0x34(%rbp)
mov    %rsi,-0x40(%rbp)
mov    $0x1,%r14d
mov    %rdi,%rax
jmp    1198 <tempered_util__parse_calibration_string+0x48>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x3a,%cl
je     1190 <tempered_util__parse_calibration_string+0x40>
test   %cl,%cl
jne    1194 <tempered_util__parse_calibration_string+0x44>
mov    %rsp,-0x30(%rbp)
mov    %r14d,%r13d
mov    %rsp,%rdx
lea    0xf(,%r13,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,-0x48(%rbp)
mov    %rdx,%rsp
test   %r14d,%r14d
jle    12b3 <tempered_util__parse_calibration_string+0x163>
xor    %r15d,%r15d
jmp    1203 <tempered_util__parse_calibration_string+0xb3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x48(%rbp),%rax
movl   $0x0,(%rax,%r15,4)
mov    %r12,%rbx
add    $0x1,%rbx
add    $0x1,%r15
mov    %rbx,%r12
cmp    %r15,%r13
je     12b3 <tempered_util__parse_calibration_string+0x163>
movzbl (%r12),%eax
cmp    $0x3a,%al
je     11e0 <tempered_util__parse_calibration_string+0x90>
test   %al,%al
je     11e0 <tempered_util__parse_calibration_string+0x90>
mov    0x2db9(%rip),%rbx
movq   $0x0,(%rbx)
mov    %r12,%rdi
lea    -0x50(%rbp),%rsi
call   1030 <strtof@plt>
mov    -0x48(%rbp),%rax
movss  %xmm0,(%rax,%r15,4)
mov    (%rbx),%rax
test   %rax,%rax
jne    1335 <tempered_util__parse_calibration_string+0x1e5>
mov    -0x50(%rbp),%rbx
movzbl (%rbx),%eax
test   %al,%al
je     1253 <tempered_util__parse_calibration_string+0x103>
cmp    $0x3a,%al
jne    1363 <tempered_util__parse_calibration_string+0x213>
call   1060 <isfinite@plt>
test   %eax,%eax
jne    11ef <tempered_util__parse_calibration_string+0x9f>
mov    -0x40(%rbp),%rax
movl   $0xfffffffc,(%rax)
cmpl   $0x0,-0x34(%rbp)
je     1392 <tempered_util__parse_calibration_string+0x242>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
lea    0xdfb(%rip),%rsi
jmp    1329 <tempered_util__parse_calibration_string+0x1d9>
test   %rsi,%rsi
je     1290 <tempered_util__parse_calibration_string+0x140>
movl   $0xffffffff,(%rsi)
test   %edx,%edx
je     1301 <tempered_util__parse_calibration_string+0x1b1>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
lea    0xd5c(%rip),%rsi
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    139c <tempered_util__parse_calibration_string+0x24c>
cmp    $0x2,%r14d
mov    $0x2,%ebx
cmovge %r14d,%ebx
lea    0x0(,%rbx,4),%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     1309 <tempered_util__parse_calibration_string+0x1b9>
mov    %rax,%r15
lea    0x0(,%r14,4),%edx
mov    %rax,%rdi
mov    -0x48(%rbp),%rsi
call   1050 <memcpy@plt>
cmp    $0x1,%r14d
jg     12f6 <tempered_util__parse_calibration_string+0x1a6>
movl   $0x3f800000,0x4(%r15)
3f
mov    -0x40(%rbp),%rax
mov    %ebx,(%rax)
jmp    1395 <tempered_util__parse_calibration_string+0x245>
xor    %r15d,%r15d
jmp    139c <tempered_util__parse_calibration_string+0x24c>
mov    -0x40(%rbp),%rax
movl   $0xfffffffb,(%rax)
cmpl   $0x0,-0x34(%rbp)
je     1392 <tempered_util__parse_calibration_string+0x242>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
lea    0xd77(%rip),%rsi
xor    %r15d,%r15d
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1395 <tempered_util__parse_calibration_string+0x245>
mov    -0x40(%rbp),%rcx
movl   $0xfffffffe,(%rcx)
cmpl   $0x0,-0x34(%rbp)
je     1392 <tempered_util__parse_calibration_string+0x242>
mov    0x2c9c(%rip),%rcx
mov    0x2c85(%rip),%rdx
mov    (%rdx),%edi
cmp    (%rcx),%rax
jne    137c <tempered_util__parse_calibration_string+0x22c>
lea    0xcce(%rip),%rsi
jmp    1329 <tempered_util__parse_calibration_string+0x1d9>
mov    -0x40(%rbp),%rax
movl   $0xfffffffd,(%rax)
cmpl   $0x0,-0x34(%rbp)
je     1392 <tempered_util__parse_calibration_string+0x242>
mov    0x2c5e(%rip),%rax
mov    (%rax),%edi
lea    0xcd1(%rip),%rsi
xor    %r15d,%r15d
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1395 <tempered_util__parse_calibration_string+0x245>
xor    %r15d,%r15d
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %r15,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"parse_calibration_string: Invalid parameters.\0A\00"
@errno = global i64 0
@ERANGE = global i64 0
@.str.1 = [37 x i8] c"Calibration: value is out of range.\0A\00"
@.str.2 = [39 x i8] c"Calibration: parsing value failed: %s\0A\00"
@.str.3 = [37 x i8] c"Calibration: values must be finite.\0A\00"
@.str.4 = [41 x i8] c"Calibration: unable to allocate memory.\0A\00"
define float* @tempered_util__parse_calibration_string(i8* %0, i32* %1, i32 %2) {
%4 = alloca float*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca float*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%16 = load i8*, i8** %5
%17 = icmp eq i8* %16, null
br i1 %17, label %21, label %18
18: ; preds = %3
%19 = load i32*, i32** %6
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %33
21: ; preds = %18, %3
%22 = load i32*, i32** %6
%23 = icmp ne i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32*, i32** %6
store i32 -1, i32* %25
br label %26
26: ; preds = %24, %21
%27 = load i32, i32* %7
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %32
32: ; preds = %29, %26
store float* null, float** %4
br label %195
33: ; preds = %18
store i32 1, i32* %8
store i32 0, i32* %9
br label %34
34: ; preds = %54, %33
%35 = load i8*, i8** %5
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %57
42: ; preds = %34
%43 = load i8*, i8** %5
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 58
br i1 %49, label %50, label %53
50: ; preds = %42
%51 = load i32, i32* %8
%52 = add nsw i32 %51, 1
store i32 %52, i32* %8
br label %53
53: ; preds = %50, %42
br label %54
54: ; preds = %53
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 1
store i32 %56, i32* %9
br label %34
57: ; preds = %34
%58 = load i32, i32* %8
%59 = zext i32 %58 to i64
%60 = call i8* @llvm.stacksave()
store i8* %60, i8** %10
%61 = alloca float, i64 %59
store i64 %59, i64* %11
%62 = load i8*, i8** %5
store i8* %62, i8** %12
store i32 0, i32* %9
br label %63
63: ; preds = %146, %57
%64 = load i32, i32* %9
%65 = load i32, i32* %8
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %149
67: ; preds = %63
%68 = load i8*, i8** %12
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 58
br i1 %71, label %77, label %72
72: ; preds = %67
%73 = load i8*, i8** %12
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %72, %67
%78 = load i32, i32* %9
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds float, float* %61, i64 %79
store float 0.000000e+00, float* %80
%81 = load i8*, i8** %12
%82 = getelementptr inbounds i8, i8* %81, i32 1
store i8* %82, i8** %12
br label %146
83: ; preds = %72
store i64 0, i64* @errno
%84 = load i8*, i8** %12
%85 = call float @strtof(i8* %84, i8** %13)
%86 = load i32, i32* %9
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds float, float* %61, i64 %87
store float %85, float* %88
%89 = load i64, i64* @errno
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %108
91: ; preds = %83
%92 = load i32*, i32** %6
store i32 -2, i32* %92
%93 = load i32, i32* %7
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %107
95: ; preds = %91
%96 = load i64, i64* @errno
%97 = load i64, i64* @ERANGE
%98 = icmp eq i64 %96, %97
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = load i32, i32* @stderr
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %106
102: ; preds = %95
%103 = load i32, i32* @stderr
%104 = load i8*, i8** %12
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %104)
br label %106
106: ; preds = %102, %99
br label %107
107: ; preds = %106, %91
store float* null, float** %4
store i32 1, i32* %14
br label %193
108: ; preds = %83
%109 = load i8*, i8** %13
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = icmp ne i32 %111, 58
br i1 %112, label %113, label %127
113: ; preds = %108
%114 = load i8*, i8** %13
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %127
118: ; preds = %113
%119 = load i32*, i32** %6
store i32 -3, i32* %119
%120 = load i32, i32* %7
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %126
122: ; preds = %118
%123 = load i32, i32* @stderr
%124 = load i8*, i8** %12
%125 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %124)
br label %126
126: ; preds = %122, %118
store float* null, float** %4
store i32 1, i32* %14
br label %193
127: ; preds = %113, %108
%128 = load i32, i32* %9
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds float, float* %61, i64 %129
%131 = load float, float* %130
%132 = call i32 @isfinite(float %131)
%133 = icmp ne i32 %132, 0
br i1 %133, label %142, label %134
134: ; preds = %127
%135 = load i32*, i32** %6
store i32 -4, i32* %135
%136 = load i32, i32* %7
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %141
138: ; preds = %134
%139 = load i32, i32* @stderr
%140 = call i32 (i32, i8*, ...) @fprintf(i32 %139, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %141
141: ; preds = %138, %134
store float* null, float** %4
store i32 1, i32* %14
br label %193
142: ; preds = %127
%143 = load i8*, i8** %13
store i8* %143, i8** %12
%144 = load i8*, i8** %12
%145 = getelementptr inbounds i8, i8* %144, i32 1
store i8* %145, i8** %12
br label %146
146: ; preds = %142, %77
%147 = load i32, i32* %9
%148 = add nsw i32 %147, 1
store i32 %148, i32* %9
br label %63
149: ; preds = %63
%150 = load i32, i32* %8
%151 = icmp slt i32 %150, 2
br i1 %151, label %152, label %153
152: ; preds = %149
br label %155
153: ; preds = %149
%154 = load i32, i32* %8
br label %155
155: ; preds = %153, %152
%156 = phi i32 [ 2, %152 ], [ %154, %153 ]
%157 = sext i32 %156 to i64
%158 = mul i64 %157, 4
%159 = trunc i64 %158 to i32
%160 = call float* @malloc(i32 %159)
store float* %160, float** %15
%161 = load float*, float** %15
%162 = icmp eq float* %161, null
br i1 %162, label %163, label %171
163: ; preds = %155
%164 = load i32*, i32** %6
store i32 -5, i32* %164
%165 = load i32, i32* %7
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %170
167: ; preds = %163
%168 = load i32, i32* @stderr
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %168, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %170
170: ; preds = %167, %163
store float* null, float** %4
store i32 1, i32* %14
br label %193
171: ; preds = %155
%172 = load float*, float** %15
%173 = load i32, i32* %8
%174 = sext i32 %173 to i64
%175 = mul i64 %174, 4
%176 = trunc i64 %175 to i32
%177 = call i32 @memcpy(float* %172, float* %61, i32 %176)
%178 = load i32, i32* %8
%179 = icmp slt i32 %178, 2
br i1 %179, label %180, label %183
180: ; preds = %171
%181 = load float*, float** %15
%182 = getelementptr inbounds float, float* %181, i64 1
store float 1.000000e+00, float* %182
br label %183
183: ; preds = %180, %171
%184 = load i32, i32* %8
%185 = icmp slt i32 %184, 2
br i1 %185, label %186, label %187
186: ; preds = %183
br label %189
187: ; preds = %183
%188 = load i32, i32* %8
br label %189
189: ; preds = %187, %186
%190 = phi i32 [ 2, %186 ], [ %188, %187 ]
%191 = load i32*, i32** %6
store i32 %190, i32* %191
%192 = load float*, float** %15
store float* %192, float** %4
store i32 1, i32* %14
br label %193
193: ; preds = %189, %170, %141, %126, %107
%194 = load i8*, i8** %10
br label %195
195: ; preds = %193, %32
%196 = load float*, float** %4
ret float* %196
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"parse_calibration_string: Invalid parameters.\0A\00"
@errno = global i64 0
@ERANGE = global i64 0
@.str.1 = [37 x i8] c"Calibration: value is out of range.\0A\00"
@.str.2 = [39 x i8] c"Calibration: parsing value failed: %s\0A\00"
@.str.3 = [37 x i8] c"Calibration: values must be finite.\0A\00"
@.str.4 = [41 x i8] c"Calibration: unable to allocate memory.\0A\00"
define float* @tempered_util__parse_calibration_string(i8* %0, i32* writeonly %1, i32 %2) {
%4 = alloca i8*
%5 = icmp eq i8* %0, null
%6 = icmp eq i32* %1, null
%7 = or i1 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %3
br i1 %6, label %10, label %9
9: ; preds = %8
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = icmp eq i32 %2, 0
br i1 %11, label %92, label %12
12: ; preds = %10
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %92
15: ; preds = %3, %22
%16 = phi i64 [ %24, %22 ], [ 0, %3 ]
%17 = phi i32 [ %23, %22 ], [ 1, %3 ]
%18 = getelementptr inbounds i8, i8* %0, i64 %16
%19 = load i8, i8* %18
switch i8 %19, label %22 [
i8 0, label %25
i8 58, label %20
]
20: ; preds = %15
%21 = add nsw i32 %17, 1
br label %22
22: ; preds = %15, %20
%23 = phi i32 [ %21, %20 ], [ %17, %15 ]
%24 = add nuw i64 %16, 1
br label %15
25: ; preds = %15
%26 = zext i32 %17 to i64
%27 = tail call i8* @llvm.stacksave()
%28 = alloca float, i64 %26
%29 = bitcast i8** %4 to i8*
%30 = icmp sgt i32 %17, 0
br i1 %30, label %31, label %73
31: ; preds = %25, %68
%32 = phi i64 [ %71, %68 ], [ 0, %25 ]
%33 = phi i8* [ %70, %68 ], [ %0, %25 ]
%34 = load i8, i8* %33
switch i8 %34, label %37 [
i8 58, label %35
i8 0, label %35
]
35: ; preds = %31, %31
%36 = getelementptr inbounds float, float* %28, i64 %32
store float 0.000000e+00, float* %36
br label %68
37: ; preds = %31
store i64 0, i64* @errno
%38 = call float @strtof(i8* %33, i8** %4)
%39 = getelementptr inbounds float, float* %28, i64 %32
store float %38, float* %39
%40 = load i64, i64* @errno
%41 = icmp eq i64 %40, 0
br i1 %41, label %52, label %42
42: ; preds = %37
store i32 -2, i32* %1
%43 = icmp eq i32 %2, 0
br i1 %43, label %90, label %44
44: ; preds = %42
%45 = load i64, i64* @ERANGE
%46 = icmp eq i64 %40, %45
%47 = load i32, i32* @stderr
br i1 %46, label %48, label %50
48: ; preds = %44
%49 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %90
50: ; preds = %44
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %33)
br label %90
52: ; preds = %37
%53 = load i8*, i8** %4
%54 = load i8, i8* %53
switch i8 %54, label %55 [
i8 58, label %60
i8 0, label %60
]
55: ; preds = %52
store i32 -3, i32* %1
%56 = icmp eq i32 %2, 0
br i1 %56, label %90, label %57
57: ; preds = %55
%58 = load i32, i32* @stderr
%59 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %33)
br label %90
60: ; preds = %52, %52
%61 = tail call i32 @isfinite(float %38)
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %60
store i32 -4, i32* %1
%64 = icmp eq i32 %2, 0
br i1 %64, label %90, label %65
65: ; preds = %63
%66 = load i32, i32* @stderr
%67 = tail call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %90
68: ; preds = %60, %35
%69 = phi i8* [ %33, %35 ], [ %53, %60 ]
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = add nuw nsw i64 %32, 1
%72 = icmp eq i64 %71, %26
br i1 %72, label %73, label %31
73: ; preds = %68, %25
%74 = icmp slt i32 %17, 2
%75 = select i1 %74, i32 2, i32 %17
%76 = shl i32 %75, 2
%77 = tail call float* @malloc(i32 %76)
%78 = icmp eq float* %77, null
br i1 %78, label %79, label %84
79: ; preds = %73
store i32 -5, i32* %1
%80 = icmp eq i32 %2, 0
br i1 %80, label %90, label %81
81: ; preds = %79
%82 = load i32, i32* @stderr
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %90
84: ; preds = %73
%85 = shl i32 %17, 2
%86 = call i32 @memcpy(float* %77, float* %28, i32 %85)
br i1 %74, label %87, label %89
87: ; preds = %84
%88 = getelementptr inbounds float, float* %77, i64 1
store float 1.000000e+00, float* %88
br label %89
89: ; preds = %87, %84
store i32 %75, i32* %1
br label %90
90: ; preds = %89, %81, %79, %63, %65, %55, %57, %42, %50, %48
%91 = phi float* [ null, %48 ], [ null, %50 ], [ null, %42 ], [ null, %57 ], [ null, %55 ], [ null, %65 ], [ null, %63 ], [ %77, %89 ], [ null, %81 ], [ null, %79 ]
br label %92
92: ; preds = %10, %12, %90
%93 = phi float* [ %91, %90 ], [ null, %12 ], [ null, %10 ]
ret float* %93
}