#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 abs_float(int /*<<< orphan*/);
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ piece(char *, char, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ timlib_strcmp(char *, char *);
void filter_threshold(char delimiter, int piece_offset, double threshold,
                      char *argv_0) {
  char buffer[4096];
  char value_string[4096];
  double absolute_value;
  double difference;
  while (get_line(buffer, stdin)) {
    if (!piece(value_string, delimiter, buffer, piece_offset)) {
      fprintf(stderr, "Warning in %s: cannot piece(%d) in %s\n", argv_0,
              piece_offset, buffer);
      continue;
    }
    if (!*value_string || timlib_strcmp(value_string, "null") == 0) {
      continue;
    }
    absolute_value = abs_float(atof(value_string));
    difference = threshold - absolute_value;
    if (difference < 0.0)
      printf("%s\n", buffer);
  }
}


x86 assembly (clang, -O0):
<filter_threshold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2030,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1020(%rbp),%rdi
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
call   1040 <get_line@plt>
cmp    $0x0,%rax
je     1281 <filter_threshold+0x111>
lea    -0x2020(%rbp),%rdi
mov    -0x1(%rbp),%al
lea    -0x1020(%rbp),%rdx
mov    -0x8(%rbp),%ecx
movsbl %al,%esi
call   1080 <piece@plt>
cmp    $0x0,%eax
jne    11f9 <filter_threshold+0x89>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%ecx
lea    -0x1020(%rbp),%r8
lea    0xe11(%rip),%rsi
call   1060 <fprintf@plt>
jmp    118d <filter_threshold+0x1d>
cmpb   $0x0,-0x2020(%rbp)
je     1223 <filter_threshold+0xb3>
lea    -0x2020(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1090 <timlib_strcmp@plt>
cmp    $0x0,%rax
jne    1228 <filter_threshold+0xb8>
jmp    118d <filter_threshold+0x1d>
lea    -0x2020(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1070 <abs_float@plt>
movsd  %xmm0,-0x2028(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x2028(%rbp),%xmm0
ff
movsd  %xmm0,-0x2030(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x2030(%rbp),%xmm0
ff
jbe    127c <filter_threshold+0x10c>
lea    -0x1020(%rbp),%rsi
lea    0xdac(%rip),%rdi
call   1050 <printf@plt>
jmp    118d <filter_threshold+0x1d>
add    $0x2030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_threshold>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2018,%rsp
mov    %rdx,%r14
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2e53(%rip),%r13
mov    0x0(%r13),%esi
lea    0x1010(%rsp),%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     1261 <filter_threshold+0xf1>
movsbl %bl,%r12d
lea    0x10(%rsp),%r15
lea    0x1010(%rsp),%rbx
jmp    11fe <filter_threshold+0x8e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %rbx,%r8
call   1060 <fprintf@plt>
mov    0x0(%r13),%esi
mov    %rbx,%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     1261 <filter_threshold+0xf1>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1080 <piece@plt>
test   %eax,%eax
je     11d0 <filter_threshold+0x60>
cmpb   $0x0,0x10(%rsp)
je     11ed <filter_threshold+0x7d>
mov    %r15,%rdi
lea    0xe0c(%rip),%rsi
call   1090 <timlib_strcmp@plt>
test   %rax,%rax
je     11ed <filter_threshold+0x7d>
mov    %r15,%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1070 <abs_float@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11ed <filter_threshold+0x7d>
lea    0xdd4(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
jmp    11ed <filter_threshold+0x7d>
add    $0x2018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"Warning in %s: cannot piece(%d) in %s\0A\00"
@.str.1 = [5 x i8] c"null\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @filter_threshold(i8 signext %0, i32 %1, double %2, i8* %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
%9 = alloca [4096 x i8]
%10 = alloca [4096 x i8]
%11 = alloca double
%12 = alloca double
store i8 %0, i8* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
br label %13
13: ; preds = %52, %39, %25, %4
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i64 @get_line(i8* %14, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %53
18: ; preds = %13
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%20 = load i8, i8* %5
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%22 = load i32, i32* %6
%23 = call i32 @piece(i8* %19, i8 signext %20, i8* %21, i32 %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %31, label %25
25: ; preds = %18
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %8
%28 = load i32, i32* %6
%29 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%30 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %27, i32 %28, i8* %29)
br label %13
31: ; preds = %18
%32 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%33 = load i8, i8* %32
%34 = icmp ne i8 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%37 = call i64 @timlib_strcmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %35, %31
br label %13
40: ; preds = %35
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%42 = call i32 @atof(i8* %41)
%43 = call double @abs_float(i32 %42)
store double %43, double* %11
%44 = load double, double* %7
%45 = load double, double* %11
%46 = fsub double %44, %45
store double %46, double* %12
%47 = load double, double* %12
%48 = fcmp olt double %47, 0.000000e+00
br i1 %48, label %49, label %52
49: ; preds = %40
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%51 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %49, %40
br label %13
53: ; preds = %13
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@stderr = global i32 0
@.str = [39 x i8] c"Warning in %s: cannot piece(%d) in %s\0A\00"
@.str.1 = [5 x i8] c"null\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @filter_threshold(i8 signext %0, i32 %1, double %2, i8* %3) {
%5 = alloca [4096 x i8]
%6 = alloca [4096 x i8]
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i64 @get_line(i8* %7, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %35, label %12
12: ; preds = %4, %18
%13 = call i32 @piece(i8* %8, i8 signext %0, i8* %7, i32 %1)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %1, i8* %7)
br label %18
18: ; preds = %28, %33, %22, %25, %15
%19 = load i32, i32* @stdin
%20 = call i64 @get_line(i8* %7, i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %35, label %12
22: ; preds = %12
%23 = load i8, i8* %8
%24 = icmp eq i8 %23, 0
br i1 %24, label %18, label %25
25: ; preds = %22
%26 = call i64 @timlib_strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %18, label %28
28: ; preds = %25
%29 = call i32 @atof(i8* %8)
%30 = call double @abs_float(i32 %29)
%31 = fsub double %2, %30
%32 = fcmp olt double %31, 0.000000e+00
br i1 %32, label %33, label %18
33: ; preds = %28
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %18
35: ; preds = %18, %4
ret void
}