#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__ Util_close_to(double, double);
scalar_t__ Util_equal(double, double);
int Util_in_range_strict(double, double, double);
int /*<<< orphan*/ assert(int);
void check1(double *a, double *b) {
  double x, y;
  x = *a;
  y = *b;
  if (Util_close_to(x, -1.0))
    x = -1.0 + 1.0e-10;
  if (Util_close_to(x, 1.0))
    x = 1.0 - 1.0e-10;
  assert(Util_in_range_strict(-1.0, 1.0, x));
  if (Util_equal(y, 1.0) && y > 1.0) {
    y = 1.0 - 1.0e-20;
  } else if (Util_close_to(y, 1.0) && y > 1.0) {
    y = 1.0 - 1.0e-10;
  }
  assert((1 - y) >= 0);
  *a = x;
  *b = y;
}


x86 assembly (clang, -O0):
<check1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
call   1040 <Util_close_to@plt>
cmp    $0x0,%rax
je     1193 <check1+0x53>
movsd  0xe7a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
call   1040 <Util_close_to@plt>
cmp    $0x0,%rax
je     11bc <check1+0x7c>
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm2
movsd  0xe37(%rip),%xmm0
movsd  0xe3f(%rip),%xmm1
call   1030 <Util_in_range_strict@plt>
mov    %eax,%edi
call   1050 <assert@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xe26(%rip),%xmm1
call   1060 <Util_equal@plt>
cmp    $0x0,%rax
je     1222 <check1+0xe2>
movsd  -0x20(%rbp),%xmm0
movsd  0xe0a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1222 <check1+0xe2>
movsd  0xdf8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1267 <check1+0x127>
movsd  -0x20(%rbp),%xmm0
movsd  0xde1(%rip),%xmm1
call   1040 <Util_close_to@plt>
cmp    $0x0,%rax
je     1262 <check1+0x122>
movsd  -0x20(%rbp),%xmm0
movsd  0xdc5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1262 <check1+0x122>
movsd  0xdbb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1267 <check1+0x127>
movsd  0xda1(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check1>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  (%rsi),%xmm0
movaps %xmm0,0x10(%rsp)
movsd  0xe98(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <Util_close_to@plt>
movsd  0x8(%rsp),%xmm0
test   %rax,%rax
je     1183 <check1+0x43>
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe7f(%rip),%xmm1
call   1040 <Util_close_to@plt>
movsd  0x8(%rsp),%xmm2
test   %rax,%rax
je     11a9 <check1+0x69>
movsd  0xe6f(%rip),%xmm2
movsd  0xe4f(%rip),%xmm0
movsd  0xe57(%rip),%xmm1
movsd  %xmm2,0x8(%rsp)
call   1030 <Util_in_range_strict@plt>
mov    %eax,%edi
call   1050 <assert@plt>
movaps 0x10(%rsp),%xmm0
movsd  0xe38(%rip),%xmm1
call   1060 <Util_equal@plt>
movapd 0x10(%rsp),%xmm0
test   %rax,%rax
movsd  0xe22(%rip),%xmm1
je     11fe <check1+0xbe>
ucomisd 0xe18(%rip),%xmm0
movapd %xmm1,%xmm2
ja     124f <check1+0x10f>
movsd  0xe0a(%rip),%xmm1
call   1040 <Util_close_to@plt>
test   %rax,%rax
jne    1218 <check1+0xd8>
movapd 0x10(%rsp),%xmm0
jmp    1243 <check1+0x103>
movsd  0xdf0(%rip),%xmm1
movapd 0x10(%rsp),%xmm2
cmpltsd %xmm2,%xmm1
movsd  0xde5(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
movapd %xmm0,%xmm2
movsd  0xdc1(%rip),%xmm1
movsd  %xmm2,0x10(%rsp)
subsd  %xmm2,%xmm1
xorpd  %xmm0,%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm1
setae  %dil
call   1050 <assert@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @check1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = load double, double* %7
store double %8, double* %5
%9 = load double*, double** %4
%10 = load double, double* %9
store double %10, double* %6
%11 = load double, double* %5
%12 = call i64 @Util_close_to(double %11, double -1.000000e+00)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store double 0xBFEFFFFFFFF24190, double* %5
br label %15
15: ; preds = %14, %2
%16 = load double, double* %5
%17 = call i64 @Util_close_to(double %16, double 1.000000e+00)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store double 0x3FEFFFFFFFF24190, double* %5
br label %20
20: ; preds = %19, %15
%21 = load double, double* %5
%22 = call i32 @Util_in_range_strict(double -1.000000e+00, double 1.000000e+00, double %21)
%23 = call i32 @assert(i32 %22)
%24 = load double, double* %6
%25 = call i64 @Util_equal(double %24, double 1.000000e+00)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = load double, double* %6
%29 = fcmp ogt double %28, 1.000000e+00
br i1 %29, label %30, label %31
30: ; preds = %27
store double 1.000000e+00, double* %6
br label %40
31: ; preds = %27, %20
%32 = load double, double* %6
%33 = call i64 @Util_close_to(double %32, double 1.000000e+00)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load double, double* %6
%37 = fcmp ogt double %36, 1.000000e+00
br i1 %37, label %38, label %39
38: ; preds = %35
store double 0x3FEFFFFFFFF24190, double* %6
br label %39
39: ; preds = %38, %35, %31
br label %40
40: ; preds = %39, %30
%41 = load double, double* %6
%42 = fsub double 1.000000e+00, %41
%43 = fcmp oge double %42, 0.000000e+00
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = load double, double* %5
%47 = load double*, double** %3
store double %46, double* %47
%48 = load double, double* %6
%49 = load double*, double** %4
store double %48, double* %49
ret void
}

LLVM IR (-O2):
define void @check1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call i64 @Util_close_to(double %3, double -1.000000e+00)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, double %3, double 0xBFEFFFFFFFF24190
%8 = tail call i64 @Util_close_to(double %7, double 1.000000e+00)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, double %7, double 0x3FEFFFFFFFF24190
%11 = tail call i32 @Util_in_range_strict(double -1.000000e+00, double 1.000000e+00, double %10)
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i64 @Util_equal(double %4, double 1.000000e+00)
%14 = icmp ne i64 %13, 0
%15 = fcmp ogt double %4, 1.000000e+00
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %22, label %17
17: ; preds = %2
%18 = tail call i64 @Util_close_to(double %4, double 1.000000e+00)
%19 = icmp ne i64 %18, 0
%20 = select i1 %19, i1 %15, i1 false
%21 = select i1 %20, double 0x3FEFFFFFFFF24190, double %4
br label %22
22: ; preds = %2, %17
%23 = phi double [ %21, %17 ], [ 1.000000e+00, %2 ]
%24 = fsub double 1.000000e+00, %23
%25 = fcmp oge double %24, 0.000000e+00
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
store double %10, double* %0
store double %23, double* %1
ret void
}