int main(void) {
  volatile int j = (-0x7fffffff - 1);
  volatile int i = 1;
  volatile int k = j - i;
  j--;
  j = (-0x7fffffff - 1) + 100;
  j -= (1 << 10);
  j = (-0x7fffffff - 1);
  i = -1;
  k = j - -i;
  i = (-0x7fffffff - 1) + 1000;
  i -= (1 << 20);
  volatile long int l = (-0x7fffffffffffffffL - 1L);
  volatile long int m = 1;
  volatile long int n = l - m;
  l--;
  l = (-0x7fffffffffffffffL - 1L) + 100;
  l -= (1 << 10);
  l = (-0x7fffffffffffffffL - 1L);
  m = -1;
  n = l - -m;
  m = (-0x7fffffffffffffffL - 1L) + 1000;
  m -= (1 << 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
movl   $0x80000064,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x400,%eax
mov    %eax,-0x8(%rbp)
movl   $0x80000000,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0x800003e8,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x100000,%eax
mov    %eax,-0xc(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
movabs $0x8000000000000064,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x400,%rax
mov    %rax,-0x18(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
movabs $0x80000000000003e8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    $0x100000,%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x80000000,-0x28(%rsp)
80
movl   $0x1,-0x24(%rsp)
mov    -0x28(%rsp),%eax
sub    -0x24(%rsp),%eax
mov    %eax,-0xc(%rsp)
addl   $0xffffffff,-0x28(%rsp)
movl   $0x80000064,-0x28(%rsp)
80
addl   $0xfffffc00,-0x28(%rsp)
ff
movl   $0x80000000,-0x28(%rsp)
80
movl   $0xffffffff,-0x24(%rsp)
ff
mov    -0x28(%rsp),%eax
add    -0x24(%rsp),%eax
mov    %eax,-0xc(%rsp)
movl   $0x800003e8,-0x24(%rsp)
80
addl   $0xfff00000,-0x24(%rsp)
ff
movabs $0x8000000000000000,%rax
mov    %rax,-0x20(%rsp)
movq   $0x1,-0x18(%rsp)
mov    -0x20(%rsp),%rcx
sub    -0x18(%rsp),%rcx
mov    %rcx,-0x8(%rsp)
addq   $0xffffffffffffffff,-0x20(%rsp)
lea    0x64(%rax),%rcx
mov    %rcx,-0x20(%rsp)
addq   $0xfffffffffffffc00,-0x20(%rsp)
ff ff
mov    %rax,-0x20(%rsp)
movq   $0xffffffffffffffff,-0x18(%rsp)
ff ff
mov    -0x20(%rsp),%rcx
add    -0x18(%rsp),%rcx
mov    %rcx,-0x8(%rsp)
or     $0x3e8,%rax
mov    %rax,-0x18(%rsp)
addq   $0xfffffffffff00000,-0x18(%rsp)
f0 ff
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
store volatile i32 -2147483648, i32* %2
store volatile i32 1, i32* %3
%8 = load volatile i32, i32* %2
%9 = load volatile i32, i32* %3
%10 = sub nsw i32 %8, %9
store volatile i32 %10, i32* %4
%11 = load volatile i32, i32* %2
%12 = add nsw i32 %11, -1
store volatile i32 %12, i32* %2
store volatile i32 -2147483548, i32* %2
%13 = load volatile i32, i32* %2
%14 = sub nsw i32 %13, 1024
store volatile i32 %14, i32* %2
store volatile i32 -2147483648, i32* %2
store volatile i32 -1, i32* %3
%15 = load volatile i32, i32* %2
%16 = load volatile i32, i32* %3
%17 = sub nsw i32 0, %16
%18 = sub nsw i32 %15, %17
store volatile i32 %18, i32* %4
store volatile i32 -2147482648, i32* %3
%19 = load volatile i32, i32* %3
%20 = sub nsw i32 %19, 1048576
store volatile i32 %20, i32* %3
store volatile i64 -9223372036854775808, i64* %5
store volatile i64 1, i64* %6
%21 = load volatile i64, i64* %5
%22 = load volatile i64, i64* %6
%23 = sub nsw i64 %21, %22
store volatile i64 %23, i64* %7
%24 = load volatile i64, i64* %5
%25 = add nsw i64 %24, -1
store volatile i64 %25, i64* %5
store volatile i64 -9223372036854775708, i64* %5
%26 = load volatile i64, i64* %5
%27 = sub nsw i64 %26, 1024
store volatile i64 %27, i64* %5
store volatile i64 -9223372036854775808, i64* %5
store volatile i64 -1, i64* %6
%28 = load volatile i64, i64* %5
%29 = load volatile i64, i64* %6
%30 = sub nsw i64 0, %29
%31 = sub nsw i64 %28, %30
store volatile i64 %31, i64* %7
store volatile i64 -9223372036854774808, i64* %6
%32 = load volatile i64, i64* %6
%33 = sub nsw i64 %32, 1048576
store volatile i64 %33, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = bitcast i32* %1 to i8*
store volatile i32 -2147483648, i32* %1
%8 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%9 = bitcast i32* %3 to i8*
%10 = load volatile i32, i32* %1
%11 = load volatile i32, i32* %2
%12 = sub nsw i32 %10, %11
store volatile i32 %12, i32* %3
%13 = load volatile i32, i32* %1
%14 = add nsw i32 %13, -1
store volatile i32 %14, i32* %1
store volatile i32 -2147483548, i32* %1
%15 = load volatile i32, i32* %1
%16 = add nsw i32 %15, -1024
store volatile i32 %16, i32* %1
store volatile i32 -2147483648, i32* %1
store volatile i32 -1, i32* %2
%17 = load volatile i32, i32* %1
%18 = load volatile i32, i32* %2
%19 = add nsw i32 %18, %17
store volatile i32 %19, i32* %3
store volatile i32 -2147482648, i32* %2
%20 = load volatile i32, i32* %2
%21 = add nsw i32 %20, -1048576
store volatile i32 %21, i32* %2
%22 = bitcast i64* %4 to i8*
store volatile i64 -9223372036854775808, i64* %4
%23 = bitcast i64* %5 to i8*
store volatile i64 1, i64* %5
%24 = bitcast i64* %6 to i8*
%25 = load volatile i64, i64* %4
%26 = load volatile i64, i64* %5
%27 = sub nsw i64 %25, %26
store volatile i64 %27, i64* %6
%28 = load volatile i64, i64* %4
%29 = add nsw i64 %28, -1
store volatile i64 %29, i64* %4
store volatile i64 -9223372036854775708, i64* %4
%30 = load volatile i64, i64* %4
%31 = add nsw i64 %30, -1024
store volatile i64 %31, i64* %4
store volatile i64 -9223372036854775808, i64* %4
store volatile i64 -1, i64* %5
%32 = load volatile i64, i64* %4
%33 = load volatile i64, i64* %5
%34 = add nsw i64 %33, %32
store volatile i64 %34, i64* %6
store volatile i64 -9223372036854774808, i64* %5
%35 = load volatile i64, i64* %5
%36 = add nsw i64 %35, -1048576
store volatile i64 %36, i64* %5
ret i32 0
}