#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*/ clang_analyzer_eval(int);
void size_implies_comparison(int *lhs, int *rhs) {
  clang_analyzer_eval(lhs <= rhs);
  if ((rhs - lhs) < 0) {
    clang_analyzer_eval(lhs == rhs);
    return;
  }
  clang_analyzer_eval(lhs <= rhs);
  clang_analyzer_eval((rhs - lhs) >= 0);
  clang_analyzer_eval((rhs - lhs) > 0);
  if ((rhs - lhs) <= 0) {
    clang_analyzer_eval(lhs == rhs);
    return;
  }
  clang_analyzer_eval(lhs == rhs);
  clang_analyzer_eval(lhs < rhs);
  clang_analyzer_eval((rhs - lhs) > 0);
}


x86 assembly (clang, -O0):
<size_implies_comparison>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
jge    1168 <size_implies_comparison+0x58>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    123a <size_implies_comparison+0x12a>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
jg     11f0 <size_implies_comparison+0xe0>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    123a <size_implies_comparison+0x12a>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_implies_comparison>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebp,%ebp
cmp    %rdi,%rsi
setae  %bpl
mov    %ebp,%edi
call   1030 <clang_analyzer_eval@plt>
mov    %r14,%rbx
sub    %r15,%rbx
js     1175 <size_implies_comparison+0x65>
mov    %ebp,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %ebp,%ebp
test   %rbx,%rbx
setne  %bpl
mov    %ebp,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    %r14,%r15
sete   %dil
call   1030 <clang_analyzer_eval@plt>
cmp    $0x4,%rbx
jae    117d <size_implies_comparison+0x6d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
sete   %al
movzbl %al,%ebp
jmp    118b <size_implies_comparison+0x7b>
xor    %edi,%edi
cmp    %r14,%r15
setb   %dil
call   1030 <clang_analyzer_eval@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @size_implies_comparison(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = icmp ule i32* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i32*, i32** %4
%11 = load i32*, i32** %3
%12 = ptrtoint i32* %10 to i64
%13 = ptrtoint i32* %11 to i64
%14 = sub i64 %12, %13
%15 = sdiv exact i64 %14, 4
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i32*, i32** %3
%19 = load i32*, i32** %4
%20 = icmp eq i32* %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @clang_analyzer_eval(i32 %21)
br label %80
23: ; preds = %2
%24 = load i32*, i32** %3
%25 = load i32*, i32** %4
%26 = icmp ule i32* %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @clang_analyzer_eval(i32 %27)
%29 = load i32*, i32** %4
%30 = load i32*, i32** %3
%31 = ptrtoint i32* %29 to i64
%32 = ptrtoint i32* %30 to i64
%33 = sub i64 %31, %32
%34 = sdiv exact i64 %33, 4
%35 = icmp sge i64 %34, 0
%36 = zext i1 %35 to i32
%37 = call i32 @clang_analyzer_eval(i32 %36)
%38 = load i32*, i32** %4
%39 = load i32*, i32** %3
%40 = ptrtoint i32* %38 to i64
%41 = ptrtoint i32* %39 to i64
%42 = sub i64 %40, %41
%43 = sdiv exact i64 %42, 4
%44 = icmp sgt i64 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 @clang_analyzer_eval(i32 %45)
%47 = load i32*, i32** %4
%48 = load i32*, i32** %3
%49 = ptrtoint i32* %47 to i64
%50 = ptrtoint i32* %48 to i64
%51 = sub i64 %49, %50
%52 = sdiv exact i64 %51, 4
%53 = icmp sle i64 %52, 0
br i1 %53, label %54, label %60
54: ; preds = %23
%55 = load i32*, i32** %3
%56 = load i32*, i32** %4
%57 = icmp eq i32* %55, %56
%58 = zext i1 %57 to i32
%59 = call i32 @clang_analyzer_eval(i32 %58)
br label %80
60: ; preds = %23
%61 = load i32*, i32** %3
%62 = load i32*, i32** %4
%63 = icmp eq i32* %61, %62
%64 = zext i1 %63 to i32
%65 = call i32 @clang_analyzer_eval(i32 %64)
%66 = load i32*, i32** %3
%67 = load i32*, i32** %4
%68 = icmp ult i32* %66, %67
%69 = zext i1 %68 to i32
%70 = call i32 @clang_analyzer_eval(i32 %69)
%71 = load i32*, i32** %4
%72 = load i32*, i32** %3
%73 = ptrtoint i32* %71 to i64
%74 = ptrtoint i32* %72 to i64
%75 = sub i64 %73, %74
%76 = sdiv exact i64 %75, 4
%77 = icmp sgt i64 %76, 0
%78 = zext i1 %77 to i32
%79 = call i32 @clang_analyzer_eval(i32 %78)
br label %80
80: ; preds = %60, %54, %17
ret void
}

LLVM IR (-O2):
define void @size_implies_comparison(i32* %0, i32* %1) {
%3 = icmp ule i32* %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = ptrtoint i32* %1 to i64
%7 = ptrtoint i32* %0 to i64
%8 = sub i64 %6, %7
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = icmp eq i32* %0, %1
%12 = zext i1 %11 to i32
br label %27
13: ; preds = %2
%14 = tail call i32 @clang_analyzer_eval(i32 %4)
%15 = tail call i32 @clang_analyzer_eval(i32 1)
%16 = icmp ne i64 %8, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @clang_analyzer_eval(i32 %17)
%19 = icmp ult i64 %8, 4
%20 = icmp eq i32* %0, %1
%21 = zext i1 %20 to i32
%22 = tail call i32 @clang_analyzer_eval(i32 %21)
br i1 %19, label %30, label %23
23: ; preds = %13
%24 = icmp ult i32* %0, %1
%25 = zext i1 %24 to i32
%26 = tail call i32 @clang_analyzer_eval(i32 %25)
br label %27
27: ; preds = %10, %23
%28 = phi i32 [ %17, %23 ], [ %12, %10 ]
%29 = tail call i32 @clang_analyzer_eval(i32 %28)
br label %30
30: ; preds = %27, %13
ret void
}