#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 FLT_MAX;
double FLT_MIN;
int extract_S(char const *, char const *, char const *, char *, int, int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
double strtod(char *, char **);
int /*<<< orphan*/ zero_string(char *, int);
int extract_F4(const char *X, const char *start_str, const char *stop_str,
               float *ptr_fval, bool *ptr_is_null) {
  int status = 0;
  char bufstr[32];
  double dval;
  char *endptr;
  zero_string(bufstr, 32);
  status = extract_S(X, start_str, stop_str, bufstr, 32, ptr_is_null);
  {
    if ((status) < 0) {
      {
        {
          fprintf(
              stderr, "Line %3d of File %s \n", 60,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/"
              "DEPRECATED_Q2/BAK.4.23.2015.PARSER/extract_S.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
  if (*ptr_is_null) {
    return status;
  }
  dval = strtod(bufstr, &endptr);
  if (*endptr != '\0') {
    *ptr_is_null = true;
    return status;
  }
  if ((dval < FLT_MIN) || (dval > FLT_MAX)) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 64,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/extract_S.c");
      };
      status = -1;
      goto BYE;
    };
  }
  *ptr_fval = dval;
BYE:
  return status;
}


x86 assembly (clang, -O0):
<extract_F4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x20,%esi
call   1030 <zero_string@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x60(%rbp),%rcx
mov    -0x30(%rbp),%r9
mov    $0x20,%r8d
call   1060 <extract_S@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    11c9 <extract_F4+0x89>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
mov    $0x3c,%edx
lea    0xe5d(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1286 <extract_F4+0x146>
mov    -0x30(%rbp),%rax
cmpl   $0x0,(%rax)
je     11e1 <extract_F4+0xa1>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    128c <extract_F4+0x14c>
lea    -0x60(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <strtod@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x70(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1218 <extract_F4+0xd8>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    128c <extract_F4+0x14c>
movsd  -0x68(%rbp),%xmm1
mov    0x2dc4(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
ja     1248 <extract_F4+0x108>
movsd  -0x68(%rbp),%xmm0
mov    0x2da2(%rip),%rax
ucomisd (%rax),%xmm0
jbe    1275 <extract_F4+0x135>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
lea    0xda8(%rip),%rsi
mov    $0x40,%edx
lea    0xdb2(%rip),%rcx
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x34(%rbp)
jmp    1286 <extract_F4+0x146>
movsd  -0x68(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_F4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    $0x20,%esi
call   1030 <zero_string@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    $0x20,%r8d
mov    %r15,%r9
call   1060 <extract_S@plt>
mov    %eax,%ebp
test   %eax,%eax
js     11b7 <extract_F4+0x77>
cmpl   $0x0,(%r15)
jne    11d8 <extract_F4+0x98>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <strtod@plt>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
je     11e9 <extract_F4+0xa9>
movl   $0x1,(%r15)
jmp    11d8 <extract_F4+0x98>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
lea    0xe48(%rip),%rcx
mov    $0x3c,%edx
call   1050 <fprintf@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2df8(%rip),%rax
movsd  (%rax),%xmm1
ucomisd %xmm0,%xmm1
ja     1212 <extract_F4+0xd2>
mov    0x2ddf(%rip),%rax
ucomisd (%rax),%xmm0
ja     1212 <extract_F4+0xd2>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
jmp    11d8 <extract_F4+0x98>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
lea    0xded(%rip),%rcx
mov    $0x40,%edx
call   1050 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    11d8 <extract_F4+0x98>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/extract_S.c\00"
@FLT_MIN = global double 0.000000e+00
@FLT_MAX = global double 0.000000e+00
define i32 @extract_F4(i8* %0, i8* %1, i8* %2, float* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca float*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca [32 x i8]
%14 = alloca double
%15 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store float* %3, float** %10
store i32* %4, i32** %11
store i32 0, i32* %12
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%17 = call i32 @zero_string(i8* %16, i32 32)
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = load i8*, i8** %9
%21 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%22 = load i32*, i32** %11
%23 = call i32 @extract_S(i8* %18, i8* %19, i8* %20, i8* %21, i32 32, i32* %22)
store i32 %23, i32* %12
%24 = load i32, i32* %12
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %5
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* %12
store i32 %29, i32* %12
br label %61
30: ; preds = %5
%31 = load i32*, i32** %11
%32 = load i32, i32* %31
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = load i32, i32* %12
store i32 %35, i32* %6
br label %63
36: ; preds = %30
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%38 = call double @strtod(i8* %37, i8** %15)
store double %38, double* %14
%39 = load i8*, i8** %15
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = load i32*, i32** %11
store i32 1, i32* %44
%45 = load i32, i32* %12
store i32 %45, i32* %6
br label %63
46: ; preds = %36
%47 = load double, double* %14
%48 = load double, double* @FLT_MIN
%49 = fcmp olt double %47, %48
br i1 %49, label %54, label %50
50: ; preds = %46
%51 = load double, double* %14
%52 = load double, double* @FLT_MAX
%53 = fcmp ogt double %51, %52
br i1 %53, label %54, label %57
54: ; preds = %50, %46
%55 = load i32, i32* @stderr
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %12
br label %61
57: ; preds = %50
%58 = load double, double* %14
%59 = fptrunc double %58 to float
%60 = load float*, float** %10
store float %59, float* %60
br label %61
61: ; preds = %57, %54, %26
%62 = load i32, i32* %12
store i32 %62, i32* %6
br label %63
63: ; preds = %61, %43, %34
%64 = load i32, i32* %6
ret i32 %64
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/extract_S.c\00"
@FLT_MIN = global double 0.000000e+00
@FLT_MAX = global double 0.000000e+00
define i32 @extract_F4(i8* %0, i8* %1, i8* %2, float* nocapture writeonly %3, i32* %4) {
%6 = alloca [32 x i8]
%7 = alloca i8*
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%9 = bitcast i8** %7 to i8*
%10 = call i32 @zero_string(i8* %8, i32 32)
%11 = call i32 @extract_S(i8* %0, i8* %1, i8* %2, i8* %8, i32 32, i32* %4)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
br label %36
16: ; preds = %5
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %36
19: ; preds = %16
%20 = call double @strtod(i8* %8, i8** %7)
%21 = load i8*, i8** %7
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19
store i32 1, i32* %4
br label %36
25: ; preds = %19
%26 = load double, double* @FLT_MIN
%27 = fcmp olt double %20, %26
%28 = load double, double* @FLT_MAX
%29 = fcmp ogt double %20, %28
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0))
br label %36
34: ; preds = %25
%35 = fptrunc double %20 to float
store float %35, float* %3
br label %36
36: ; preds = %13, %31, %34, %16, %24
%37 = phi i32 [ %11, %24 ], [ %11, %16 ], [ %11, %13 ], [ -1, %31 ], [ %11, %34 ]
ret i32 %37
}