#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__ errno;
char *flon_exid_path(char *);
double flu_parse_d(char *);
char *flu_pline(char *, char *);
int /*<<< orphan*/ free(char *);
char *strrchr(char *, char);
double hlp_determine_delta(char *exid) {
  double r = -1.0;
  char *fep = flon_exid_path(exid);
  char *line = flu_pline("grep delta var/archive/%s/exe.log", fep);
  char *delta = strrchr(line, ' ');
  if (delta == NULL)
    goto _over;
  r = flu_parse_d(delta + 1);
  if (errno != 0)
    r = -1.0;
_over:
  free(fep);
  free(line);
  return r;
}


x86 assembly (clang, -O0):
<hlp_determine_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <flon_exid_path@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1070 <flu_pline@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11ac <hlp_determine_delta+0x5c>
jmp    11e1 <hlp_determine_delta+0x91>
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1040 <flu_parse_d@plt>
movsd  %xmm0,-0x10(%rbp)
mov    0x2e1b(%rip),%rax
cmpq   $0x0,(%rax)
je     11dc <hlp_determine_delta+0x8c>
movsd  0xe29(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11e1 <hlp_determine_delta+0x91>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlp_determine_delta>:
push   %r14
push   %rbx
push   %rax
call   1050 <flon_exid_path@plt>
mov    %rax,%r14
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
call   1070 <flu_pline@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x20,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
je     1199 <hlp_determine_delta+0x49>
add    $0x1,%rax
mov    %rax,%rdi
call   1040 <flu_parse_d@plt>
mov    0x2e4d(%rip),%rax
cmpq   $0x0,(%rax)
je     11a1 <hlp_determine_delta+0x51>
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"grep delta var/archive/%s/exe.log\00"
@errno = global i64 0
define double @hlp_determine_delta(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %2
store double -1.000000e+00, double* %3
%7 = load i8*, i8** %2
%8 = call i8* @flon_exid_path(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i8* @flu_pline(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i8* @strrchr(i8* %11, i8 signext 32)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %1
br label %24
16: ; preds = %1
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = call double @flu_parse_d(i8* %18)
store double %19, double* %3
%20 = load i64, i64* @errno
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store double -1.000000e+00, double* %3
br label %23
23: ; preds = %22, %16
br label %24
24: ; preds = %23, %15
%25 = load i8*, i8** %4
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %5
%28 = call i32 @free(i8* %27)
%29 = load double, double* %3
ret double %29
}

LLVM IR (-O2):
@.str = [34 x i8] c"grep delta var/archive/%s/exe.log\00"
@errno = global i64 0
define double @hlp_determine_delta(i8* %0) {
%2 = tail call i8* @flon_exid_path(i8* %0)
%3 = tail call i8* @flu_pline(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %3, i8 signext 32)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call double @flu_parse_d(i8* %7)
%9 = load i64, i64* @errno
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, double %8, double -1.000000e+00
br label %12
12: ; preds = %1, %6
%13 = phi double [ -1.000000e+00, %1 ], [ %11, %6 ]
%14 = tail call i32 @free(i8* %2)
%15 = tail call i32 @free(i8* %3)
ret double %13
}