int main(int argc, const char **argv) {
  signed int res;
  if (__builtin_sub_overflow((signed int)0x0, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x0, (signed int)0x7FFFFFFF, &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed int)0x0, (signed int)0x80000000, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x0, (signed int)0x80000001, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x1, (signed int)0x7FFFFFFF, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x7FFFFFFF, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x7FFFFFFF, (signed int)0x1, &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x7FFFFFFF, (signed int)0x7FFFFFFF,
                             &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed int)0x7FFFFFFF, (signed int)0x80000000,
                              &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed int)0x7FFFFFFF, (signed int)0xFFFFFFFF,
                              &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed int)0x80000000, (signed int)0x7FFFFFFF,
                              &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x80000000, (signed int)0x80000000,
                             &res)) {
    return -1;
  }
  if (__builtin_sub_overflow((signed int)0x80000001, (signed int)0x1, &res)) {
    return -1;
  }
  if (!__builtin_sub_overflow((signed int)0x80000001, (signed int)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    %ecx,%ecx
sub    $0x0,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    112a <main+0x2a>
jmp    1136 <main+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
xor    %ecx,%ecx
sub    $0x7fffffff,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1151 <main+0x51>
jmp    115d <main+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
xor    %ecx,%ecx
sub    $0x80000000,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    117f <main+0x7f>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
xor    %ecx,%ecx
sub    $0x80000001,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    119a <main+0x9a>
jmp    11a6 <main+0xa6>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x1,%ecx
sub    $0x7fffffff,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    11c4 <main+0xc4>
jmp    11d0 <main+0xd0>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x7fffffff,%ecx
sub    $0x0,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    11eb <main+0xeb>
jmp    11f7 <main+0xf7>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x7fffffff,%ecx
dec    %ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1211 <main+0x111>
jmp    121d <main+0x11d>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x7fffffff,%ecx
sub    $0x7fffffff,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    123b <main+0x13b>
jmp    1247 <main+0x147>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x7fffffff,%ecx
sub    $0x80000000,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    126c <main+0x16c>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x7fffffff,%ecx
sub    $0xffffffff,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1291 <main+0x191>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x80000000,%ecx
sub    $0x7fffffff,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12b6 <main+0x1b6>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x80000000,%ecx
sub    $0x80000000,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12d4 <main+0x1d4>
jmp    12e0 <main+0x1e0>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x80000001,%ecx
dec    %ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12fa <main+0x1fa>
jmp    1306 <main+0x206>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
mov    $0x80000001,%ecx
sub    $0x2,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1328 <main+0x228>
movl   $0xffffffff,-0x4(%rbp)
jmp    132f <main+0x22f>
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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 0, i32 0)
%8 = extractvalue { i32, i1 } %7, 1
%9 = extractvalue { i32, i1 } %7, 0
store i32 %9, i32* %6
br i1 %8, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %77
11: ; preds = %2
%12 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 0, i32 2147483647)
%13 = extractvalue { i32, i1 } %12, 1
%14 = extractvalue { i32, i1 } %12, 0
store i32 %14, i32* %6
br i1 %13, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %3
br label %77
16: ; preds = %11
%17 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 0, i32 -2147483648)
%18 = extractvalue { i32, i1 } %17, 1
%19 = extractvalue { i32, i1 } %17, 0
store i32 %19, i32* %6
br i1 %18, label %21, label %20
20: ; preds = %16
store i32 -1, i32* %3
br label %77
21: ; preds = %16
%22 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 0, i32 -2147483647)
%23 = extractvalue { i32, i1 } %22, 1
%24 = extractvalue { i32, i1 } %22, 0
store i32 %24, i32* %6
br i1 %23, label %25, label %26
25: ; preds = %21
store i32 -1, i32* %3
br label %77
26: ; preds = %21
%27 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 1, i32 2147483647)
%28 = extractvalue { i32, i1 } %27, 1
%29 = extractvalue { i32, i1 } %27, 0
store i32 %29, i32* %6
br i1 %28, label %30, label %31
30: ; preds = %26
store i32 -1, i32* %3
br label %77
31: ; preds = %26
%32 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 2147483647, i32 0)
%33 = extractvalue { i32, i1 } %32, 1
%34 = extractvalue { i32, i1 } %32, 0
store i32 %34, i32* %6
br i1 %33, label %35, label %36
35: ; preds = %31
store i32 -1, i32* %3
br label %77
36: ; preds = %31
%37 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 2147483647, i32 1)
%38 = extractvalue { i32, i1 } %37, 1
%39 = extractvalue { i32, i1 } %37, 0
store i32 %39, i32* %6
br i1 %38, label %40, label %41
40: ; preds = %36
store i32 -1, i32* %3
br label %77
41: ; preds = %36
%42 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 2147483647, i32 2147483647)
%43 = extractvalue { i32, i1 } %42, 1
%44 = extractvalue { i32, i1 } %42, 0
store i32 %44, i32* %6
br i1 %43, label %45, label %46
45: ; preds = %41
store i32 -1, i32* %3
br label %77
46: ; preds = %41
%47 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 2147483647, i32 -2147483648)
%48 = extractvalue { i32, i1 } %47, 1
%49 = extractvalue { i32, i1 } %47, 0
store i32 %49, i32* %6
br i1 %48, label %51, label %50
50: ; preds = %46
store i32 -1, i32* %3
br label %77
51: ; preds = %46
%52 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 2147483647, i32 -1)
%53 = extractvalue { i32, i1 } %52, 1
%54 = extractvalue { i32, i1 } %52, 0
store i32 %54, i32* %6
br i1 %53, label %56, label %55
55: ; preds = %51
store i32 -1, i32* %3
br label %77
56: ; preds = %51
%57 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 -2147483648, i32 2147483647)
%58 = extractvalue { i32, i1 } %57, 1
%59 = extractvalue { i32, i1 } %57, 0
store i32 %59, i32* %6
br i1 %58, label %61, label %60
60: ; preds = %56
store i32 -1, i32* %3
br label %77
61: ; preds = %56
%62 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 -2147483648, i32 -2147483648)
%63 = extractvalue { i32, i1 } %62, 1
%64 = extractvalue { i32, i1 } %62, 0
store i32 %64, i32* %6
br i1 %63, label %65, label %66
65: ; preds = %61
store i32 -1, i32* %3
br label %77
66: ; preds = %61
%67 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 -2147483647, i32 1)
%68 = extractvalue { i32, i1 } %67, 1
%69 = extractvalue { i32, i1 } %67, 0
store i32 %69, i32* %6
br i1 %68, label %70, label %71
70: ; preds = %66
store i32 -1, i32* %3
br label %77
71: ; preds = %66
%72 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 -2147483647, i32 2)
%73 = extractvalue { i32, i1 } %72, 1
%74 = extractvalue { i32, i1 } %72, 0
store i32 %74, i32* %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
}