void assert_in_range(int x) {
  ((x <= ((int)((~0U) & ((~0U) >> 1)) / 4))
       ? (void)(0)
       : __assert_fail(
             "x <= ((int)INT_MAX / 4)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/apple/swift-clang/refs/heads/master/"
             "3rd/templight/llvm/tools/clang/test/Analysis/"
             "constraint_manager_negate_difference.c",
             18, __func__));
  ((x >= -(((int)((~0U) & ((~0U) >> 1))) / 4))
       ? (void)(0)
       : __assert_fail(
             "x >= -(((int)INT_MAX) / 4)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/apple/swift-clang/refs/heads/master/"
             "3rd/templight/llvm/tools/clang/test/Analysis/"
             "constraint_manager_negate_difference.c",
             19, __func__));
}


x86 assembly (clang, -O0):
<assert_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1fffffff,-0x4(%rbp)
jg     112d <assert_in_range+0x1d>
jmp    114e <assert_in_range+0x3e>
lea    0xecc(%rip),%rdi
lea    0xedd(%rip),%rsi
mov    $0x12,%edx
lea    0xfa3(%rip),%rcx
mov    $0x0,%al
call   1030 <__assert_fail@plt>
cmpl   $0xe0000001,-0x4(%rbp)
jl     1160 <assert_in_range+0x50>
jmp    1181 <assert_in_range+0x71>
lea    0xf93(%rip),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x13,%edx
lea    0xf70(%rip),%rcx
mov    $0x0,%al
call   1030 <__assert_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_in_range>:
cmp    $0x20000000,%edi
jge    1121 <assert_in_range+0x11>
cmp    $0xe0000000,%edi
jle    1142 <assert_in_range+0x32>
ret
lea    0xed8(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xfb4(%rip),%rcx
mov    $0x12,%edx
xor    %eax,%eax
jmp    1030 <__assert_fail@plt>
lea    0xfb1(%rip),%rdi
lea    0xec8(%rip),%rsi
lea    0xf93(%rip),%rcx
mov    $0x13,%edx
xor    %eax,%eax
jmp    1030 <__assert_fail@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"x <= ((int)INT_MAX / 4)\00"
@.str.1 = [210 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apple/swift-clang/refs/heads/master/3rd/templight/llvm/tools/clang/test/Analysis/constraint_manager_negate_difference.c\00"
@__func__.assert_in_range = [16 x i8] c"assert_in_range\00"
@.str.2 = [27 x i8] c"x >= -(((int)INT_MAX) / 4)\00"
define void @assert_in_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 536870911
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.1, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.assert_in_range, i64 0, i64 0))
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, -536870911
br i1 %10, label %11, label %12
11: ; preds = %8
br label %14
12: ; preds = %8
%13 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.1, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.assert_in_range, i64 0, i64 0))
br label %14
14: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"x <= ((int)INT_MAX / 4)\00"
@.str.1 = [210 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/apple/swift-clang/refs/heads/master/3rd/templight/llvm/tools/clang/test/Analysis/constraint_manager_negate_difference.c\00"
@__func__.assert_in_range = [16 x i8] c"assert_in_range\00"
@.str.2 = [27 x i8] c"x >= -(((int)INT_MAX) / 4)\00"
define void @assert_in_range(i32 %0) {
%2 = icmp slt i32 %0, 536870912
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.1, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.assert_in_range, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = icmp sgt i32 %0, -536870912
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_fail to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.1, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.assert_in_range, i64 0, i64 0))
br label %9
9: ; preds = %3, %5, %7
ret void
}