#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 */
int /*<<< orphan*/ close(int);
double grg_file_pwd_quality(char *);
int mkstemp(char *);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char *, int);
int testB() {
  char name1[] = "/tmp/libgrg-tmp1-XXXXXX";
  int fd1 = mkstemp(name1);
  double p1;
  char name2[] = "/tmp/libgrg-tmp2-XXXXXX";
  int fd2 = mkstemp(name2);
  double p2;
  char name3[] = "/tmp/libgrg-tmp3-XXXXXX";
  int fd3 = mkstemp(name3);
  double p3;
  write(fd1, "        ", 8);
  close(fd1);
  write(fd2, "                ", 16);
  close(fd2);
  write(fd3, "                                ", 32);
  close(fd3);
  p1 = grg_file_pwd_quality(name1);
  unlink(name1);
  p2 = grg_file_pwd_quality(name2);
  unlink(name2);
  p3 = grg_file_pwd_quality(name3);
  unlink(name3);
  if (p1 >= p2 || p2 >= p3 || p1 <= 0 || p1 >= 1 || p2 <= 0 || p2 >= 1 ||
      p3 <= 0 || p3 > 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<testB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xeae(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1070 <mkstemp@plt>
mov    %eax,-0x24(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
call   1070 <mkstemp@plt>
mov    %eax,-0x54(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    -0x80(%rbp),%rdi
call   1070 <mkstemp@plt>
mov    %eax,-0x84(%rbp)
mov    -0x24(%rbp),%edi
lea    0xe91(%rip),%rsi
mov    $0x8,%edx
call   1040 <write@plt>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x54(%rbp),%edi
lea    0xe6d(%rip),%rsi
mov    $0x10,%edx
call   1040 <write@plt>
mov    -0x54(%rbp),%edi
call   1050 <close@plt>
mov    -0x84(%rbp),%edi
lea    0xe3e(%rip),%rsi
mov    $0x20,%edx
call   1040 <write@plt>
mov    -0x84(%rbp),%edi
call   1050 <close@plt>
lea    -0x20(%rbp),%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x50(%rbp),%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x80(%rbp),%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,-0x90(%rbp)
ff
lea    -0x80(%rbp),%rdi
call   1030 <unlink@plt>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jae    131f <testB+0x1cf>
movsd  -0x60(%rbp),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jae    131f <testB+0x1cf>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jae    131f <testB+0x1cf>
movsd  -0x30(%rbp),%xmm0
movsd  0xd3b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    131f <testB+0x1cf>
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jae    131f <testB+0x1cf>
movsd  -0x60(%rbp),%xmm0
movsd  0xd16(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    131f <testB+0x1cf>
xorps  %xmm0,%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jae    131f <testB+0x1cf>
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xceb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    132b <testB+0x1db>
movl   $0x1,-0x4(%rbp)
jmp    1332 <testB+0x1e2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testB>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movaps 0xeab(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x5858585858582d,%r15
mov    %r15,0x70(%rsp)
lea    0x60(%rsp),%r12
mov    %r12,%rdi
call   1070 <mkstemp@plt>
mov    %eax,%ebp
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %r15,0x50(%rsp)
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1070 <mkstemp@plt>
mov    %eax,%ebx
movapd 0xea0(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
mov    %r15,0x30(%rsp)
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1070 <mkstemp@plt>
mov    %eax,%r13d
lea    0xeae(%rip),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   1040 <write@plt>
mov    %ebp,%edi
call   1050 <close@plt>
lea    0xe8c(%rip),%rsi
mov    %ebx,%edi
mov    $0x10,%edx
call   1040 <write@plt>
mov    %ebx,%edi
call   1050 <close@plt>
lea    0xe62(%rip),%rsi
mov    %r13d,%edi
mov    $0x20,%edx
call   1040 <write@plt>
mov    %r13d,%edi
call   1050 <close@plt>
mov    %r12,%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,0x18(%rsp)
mov    %r12,%rdi
call   1030 <unlink@plt>
mov    %r14,%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %r15,%rdi
call   1060 <grg_file_pwd_quality@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
call   1030 <unlink@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
mov    $0x1,%eax
ucomisd %xmm3,%xmm2
jae    12c9 <testB+0x179>
movsd  0x8(%rsp),%xmm4
ucomisd %xmm4,%xmm3
setae  %al
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
setae  %cl
or     %al,%cl
movsd  0xd6a(%rip),%xmm1
ucomisd %xmm1,%xmm2
setae  %al
ucomisd %xmm3,%xmm0
setae  %dl
or     %cl,%dl
or     %al,%dl
ucomisd %xmm1,%xmm3
setae  %al
ucomisd %xmm4,%xmm0
setae  %cl
or     %al,%cl
or     %dl,%cl
ucomisd %xmm1,%xmm4
seta   %al
or     %cl,%al
movzbl %al,%eax
and    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.testB.name1 = [24 x i8] c"/tmp/libgrg-tmp1-XXXXXX\00"
@__const.testB.name2 = [24 x i8] c"/tmp/libgrg-tmp2-XXXXXX\00"
@__const.testB.name3 = [24 x i8] c"/tmp/libgrg-tmp3-XXXXXX\00"
@.str = [9 x i8] c" \00"
@.str.1 = [17 x i8] c" \00"
@.str.2 = [33 x i8] c" \00"
define i32 @testB() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca i32
%4 = alloca double
%5 = alloca [24 x i8]
%6 = alloca i32
%7 = alloca double
%8 = alloca [24 x i8]
%9 = alloca i32
%10 = alloca double
%11 = bitcast [24 x i8]* %2 to i8*
%12 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%13 = call i32 @mkstemp(i8* %12)
store i32 %13, i32* %3
%14 = bitcast [24 x i8]* %5 to i8*
%15 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%16 = call i32 @mkstemp(i8* %15)
store i32 %16, i32* %6
%17 = bitcast [24 x i8]* %8 to i8*
%18 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%19 = call i32 @mkstemp(i8* %18)
store i32 %19, i32* %9
%20 = load i32, i32* %3
%21 = call i32 @write(i32 %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%22 = load i32, i32* %3
%23 = call i32 @close(i32 %22)
%24 = load i32, i32* %6
%25 = call i32 @write(i32 %24, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
%26 = load i32, i32* %6
%27 = call i32 @close(i32 %26)
%28 = load i32, i32* %9
%29 = call i32 @write(i32 %28, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 32)
%30 = load i32, i32* %9
%31 = call i32 @close(i32 %30)
%32 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%33 = call double @grg_file_pwd_quality(i8* %32)
store double %33, double* %4
%34 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%35 = call i32 @unlink(i8* %34)
%36 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%37 = call double @grg_file_pwd_quality(i8* %36)
store double %37, double* %7
%38 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%39 = call i32 @unlink(i8* %38)
%40 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%41 = call double @grg_file_pwd_quality(i8* %40)
store double %41, double* %10
%42 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%43 = call i32 @unlink(i8* %42)
%44 = load double, double* %4
%45 = load double, double* %7
%46 = fcmp oge double %44, %45
br i1 %46, label %69, label %47
47: ; preds = %0
%48 = load double, double* %7
%49 = load double, double* %10
%50 = fcmp oge double %48, %49
br i1 %50, label %69, label %51
51: ; preds = %47
%52 = load double, double* %4
%53 = fcmp ole double %52, 0.000000e+00
br i1 %53, label %69, label %54
54: ; preds = %51
%55 = load double, double* %4
%56 = fcmp oge double %55, 1.000000e+00
br i1 %56, label %69, label %57
57: ; preds = %54
%58 = load double, double* %7
%59 = fcmp ole double %58, 0.000000e+00
br i1 %59, label %69, label %60
60: ; preds = %57
%61 = load double, double* %7
%62 = fcmp oge double %61, 1.000000e+00
br i1 %62, label %69, label %63
63: ; preds = %60
%64 = load double, double* %10
%65 = fcmp ole double %64, 0.000000e+00
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = load double, double* %10
%68 = fcmp ogt double %67, 1.000000e+00
br i1 %68, label %69, label %70
69: ; preds = %66, %63, %60, %57, %54, %51, %47, %0
store i32 1, i32* %1
br label %71
70: ; preds = %66
store i32 0, i32* %1
br label %71
71: ; preds = %70, %69
%72 = load i32, i32* %1
ret i32 %72
}

LLVM IR (-O2):
@__const.testB.name1 = [24 x i8] c"/tmp/libgrg-tmp1-XXXXXX\00"
@__const.testB.name2 = [24 x i8] c"/tmp/libgrg-tmp2-XXXXXX\00"
@__const.testB.name3 = [24 x i8] c"/tmp/libgrg-tmp3-XXXXXX\00"
@.str = [9 x i8] c" \00"
@.str.1 = [17 x i8] c" \00"
@.str.2 = [33 x i8] c" \00"
define i32 @testB() {
%1 = alloca [24 x i8]
%2 = alloca [24 x i8]
%3 = alloca [24 x i8]
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%5 = call i32 @mkstemp(i8* %4)
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%7 = call i32 @mkstemp(i8* %6)
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%9 = call i32 @mkstemp(i8* %8)
%10 = call i32 @write(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%11 = call i32 @close(i32 %5)
%12 = call i32 @write(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
%13 = call i32 @close(i32 %7)
%14 = call i32 @write(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 32)
%15 = call i32 @close(i32 %9)
%16 = call double @grg_file_pwd_quality(i8* %4)
%17 = call i32 @unlink(i8* %4)
%18 = call double @grg_file_pwd_quality(i8* %6)
%19 = call i32 @unlink(i8* %6)
%20 = call double @grg_file_pwd_quality(i8* %8)
%21 = call i32 @unlink(i8* %8)
%22 = fcmp ult double %16, %18
br i1 %22, label %23, label %38
23: ; preds = %0
%24 = fcmp oge double %18, %20
%25 = fcmp ole double %16, 0.000000e+00
%26 = select i1 %24, i1 true, i1 %25
%27 = fcmp oge double %16, 1.000000e+00
%28 = select i1 %26, i1 true, i1 %27
%29 = fcmp ole double %18, 0.000000e+00
%30 = select i1 %28, i1 true, i1 %29
%31 = fcmp oge double %18, 1.000000e+00
%32 = select i1 %30, i1 true, i1 %31
%33 = fcmp ole double %20, 0.000000e+00
%34 = select i1 %32, i1 true, i1 %33
%35 = fcmp ogt double %20, 1.000000e+00
%36 = select i1 %34, i1 true, i1 %35
%37 = zext i1 %36 to i32
br label %38
38: ; preds = %23, %0
%39 = phi i32 [ 1, %0 ], [ %37, %23 ]
ret i32 %39
}