#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);
int strcmp(char *, char *);
void strcmp_check_modelling() {
  char *x = "aa";
  char *y = "a";
  clang_analyzer_eval(strcmp(x, y) > 0);
  clang_analyzer_eval(strcmp(x, y) <= 0);
  clang_analyzer_eval(strcmp(x, y) > 1);
  clang_analyzer_eval(strcmp(y, x) < 0);
  clang_analyzer_eval(strcmp(y, x) >= 0);
  clang_analyzer_eval(strcmp(y, x) < -1);
}


x86 assembly (clang, -O0):
<strcmp_check_modelling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0xffffffff,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_check_modelling>:
push   %rax
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"aa\00"
@.str.1 = [2 x i8] c"a\00"
define void @strcmp_check_modelling() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %3, i8* %4)
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
%9 = load i8*, i8** %1
%10 = load i8*, i8** %2
%11 = call i32 @strcmp(i8* %9, i8* %10)
%12 = icmp sle i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i8*, i8** %1
%16 = load i8*, i8** %2
%17 = call i32 @strcmp(i8* %15, i8* %16)
%18 = icmp sgt i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @clang_analyzer_eval(i32 %19)
%21 = load i8*, i8** %2
%22 = load i8*, i8** %1
%23 = call i32 @strcmp(i8* %21, i8* %22)
%24 = icmp slt i32 %23, 0
%25 = zext i1 %24 to i32
%26 = call i32 @clang_analyzer_eval(i32 %25)
%27 = load i8*, i8** %2
%28 = load i8*, i8** %1
%29 = call i32 @strcmp(i8* %27, i8* %28)
%30 = icmp sge i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @clang_analyzer_eval(i32 %31)
%33 = load i8*, i8** %2
%34 = load i8*, i8** %1
%35 = call i32 @strcmp(i8* %33, i8* %34)
%36 = icmp slt i32 %35, -1
%37 = zext i1 %36 to i32
%38 = call i32 @clang_analyzer_eval(i32 %37)
ret void
}

LLVM IR (-O2):
define void @strcmp_check_modelling() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
%2 = tail call i32 @clang_analyzer_eval(i32 0)
%3 = tail call i32 @clang_analyzer_eval(i32 0)
%4 = tail call i32 @clang_analyzer_eval(i32 1)
%5 = tail call i32 @clang_analyzer_eval(i32 0)
%6 = tail call i32 @clang_analyzer_eval(i32 0)
ret void
}