int main(int argc, const char **argv) {
  signed int res;
  if (__builtin_mul_overflow((signed int)0x0, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x0, (signed int)0x7FFFFFFF, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x0, (signed int)0x80000000, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x1, (signed int)0x7FFFFFFF, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x1, (signed int)0x80000000, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x2, (signed int)0x3FFFFFFF, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x2, (signed int)0xC0000000, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x2, (signed int)0x7FFFFFFF, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x2, (signed int)0x80000000, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x0FFFFFFF, (signed int)0x8, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x10000000, (signed int)0x8, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x7FFFFFFF, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x7FFFFFFF, (signed int)0x1, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x7FFFFFFF, (signed int)0x2, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x7FFFFFFF, (signed int)0x7FFFFFFF,
                              &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x7FFFFFFF, (signed int)0x80000000,
                              &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x80000000, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0x80000000, (signed int)0x1, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x80000000, (signed int)0x2, &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x80000000, (signed int)0x7FFFFFFF,
                              &res)) {
    return -1;
  }
  if (!__builtin_mul_overflow((signed int)0x80000000, (signed int)0x80000000,
                              &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0xFFFFFFFF, (signed int)0x0, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0xFFFFFFFF, (signed int)0x1, &res)) {
    return -1;
  }
  if (__builtin_mul_overflow((signed int)0xFFFFFFFF, (signed int)0xFFFFFFFF,
                             &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
imul   %ecx,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    112a <main+0x2a>
jmp    1136 <main+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
xor    %ecx,%ecx
mov    $0x7fffffff,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1153 <main+0x53>
jmp    115f <main+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
xor    %ecx,%ecx
mov    $0x80000000,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    117c <main+0x7c>
jmp    1188 <main+0x88>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x1,%ecx
mov    $0x7fffffff,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    11a8 <main+0xa8>
jmp    11b4 <main+0xb4>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x1,%ecx
mov    $0x80000000,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    11d4 <main+0xd4>
jmp    11e0 <main+0xe0>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x2,%ecx
mov    $0x3fffffff,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1200 <main+0x100>
jmp    120c <main+0x10c>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x2,%ecx
mov    $0xc0000000,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    122c <main+0x12c>
jmp    1238 <main+0x138>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x2,%ecx
mov    $0x7fffffff,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    125f <main+0x15f>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x2,%ecx
mov    $0x80000000,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1286 <main+0x186>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0xfffffff,%ecx
mov    $0x8,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12a6 <main+0x1a6>
jmp    12b2 <main+0x1b2>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x10000000,%ecx
mov    $0x8,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12d9 <main+0x1d9>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x7fffffff,%ecx
xor    %eax,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    12f6 <main+0x1f6>
jmp    1302 <main+0x202>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x7fffffff,%ecx
mov    $0x1,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1322 <main+0x222>
jmp    132e <main+0x22e>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x7fffffff,%ecx
mov    $0x2,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1355 <main+0x255>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x7fffffff,%ecx
imul   %ecx,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1377 <main+0x277>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x7fffffff,%ecx
mov    $0x80000000,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    139e <main+0x29e>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x80000000,%ecx
xor    %eax,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    13bb <main+0x2bb>
jmp    13c7 <main+0x2c7>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x80000000,%ecx
mov    $0x1,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    13e7 <main+0x2e7>
jmp    13f3 <main+0x2f3>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x80000000,%ecx
mov    $0x2,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    141a <main+0x31a>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x80000000,%ecx
mov    $0x7fffffff,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1441 <main+0x341>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0x80000000,%ecx
imul   %ecx,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1463 <main+0x363>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0xffffffff,%ecx
xor    %eax,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    1480 <main+0x380>
jmp    148c <main+0x38c>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0xffffffff,%ecx
mov    $0x1,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    14ac <main+0x3ac>
jmp    14b8 <main+0x3b8>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
mov    $0xffffffff,%ecx
imul   %ecx,%ecx
seto   %al
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    14d3 <main+0x3d3>
jmp    14df <main+0x3df>
movl   $0xffffffff,-0x4(%rbp)
jmp    14e6 <main+0x3e6>
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.smul.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 %127
11: ; preds = %2
%12 = call { i32, i1 } @llvm.smul.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 %127
16: ; preds = %11
%17 = call { i32, i1 } @llvm.smul.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 %20, label %21
20: ; preds = %16
store i32 -1, i32* %3
br label %127
21: ; preds = %16
%22 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 1, 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 %127
26: ; preds = %21
%27 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 1, i32 -2147483648)
%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 %127
31: ; preds = %26
%32 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2, i32 1073741823)
%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 %127
36: ; preds = %31
%37 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2, i32 -1073741824)
%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 %127
41: ; preds = %36
%42 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2, i32 2147483647)
%43 = extractvalue { i32, i1 } %42, 1
%44 = extractvalue { i32, i1 } %42, 0
store i32 %44, i32* %6
br i1 %43, label %46, label %45
45: ; preds = %41
store i32 -1, i32* %3
br label %127
46: ; preds = %41
%47 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2, 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 %127
51: ; preds = %46
%52 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 268435455, i32 8)
%53 = extractvalue { i32, i1 } %52, 1
%54 = extractvalue { i32, i1 } %52, 0
store i32 %54, i32* %6
br i1 %53, label %55, label %56
55: ; preds = %51
store i32 -1, i32* %3
br label %127
56: ; preds = %51
%57 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 268435456, i32 8)
%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 %127
61: ; preds = %56
%62 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2147483647, i32 0)
%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 %127
66: ; preds = %61
%67 = call { i32, i1 } @llvm.smul.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 %127
71: ; preds = %66
%72 = call { i32, i1 } @llvm.smul.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 %127
76: ; preds = %71
%77 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2147483647, i32 2147483647)
%78 = extractvalue { i32, i1 } %77, 1
%79 = extractvalue { i32, i1 } %77, 0
store i32 %79, i32* %6
br i1 %78, label %81, label %80
80: ; preds = %76
store i32 -1, i32* %3
br label %127
81: ; preds = %76
%82 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 2147483647, i32 -2147483648)
%83 = extractvalue { i32, i1 } %82, 1
%84 = extractvalue { i32, i1 } %82, 0
store i32 %84, i32* %6
br i1 %83, label %86, label %85
85: ; preds = %81
store i32 -1, i32* %3
br label %127
86: ; preds = %81
%87 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -2147483648, i32 0)
%88 = extractvalue { i32, i1 } %87, 1
%89 = extractvalue { i32, i1 } %87, 0
store i32 %89, i32* %6
br i1 %88, label %90, label %91
90: ; preds = %86
store i32 -1, i32* %3
br label %127
91: ; preds = %86
%92 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -2147483648, i32 1)
%93 = extractvalue { i32, i1 } %92, 1
%94 = extractvalue { i32, i1 } %92, 0
store i32 %94, i32* %6
br i1 %93, label %95, label %96
95: ; preds = %91
store i32 -1, i32* %3
br label %127
96: ; preds = %91
%97 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -2147483648, i32 2)
%98 = extractvalue { i32, i1 } %97, 1
%99 = extractvalue { i32, i1 } %97, 0
store i32 %99, i32* %6
br i1 %98, label %101, label %100
100: ; preds = %96
store i32 -1, i32* %3
br label %127
101: ; preds = %96
%102 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -2147483648, i32 2147483647)
%103 = extractvalue { i32, i1 } %102, 1
%104 = extractvalue { i32, i1 } %102, 0
store i32 %104, i32* %6
br i1 %103, label %106, label %105
105: ; preds = %101
store i32 -1, i32* %3
br label %127
106: ; preds = %101
%107 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -2147483648, i32 -2147483648)
%108 = extractvalue { i32, i1 } %107, 1
%109 = extractvalue { i32, i1 } %107, 0
store i32 %109, i32* %6
br i1 %108, label %111, label %110
110: ; preds = %106
store i32 -1, i32* %3
br label %127
111: ; preds = %106
%112 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -1, i32 0)
%113 = extractvalue { i32, i1 } %112, 1
%114 = extractvalue { i32, i1 } %112, 0
store i32 %114, i32* %6
br i1 %113, label %115, label %116
115: ; preds = %111
store i32 -1, i32* %3
br label %127
116: ; preds = %111
%117 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -1, i32 1)
%118 = extractvalue { i32, i1 } %117, 1
%119 = extractvalue { i32, i1 } %117, 0
store i32 %119, i32* %6
br i1 %118, label %120, label %121
120: ; preds = %116
store i32 -1, i32* %3
br label %127
121: ; preds = %116
%122 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 -1, i32 -1)
%123 = extractvalue { i32, i1 } %122, 1
%124 = extractvalue { i32, i1 } %122, 0
store i32 %124, i32* %6
br i1 %123, label %125, label %126
125: ; preds = %121
store i32 -1, i32* %3
br label %127
126: ; preds = %121
store i32 0, i32* %3
br label %127
127: ; preds = %126, %125, %120, %115, %110, %105, %100, %95, %90, %85, %80, %75, %70, %65, %60, %55, %50, %45, %40, %35, %30, %25, %20, %15, %10
%128 = load i32, i32* %3
ret i32 %128
}

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