#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, ...);
char *getenv(char *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int sscanf(char *, char *, double *);
double osfreq(void) {
  FILE *f;
  char *x;
  double result;
  int s;
  f = fopen("/etc/cpucyclespersecond", "r");
  if (f) {
    s = fscanf(f, "%lf", &result);
    fclose(f);
    if (s > 0)
      return result;
  }
  f = fopen("/proc/cpuinfo", "r");
  if (f) {
    for (;;) {
      s = fscanf(f, "cpu MHz : %lf", &result);
      if (s > 0)
        break;
      if (s == 0)
        s = fscanf(f, "%*[^\n]\n");
      if (s < 0) {
        result = 0;
        break;
      }
    }
    fclose(f);
    if (result)
      return 1000000.0 * result;
  }
  f = fopen("/proc/cpuinfo", "r");
  if (f) {
    for (;;) {
      s = fscanf(f, "clock : %lf", &result);
      if (s > 0)
        break;
      if (s == 0)
        s = fscanf(f, "%*[^\n]\n");
      if (s < 0) {
        result = 0;
        break;
      }
    }
    fclose(f);
    if (result)
      return 1000000.0 * result;
  }
  f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed", "r");
  if (f) {
    s = fscanf(f, "%lf", &result);
    fclose(f);
    if (s > 0)
      return 1000.0 * result;
  }
  f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
  if (f) {
    s = fscanf(f, "%lf", &result);
    fclose(f);
    if (s > 0)
      return 1000.0 * result;
  }
  f = fopen("/sys/devices/system/cpu/cpu0/clock_tick", "r");
  if (f) {
    s = fscanf(f, "%lf", &result);
    fclose(f);
    if (s > 0)
      return result;
  }
  f = popen("sysctl hw.cpufrequency 2>/dev/null", "r");
  if (f) {
    s = fscanf(f, "hw.cpufrequency: %lf", &result);
    pclose(f);
    if (s > 0)
      if (result > 0)
        return result;
  }
  f = popen("/usr/sbin/lsattr -E -l proc0 -a frequency 2>/dev/null", "r");
  if (f) {
    s = fscanf(f, "frequency %lf", &result);
    pclose(f);
    if (s > 0)
      return result;
  }
  f = popen("/usr/sbin/psrinfo -v 2>/dev/null", "r");
  if (f) {
    for (;;) {
      s = fscanf(f, " The %*s processor operates at %lf MHz", &result);
      if (s > 0)
        break;
      if (s == 0)
        s = fscanf(f, "%*[^\n]\n");
      if (s < 0) {
        result = 0;
        break;
      }
    }
    pclose(f);
    if (result)
      return 1000000.0 * result;
  }
  x = getenv("cpucyclespersecond");
  if (x) {
    s = sscanf(x, "%lf", &result);
    if (s > 0)
      return result;
  }
  return 0;
}


x86 assembly (clang, -O0):
<osfreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xe91(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11da <osfreq+0x6a>
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    11d5 <osfreq+0x65>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    11da <osfreq+0x6a>
lea    0xe49(%rip),%rdi
lea    0xe40(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     12a6 <osfreq+0x136>
jmp    1201 <osfreq+0x91>
mov    -0x10(%rbp),%rdi
lea    0xe2c(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1229 <osfreq+0xb9>
jmp    1264 <osfreq+0xf4>
cmpl   $0x0,-0x24(%rbp)
jne    1248 <osfreq+0xd8>
mov    -0x10(%rbp),%rdi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    125f <osfreq+0xef>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1264 <osfreq+0xf4>
jmp    1201 <osfreq+0x91>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    128a <osfreq+0x11a>
jp     128a <osfreq+0x11a>
jmp    12a1 <osfreq+0x131>
movsd  0xd6e(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    12a6 <osfreq+0x136>
lea    0xd7d(%rip),%rdi
lea    0xd74(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1372 <osfreq+0x202>
jmp    12cd <osfreq+0x15d>
mov    -0x10(%rbp),%rdi
lea    0xd76(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    12f5 <osfreq+0x185>
jmp    1330 <osfreq+0x1c0>
cmpl   $0x0,-0x24(%rbp)
jne    1314 <osfreq+0x1a4>
mov    -0x10(%rbp),%rdi
lea    0xd3c(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    132b <osfreq+0x1bb>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1330 <osfreq+0x1c0>
jmp    12cd <osfreq+0x15d>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1356 <osfreq+0x1e6>
jp     1356 <osfreq+0x1e6>
jmp    136d <osfreq+0x1fd>
movsd  0xca2(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    1372 <osfreq+0x202>
lea    0xce1(%rip),%rdi
lea    0xca8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     13dc <osfreq+0x26c>
mov    -0x10(%rbp),%rdi
lea    0xcb7(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    13d7 <osfreq+0x267>
movsd  0xc40(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    13dc <osfreq+0x26c>
lea    0xcad(%rip),%rdi
lea    0xc3e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1446 <osfreq+0x2d6>
mov    -0x10(%rbp),%rdi
lea    0xc4d(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    1441 <osfreq+0x2d1>
movsd  0xbd6(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    1446 <osfreq+0x2d6>
lea    0xc79(%rip),%rdi
lea    0xbd4(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     14a8 <osfreq+0x338>
mov    -0x10(%rbp),%rdi
lea    0xbe3(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    14a3 <osfreq+0x333>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    14a8 <osfreq+0x338>
lea    0xc3f(%rip),%rdi
lea    0xb72(%rip),%rsi
call   1080 <popen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1521 <osfreq+0x3b1>
mov    -0x10(%rbp),%rdi
lea    0xc3c(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    151c <osfreq+0x3ac>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1517 <osfreq+0x3a7>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    151c <osfreq+0x3ac>
jmp    1521 <osfreq+0x3b1>
lea    0xbfe(%rip),%rdi
lea    0xaf9(%rip),%rsi
call   1080 <popen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1583 <osfreq+0x413>
mov    -0x10(%rbp),%rdi
lea    0xc0e(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pclose@plt>
cmpl   $0x0,-0x24(%rbp)
jle    157e <osfreq+0x40e>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    1583 <osfreq+0x413>
lea    0xbe0(%rip),%rdi
lea    0xa97(%rip),%rsi
call   1080 <popen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     164f <osfreq+0x4df>
jmp    15aa <osfreq+0x43a>
mov    -0x10(%rbp),%rdi
lea    0xbd6(%rip),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    15d2 <osfreq+0x462>
jmp    160d <osfreq+0x49d>
cmpl   $0x0,-0x24(%rbp)
jne    15f1 <osfreq+0x481>
mov    -0x10(%rbp),%rdi
lea    0xa5f(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1608 <osfreq+0x498>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    160d <osfreq+0x49d>
jmp    15aa <osfreq+0x43a>
mov    -0x10(%rbp),%rdi
call   1050 <pclose@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1633 <osfreq+0x4c3>
jp     1633 <osfreq+0x4c3>
jmp    164a <osfreq+0x4da>
movsd  0x9c5(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    164f <osfreq+0x4df>
lea    0x9bf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     169f <osfreq+0x52f>
mov    -0x18(%rbp),%rdi
lea    0x9e1(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <sscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    169a <osfreq+0x52a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    16a7 <osfreq+0x537>
jmp    169f <osfreq+0x52f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osfreq>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe8d(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     11c6 <osfreq+0x56>
mov    %rax,%rbx
lea    0xeb8(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %ebp,%ebp
jle    11c6 <osfreq+0x56>
movsd  0x8(%rsp),%xmm0
jmp    1363 <osfreq+0x1f3>
lea    0xe5d(%rip),%rdi
lea    0xe54(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1252 <osfreq+0xe2>
mov    %rax,%rbx
lea    0xe50(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe52(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jg     1230 <osfreq+0xc0>
jne    1227 <osfreq+0xb7>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jns    1200 <osfreq+0x90>
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12ca <osfreq+0x15a>
jp     12ca <osfreq+0x15a>
lea    0xdd1(%rip),%rdi
lea    0xdc8(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     12d7 <osfreq+0x167>
mov    %rax,%rbx
lea    0xdda(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xdc6(%rip),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jg     12b0 <osfreq+0x140>
jne    12a7 <osfreq+0x137>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jns    1280 <osfreq+0x110>
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <fclose@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12ca <osfreq+0x15a>
jnp    12d7 <osfreq+0x167>
mulsd  0xd2e(%rip),%xmm0
jmp    1363 <osfreq+0x1f3>
lea    0xd7c(%rip),%rdi
lea    0xd43(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1316 <osfreq+0x1a6>
mov    %rax,%rbx
lea    0xd5d(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %ebp,%ebp
jg     1355 <osfreq+0x1e5>
lea    0xd73(%rip),%rdi
lea    0xd04(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1370 <osfreq+0x200>
mov    %rax,%rbx
lea    0xd1e(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %ebp,%ebp
jle    1370 <osfreq+0x200>
movsd  0x8(%rsp),%xmm0
mulsd  0xca5(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd4f(%rip),%rdi
lea    0xcaa(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     13b3 <osfreq+0x243>
mov    %rax,%rbx
lea    0xcc4(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %ebp,%ebp
jg     11bb <osfreq+0x4b>
lea    0xd34(%rip),%rdi
lea    0xc67(%rip),%rsi
call   1080 <popen@plt>
test   %rax,%rax
je     1406 <osfreq+0x296>
mov    %rax,%rbx
lea    0xd3c(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <pclose@plt>
test   %ebp,%ebp
jle    1406 <osfreq+0x296>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1363 <osfreq+0x1f3>
lea    0xd19(%rip),%rdi
lea    0xc14(%rip),%rsi
call   1080 <popen@plt>
test   %rax,%rax
je     1449 <osfreq+0x2d9>
mov    %rax,%rbx
lea    0xd34(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <pclose@plt>
test   %ebp,%ebp
jg     11bb <osfreq+0x4b>
lea    0xd1a(%rip),%rdi
lea    0xbd1(%rip),%rsi
call   1080 <popen@plt>
test   %rax,%rax
je     14c9 <osfreq+0x359>
mov    %rax,%rbx
lea    0xd20(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xbcf(%rip),%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jg     14a7 <osfreq+0x337>
jne    149e <osfreq+0x32e>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %eax,%eax
jns    1477 <osfreq+0x307>
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1050 <pclose@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12ca <osfreq+0x15a>
jp     12ca <osfreq+0x15a>
lea    0xb45(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     14f6 <osfreq+0x386>
lea    0xb75(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1070 <sscanf@plt>
test   %eax,%eax
jg     11bb <osfreq+0x4b>
xorpd  %xmm0,%xmm0
jmp    1363 <osfreq+0x1f3>

LLVM IR (-O0):
@.str = [24 x i8] c"/etc/cpucyclespersecond\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [14 x i8] c"/proc/cpuinfo\00"
@.str.4 = [14 x i8] c"cpu MHz : %lf\00"
@.str.5 = [8 x i8] c"%*[^\0A]\0A\00"
@.str.6 = [12 x i8] c"clock : %lf\00"
@.str.7 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed\00"
@.str.8 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.9 = [40 x i8] c"/sys/devices/system/cpu/cpu0/clock_tick\00"
@.str.10 = [35 x i8] c"sysctl hw.cpufrequency 2>/dev/null\00"
@.str.11 = [21 x i8] c"hw.cpufrequency: %lf\00"
@.str.12 = [54 x i8] c"/usr/sbin/lsattr -E -l proc0 -a frequency 2>/dev/null\00"
@.str.13 = [14 x i8] c"frequency %lf\00"
@.str.14 = [33 x i8] c"/usr/sbin/psrinfo -v 2>/dev/null\00"
@.str.15 = [39 x i8] c" The %*s processor operates at %lf MHz\00"
@.str.16 = [19 x i8] c"cpucyclespersecond\00"
define double @osfreq() {
%1 = alloca double
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca double
%5 = alloca i32
%6 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %19
9: ; preds = %0
%10 = load i32*, i32** %2
%11 = call i32 (i32*, i8*, ...) @fscanf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
store i32 %11, i32* %5
%12 = load i32*, i32** %2
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %5
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = load double, double* %4
store double %17, double* %1
br label %201
18: ; preds = %9
br label %19
19: ; preds = %18, %0
%20 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %2
%21 = load i32*, i32** %2
%22 = icmp ne i32* %21, null
br i1 %22, label %23, label %50
23: ; preds = %19
br label %24
24: ; preds = %40, %23
%25 = load i32*, i32** %2
%26 = call i32 (i32*, i8*, ...) @fscanf(i32* %25, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double* %4)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
br label %41
30: ; preds = %24
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32*, i32** %2
%35 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 %35, i32* %5
br label %36
36: ; preds = %33, %30
%37 = load i32, i32* %5
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %36
store double 0.000000e+00, double* %4
br label %41
40: ; preds = %36
br label %24
41: ; preds = %39, %29
%42 = load i32*, i32** %2
%43 = call i32 @fclose(i32* %42)
%44 = load double, double* %4
%45 = fcmp une double %44, 0.000000e+00
br i1 %45, label %46, label %49
46: ; preds = %41
%47 = load double, double* %4
%48 = fmul double 1.000000e+06, %47
store double %48, double* %1
br label %201
49: ; preds = %41
br label %50
50: ; preds = %49, %19
%51 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %51, i32** %2
%52 = load i32*, i32** %2
%53 = icmp ne i32* %52, null
br i1 %53, label %54, label %81
54: ; preds = %50
br label %55
55: ; preds = %71, %54
%56 = load i32*, i32** %2
%57 = call i32 (i32*, i8*, ...) @fscanf(i32* %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double* %4)
store i32 %57, i32* %5
%58 = load i32, i32* %5
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %55
br label %72
61: ; preds = %55
%62 = load i32, i32* %5
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32*, i32** %2
%66 = call i32 (i32*, i8*, ...) @fscanf(i32* %65, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 %66, i32* %5
br label %67
67: ; preds = %64, %61
%68 = load i32, i32* %5
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %67
store double 0.000000e+00, double* %4
br label %72
71: ; preds = %67
br label %55
72: ; preds = %70, %60
%73 = load i32*, i32** %2
%74 = call i32 @fclose(i32* %73)
%75 = load double, double* %4
%76 = fcmp une double %75, 0.000000e+00
br i1 %76, label %77, label %80
77: ; preds = %72
%78 = load double, double* %4
%79 = fmul double 1.000000e+06, %78
store double %79, double* %1
br label %201
80: ; preds = %72
br label %81
81: ; preds = %80, %50
%82 = call i32* @fopen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %82, i32** %2
%83 = load i32*, i32** %2
%84 = icmp ne i32* %83, null
br i1 %84, label %85, label %96
85: ; preds = %81
%86 = load i32*, i32** %2
%87 = call i32 (i32*, i8*, ...) @fscanf(i32* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
store i32 %87, i32* %5
%88 = load i32*, i32** %2
%89 = call i32 @fclose(i32* %88)
%90 = load i32, i32* %5
%91 = icmp sgt i32 %90, 0
br i1 %91, label %92, label %95
92: ; preds = %85
%93 = load double, double* %4
%94 = fmul double 1.000000e+03, %93
store double %94, double* %1
br label %201
95: ; preds = %85
br label %96
96: ; preds = %95, %81
%97 = call i32* @fopen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %97, i32** %2
%98 = load i32*, i32** %2
%99 = icmp ne i32* %98, null
br i1 %99, label %100, label %111
100: ; preds = %96
%101 = load i32*, i32** %2
%102 = call i32 (i32*, i8*, ...) @fscanf(i32* %101, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
store i32 %102, i32* %5
%103 = load i32*, i32** %2
%104 = call i32 @fclose(i32* %103)
%105 = load i32, i32* %5
%106 = icmp sgt i32 %105, 0
br i1 %106, label %107, label %110
107: ; preds = %100
%108 = load double, double* %4
%109 = fmul double 1.000000e+03, %108
store double %109, double* %1
br label %201
110: ; preds = %100
br label %111
111: ; preds = %110, %96
%112 = call i32* @fopen(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %112, i32** %2
%113 = load i32*, i32** %2
%114 = icmp ne i32* %113, null
br i1 %114, label %115, label %125
115: ; preds = %111
%116 = load i32*, i32** %2
%117 = call i32 (i32*, i8*, ...) @fscanf(i32* %116, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
store i32 %117, i32* %5
%118 = load i32*, i32** %2
%119 = call i32 @fclose(i32* %118)
%120 = load i32, i32* %5
%121 = icmp sgt i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %115
%123 = load double, double* %4
store double %123, double* %1
br label %201
124: ; preds = %115
br label %125
125: ; preds = %124, %111
%126 = call i32* @popen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %126, i32** %2
%127 = load i32*, i32** %2
%128 = icmp ne i32* %127, null
br i1 %128, label %129, label %143
129: ; preds = %125
%130 = load i32*, i32** %2
%131 = call i32 (i32*, i8*, ...) @fscanf(i32* %130, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), double* %4)
store i32 %131, i32* %5
%132 = load i32*, i32** %2
%133 = call i32 @pclose(i32* %132)
%134 = load i32, i32* %5
%135 = icmp sgt i32 %134, 0
br i1 %135, label %136, label %142
136: ; preds = %129
%137 = load double, double* %4
%138 = fcmp ogt double %137, 0.000000e+00
br i1 %138, label %139, label %141
139: ; preds = %136
%140 = load double, double* %4
store double %140, double* %1
br label %201
141: ; preds = %136
br label %142
142: ; preds = %141, %129
br label %143
143: ; preds = %142, %125
%144 = call i32* @popen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %144, i32** %2
%145 = load i32*, i32** %2
%146 = icmp ne i32* %145, null
br i1 %146, label %147, label %157
147: ; preds = %143
%148 = load i32*, i32** %2
%149 = call i32 (i32*, i8*, ...) @fscanf(i32* %148, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), double* %4)
store i32 %149, i32* %5
%150 = load i32*, i32** %2
%151 = call i32 @pclose(i32* %150)
%152 = load i32, i32* %5
%153 = icmp sgt i32 %152, 0
br i1 %153, label %154, label %156
154: ; preds = %147
%155 = load double, double* %4
store double %155, double* %1
br label %201
156: ; preds = %147
br label %157
157: ; preds = %156, %143
%158 = call i32* @popen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %158, i32** %2
%159 = load i32*, i32** %2
%160 = icmp ne i32* %159, null
br i1 %160, label %161, label %188
161: ; preds = %157
br label %162
162: ; preds = %178, %161
%163 = load i32*, i32** %2
%164 = call i32 (i32*, i8*, ...) @fscanf(i32* %163, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.15, i64 0, i64 0), double* %4)
store i32 %164, i32* %5
%165 = load i32, i32* %5
%166 = icmp sgt i32 %165, 0
br i1 %166, label %167, label %168
167: ; preds = %162
br label %179
168: ; preds = %162
%169 = load i32, i32* %5
%170 = icmp eq i32 %169, 0
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load i32*, i32** %2
%173 = call i32 (i32*, i8*, ...) @fscanf(i32* %172, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 %173, i32* %5
br label %174
174: ; preds = %171, %168
%175 = load i32, i32* %5
%176 = icmp slt i32 %175, 0
br i1 %176, label %177, label %178
177: ; preds = %174
store double 0.000000e+00, double* %4
br label %179
178: ; preds = %174
br label %162
179: ; preds = %177, %167
%180 = load i32*, i32** %2
%181 = call i32 @pclose(i32* %180)
%182 = load double, double* %4
%183 = fcmp une double %182, 0.000000e+00
br i1 %183, label %184, label %187
184: ; preds = %179
%185 = load double, double* %4
%186 = fmul double 1.000000e+06, %185
store double %186, double* %1
br label %201
187: ; preds = %179
br label %188
188: ; preds = %187, %157
%189 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
store i8* %189, i8** %3
%190 = load i8*, i8** %3
%191 = icmp ne i8* %190, null
br i1 %191, label %192, label %200
192: ; preds = %188
%193 = load i8*, i8** %3
%194 = call i32 @sscanf(i8* %193, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %4)
store i32 %194, i32* %5
%195 = load i32, i32* %5
%196 = icmp sgt i32 %195, 0
br i1 %196, label %197, label %199
197: ; preds = %192
%198 = load double, double* %4
store double %198, double* %1
br label %201
199: ; preds = %192
br label %200
200: ; preds = %199, %188
store double 0.000000e+00, double* %1
br label %201
201: ; preds = %200, %197, %184, %154, %139, %122, %107, %92, %77, %46, %16
%202 = load double, double* %1
ret double %202
}

LLVM IR (-O2):
@.str = [24 x i8] c"/etc/cpucyclespersecond\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [14 x i8] c"/proc/cpuinfo\00"
@.str.4 = [14 x i8] c"cpu MHz : %lf\00"
@.str.5 = [8 x i8] c"%*[^\0A]\0A\00"
@.str.6 = [12 x i8] c"clock : %lf\00"
@.str.7 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed\00"
@.str.8 = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.9 = [40 x i8] c"/sys/devices/system/cpu/cpu0/clock_tick\00"
@.str.10 = [35 x i8] c"sysctl hw.cpufrequency 2>/dev/null\00"
@.str.11 = [21 x i8] c"hw.cpufrequency: %lf\00"
@.str.12 = [54 x i8] c"/usr/sbin/lsattr -E -l proc0 -a frequency 2>/dev/null\00"
@.str.13 = [14 x i8] c"frequency %lf\00"
@.str.14 = [33 x i8] c"/usr/sbin/psrinfo -v 2>/dev/null\00"
@.str.15 = [39 x i8] c" The %*s processor operates at %lf MHz\00"
@.str.16 = [19 x i8] c"cpucyclespersecond\00"
define double @osfreq() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = call i32 (i32*, i8*, ...) @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%7 = call i32 @fclose(i32* %3)
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = load double, double* %1
br label %121
11: ; preds = %5, %0
%12 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %29, label %14
14: ; preds = %11, %19
%15 = call i32 (i32*, i8*, ...) @fscanf(i32* %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double* %1)
%16 = icmp sgt i32 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = icmp eq i32 %15, 0
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = call i32 (i32*, i8*, ...) @fscanf(i32* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp slt i32 %20, 0
br i1 %21, label %22, label %14
22: ; preds = %17, %19
store double 0.000000e+00, double* %1
br label %23
23: ; preds = %14, %22
%24 = call i32 @fclose(i32* %12)
%25 = load double, double* %1
%26 = fcmp une double %25, 0.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = fmul double %25, 1.000000e+06
br label %121
29: ; preds = %23, %11
%30 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %47, label %32
32: ; preds = %29, %37
%33 = call i32 (i32*, i8*, ...) @fscanf(i32* %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), double* %1)
%34 = icmp sgt i32 %33, 0
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = icmp eq i32 %33, 0
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = call i32 (i32*, i8*, ...) @fscanf(i32* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp slt i32 %38, 0
br i1 %39, label %40, label %32
40: ; preds = %35, %37
store double 0.000000e+00, double* %1
br label %41
41: ; preds = %32, %40
%42 = call i32 @fclose(i32* %30)
%43 = load double, double* %1
%44 = fcmp une double %43, 0.000000e+00
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = fmul double %43, 1.000000e+06
br label %121
47: ; preds = %41, %29
%48 = call i32* @fopen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i32* %48, null
br i1 %49, label %57, label %50
50: ; preds = %47
%51 = call i32 (i32*, i8*, ...) @fscanf(i32* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%52 = call i32 @fclose(i32* %48)
%53 = icmp sgt i32 %51, 0
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = load double, double* %1
%56 = fmul double %55, 1.000000e+03
br label %121
57: ; preds = %50, %47
%58 = call i32* @fopen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%59 = icmp eq i32* %58, null
br i1 %59, label %67, label %60
60: ; preds = %57
%61 = call i32 (i32*, i8*, ...) @fscanf(i32* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%62 = call i32 @fclose(i32* %58)
%63 = icmp sgt i32 %61, 0
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load double, double* %1
%66 = fmul double %65, 1.000000e+03
br label %121
67: ; preds = %60, %57
%68 = call i32* @fopen(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%69 = icmp eq i32* %68, null
br i1 %69, label %76, label %70
70: ; preds = %67
%71 = call i32 (i32*, i8*, ...) @fscanf(i32* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%72 = call i32 @fclose(i32* %68)
%73 = icmp sgt i32 %71, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = load double, double* %1
br label %121
76: ; preds = %70, %67
%77 = call i32* @popen(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%78 = icmp eq i32* %77, null
br i1 %78, label %86, label %79
79: ; preds = %76
%80 = call i32 (i32*, i8*, ...) @fscanf(i32* %77, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), double* %1)
%81 = call i32 @pclose(i32* %77)
%82 = icmp sgt i32 %80, 0
%83 = load double, double* %1
%84 = fcmp ogt double %83, 0.000000e+00
%85 = select i1 %82, i1 %84, i1 false
br i1 %85, label %121, label %86
86: ; preds = %79, %76
%87 = call i32* @popen(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%88 = icmp eq i32* %87, null
br i1 %88, label %95, label %89
89: ; preds = %86
%90 = call i32 (i32*, i8*, ...) @fscanf(i32* %87, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), double* %1)
%91 = call i32 @pclose(i32* %87)
%92 = icmp sgt i32 %90, 0
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = load double, double* %1
br label %121
95: ; preds = %89, %86
%96 = call i32* @popen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%97 = icmp eq i32* %96, null
br i1 %97, label %113, label %98
98: ; preds = %95, %103
%99 = call i32 (i32*, i8*, ...) @fscanf(i32* %96, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.15, i64 0, i64 0), double* %1)
%100 = icmp sgt i32 %99, 0
br i1 %100, label %107, label %101
101: ; preds = %98
%102 = icmp eq i32 %99, 0
br i1 %102, label %103, label %106
103: ; preds = %101
%104 = call i32 (i32*, i8*, ...) @fscanf(i32* %96, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%105 = icmp slt i32 %104, 0
br i1 %105, label %106, label %98
106: ; preds = %101, %103
store double 0.000000e+00, double* %1
br label %107
107: ; preds = %98, %106
%108 = call i32 @pclose(i32* %96)
%109 = load double, double* %1
%110 = fcmp une double %109, 0.000000e+00
br i1 %110, label %111, label %113
111: ; preds = %107
%112 = fmul double %109, 1.000000e+06
br label %121
113: ; preds = %107, %95
%114 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
%115 = icmp eq i8* %114, null
br i1 %115, label %121, label %116
116: ; preds = %113
%117 = call i32 @sscanf(i8* %114, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %1)
%118 = icmp sgt i32 %117, 0
%119 = load double, double* %1
%120 = select i1 %118, double %119, double 0.000000e+00
br label %121
121: ; preds = %116, %113, %79, %111, %93, %74, %64, %54, %45, %27, %9
%122 = phi double [ %10, %9 ], [ %28, %27 ], [ %46, %45 ], [ %56, %54 ], [ %66, %64 ], [ %75, %74 ], [ %94, %93 ], [ %112, %111 ], [ %83, %79 ], [ 0.000000e+00, %113 ], [ %120, %116 ]
ret double %122
}