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


x86 assembly (clang, -O0):
<comparisons_imply_size>:
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    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1168 <comparisons_imply_size+0x58>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    123a <comparisons_imply_size+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    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     11f0 <comparisons_imply_size+0xe0>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    123a <comparisons_imply_size+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):
<comparisons_imply_size>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cmp    %rsi,%rdi
setbe  %bl
mov    %ebx,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %ebp,%ebp
cmp    %r15,%r14
ja     117d <comparisons_imply_size+0x6d>
mov    %ebx,%edi
call   1030 <clang_analyzer_eval@plt>
mov    %r15,%rbx
sub    %r14,%rbx
xor    %edi,%edi
cmp    $0xfffffffffffffffd,%rbx
setge  %dil
call   1030 <clang_analyzer_eval@plt>
xor    %ebp,%ebp
test   %rbx,%rbx
setg   %bpl
mov    %ebp,%edi
call   1030 <clang_analyzer_eval@plt>
sub    %r14,%r15
jbe    1177 <comparisons_imply_size+0x67>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    117d <comparisons_imply_size+0x6d>
sete   %al
movzbl %al,%ebp
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 @comparisons_imply_size(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** %3
%11 = load i32*, i32** %4
%12 = icmp ugt i32* %10, %11
br i1 %12, label %13, label %23
13: ; preds = %2
%14 = load i32*, i32** %4
%15 = load i32*, i32** %3
%16 = ptrtoint i32* %14 to i64
%17 = ptrtoint i32* %15 to i64
%18 = sub i64 %16, %17
%19 = sdiv exact i64 %18, 4
%20 = icmp eq i64 %19, 0
%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** %3
%48 = load i32*, i32** %4
%49 = icmp uge i32* %47, %48
br i1 %49, label %50, label %60
50: ; preds = %23
%51 = load i32*, i32** %4
%52 = load i32*, i32** %3
%53 = ptrtoint i32* %51 to i64
%54 = ptrtoint i32* %52 to i64
%55 = sub i64 %53, %54
%56 = sdiv exact i64 %55, 4
%57 = icmp eq i64 %56, 0
%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, %50, %13
ret void
}

LLVM IR (-O2):
define void @comparisons_imply_size(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 = icmp ugt i32* %0, %1
br i1 %6, label %25, label %7
7: ; preds = %2
%8 = tail call i32 @clang_analyzer_eval(i32 %4)
%9 = ptrtoint i32* %1 to i64
%10 = ptrtoint i32* %0 to i64
%11 = sub i64 %9, %10
%12 = icmp sgt i64 %11, -4
%13 = zext i1 %12 to i32
%14 = tail call i32 @clang_analyzer_eval(i32 %13)
%15 = icmp sgt i64 %11, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @clang_analyzer_eval(i32 %16)
%18 = icmp ult i32* %0, %1
br i1 %18, label %22, label %19
19: ; preds = %7
%20 = icmp eq i64 %11, 0
%21 = zext i1 %20 to i32
br label %25
22: ; preds = %7
%23 = tail call i32 @clang_analyzer_eval(i32 0)
%24 = tail call i32 @clang_analyzer_eval(i32 1)
br label %25
25: ; preds = %2, %22, %19
%26 = phi i32 [ %16, %22 ], [ %21, %19 ], [ 0, %2 ]
%27 = tail call i32 @clang_analyzer_eval(i32 %26)
ret void
}