int main(int argc, const char **argv) {
  signed long res;
  if (__builtin_sub_overflow((signed long)0x0, (signed long)0x0, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x0, (signed long)0x7FFFFFFFFFFFFFFF,
                             &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed long)0x0, (signed long)0x8000000000000000,
                              &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x0, (signed long)0x8000000000000001,
                             &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x1, (signed long)0x7FFFFFFFFFFFFFFF,
                             &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x7FFFFFFFFFFFFFFF, (signed long)0x0,
                             &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x7FFFFFFFFFFFFFFF, (signed long)0x1,
                             &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x7FFFFFFFFFFFFFFF,
                             (signed long)0x7FFFFFFFFFFFFFFF, &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed long)0x7FFFFFFFFFFFFFFF,
                              (signed long)0x8000000000000000, &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed long)0x7FFFFFFFFFFFFFFF,
                              (signed long)0xFFFFFFFFFFFFFFFF, &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed long)0x8000000000000000,
                              (signed long)0x7FFFFFFFFFFFFFFF, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x8000000000000000,
                             (signed long)0x8000000000000000, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed long)0x8000000000000001, (signed long)0x1,
                             &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed long)0x8000000000000001, (signed long)0x2,
                              &res)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%ecx
sub    $0x0,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    112e <main+0x2e>
jmp    113a <main+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
xor    %eax,%eax
mov    %eax,%ecx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    115f <main+0x5f>
jmp    116b <main+0x6b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
xor    %eax,%eax
mov    %eax,%ecx
movabs $0x8000000000000000,%rax
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    1197 <main+0x97>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
xor    %eax,%eax
mov    %eax,%ecx
movabs $0x8000000000000001,%rax
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    11bc <main+0xbc>
jmp    11c8 <main+0xc8>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
mov    $0x1,%ecx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    11ee <main+0xee>
jmp    11fa <main+0xfa>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
sub    $0x0,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    121c <main+0x11c>
jmp    1228 <main+0x128>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
dec    %rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    1249 <main+0x149>
jmp    1255 <main+0x155>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
sub    %rcx,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    1276 <main+0x176>
jmp    1282 <main+0x182>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
movabs $0x8000000000000000,%rax
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    12b4 <main+0x1b4>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
sub    $0xffffffffffffffff,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    12dd <main+0x1dd>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x8000000000000000,%rcx
movabs $0x7fffffffffffffff,%rax
ff ff 7f
sub    %rax,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    130f <main+0x20f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x8000000000000000,%rcx
sub    %rcx,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    1330 <main+0x230>
jmp    133c <main+0x23c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x8000000000000001,%rcx
dec    %rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    135d <main+0x25d>
jmp    1369 <main+0x269>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movabs $0x8000000000000001,%rcx
sub    $0x2,%rcx
seto   %al
mov    %rcx,-0x18(%rbp)
test   $0x1,%al
jne    1392 <main+0x292>
movl   $0xffffffff,-0x4(%rbp)
jmp    1399 <main+0x299>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 0, i64 0)
%8 = extractvalue { i64, i1 } %7, 1
%9 = extractvalue { i64, i1 } %7, 0
store i64 %9, i64* %6
br i1 %8, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %77
11: ; preds = %2
%12 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 0, i64 9223372036854775807)
%13 = extractvalue { i64, i1 } %12, 1
%14 = extractvalue { i64, i1 } %12, 0
store i64 %14, i64* %6
br i1 %13, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %3
br label %77
16: ; preds = %11
%17 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 0, i64 -9223372036854775808)
%18 = extractvalue { i64, i1 } %17, 1
%19 = extractvalue { i64, i1 } %17, 0
store i64 %19, i64* %6
br i1 %18, label %21, label %20
20: ; preds = %16
store i32 -1, i32* %3
br label %77
21: ; preds = %16
%22 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 0, i64 -9223372036854775807)
%23 = extractvalue { i64, i1 } %22, 1
%24 = extractvalue { i64, i1 } %22, 0
store i64 %24, i64* %6
br i1 %23, label %25, label %26
25: ; preds = %21
store i32 -1, i32* %3
br label %77
26: ; preds = %21
%27 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 1, i64 9223372036854775807)
%28 = extractvalue { i64, i1 } %27, 1
%29 = extractvalue { i64, i1 } %27, 0
store i64 %29, i64* %6
br i1 %28, label %30, label %31
30: ; preds = %26
store i32 -1, i32* %3
br label %77
31: ; preds = %26
%32 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 9223372036854775807, i64 0)
%33 = extractvalue { i64, i1 } %32, 1
%34 = extractvalue { i64, i1 } %32, 0
store i64 %34, i64* %6
br i1 %33, label %35, label %36
35: ; preds = %31
store i32 -1, i32* %3
br label %77
36: ; preds = %31
%37 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 9223372036854775807, i64 1)
%38 = extractvalue { i64, i1 } %37, 1
%39 = extractvalue { i64, i1 } %37, 0
store i64 %39, i64* %6
br i1 %38, label %40, label %41
40: ; preds = %36
store i32 -1, i32* %3
br label %77
41: ; preds = %36
%42 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 9223372036854775807, i64 9223372036854775807)
%43 = extractvalue { i64, i1 } %42, 1
%44 = extractvalue { i64, i1 } %42, 0
store i64 %44, i64* %6
br i1 %43, label %45, label %46
45: ; preds = %41
store i32 -1, i32* %3
br label %77
46: ; preds = %41
%47 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 9223372036854775807, i64 -9223372036854775808)
%48 = extractvalue { i64, i1 } %47, 1
%49 = extractvalue { i64, i1 } %47, 0
store i64 %49, i64* %6
br i1 %48, label %51, label %50
50: ; preds = %46
store i32 -1, i32* %3
br label %77
51: ; preds = %46
%52 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 9223372036854775807, i64 -1)
%53 = extractvalue { i64, i1 } %52, 1
%54 = extractvalue { i64, i1 } %52, 0
store i64 %54, i64* %6
br i1 %53, label %56, label %55
55: ; preds = %51
store i32 -1, i32* %3
br label %77
56: ; preds = %51
%57 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 -9223372036854775808, i64 9223372036854775807)
%58 = extractvalue { i64, i1 } %57, 1
%59 = extractvalue { i64, i1 } %57, 0
store i64 %59, i64* %6
br i1 %58, label %61, label %60
60: ; preds = %56
store i32 -1, i32* %3
br label %77
61: ; preds = %56
%62 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 -9223372036854775808, i64 -9223372036854775808)
%63 = extractvalue { i64, i1 } %62, 1
%64 = extractvalue { i64, i1 } %62, 0
store i64 %64, i64* %6
br i1 %63, label %65, label %66
65: ; preds = %61
store i32 -1, i32* %3
br label %77
66: ; preds = %61
%67 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 -9223372036854775807, i64 1)
%68 = extractvalue { i64, i1 } %67, 1
%69 = extractvalue { i64, i1 } %67, 0
store i64 %69, i64* %6
br i1 %68, label %70, label %71
70: ; preds = %66
store i32 -1, i32* %3
br label %77
71: ; preds = %66
%72 = call { i64, i1 } @llvm.ssub.with.overflow.i64(i64 -9223372036854775807, i64 2)
%73 = extractvalue { i64, i1 } %72, 1
%74 = extractvalue { i64, i1 } %72, 0
store i64 %74, i64* %6
br i1 %73, label %76, label %75
75: ; preds = %71
store i32 -1, i32* %3
br label %77
76: ; preds = %71
store i32 0, i32* %3
br label %77
77: ; preds = %76, %75, %70, %65, %60, %55, %50, %45, %40, %35, %30, %25, %20, %15, %10
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}