#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int tsub_ok(int, int);
int main() {
  printf("%d - %d = %d : %d\n", -2147483640, 2147483640,
         -2147483640 - 2147483640, tsub_ok(-2147483640, 2147483640));
  printf("%d - %d = %d : %d\n", 2147483640, -1000, 2147483640 - -1000,
         tsub_ok(2147483640, -1000));
  printf("%d - %d = %d : %d\n", 2147483640, 1000, 2147483640 - 1000,
         tsub_ok(2147483640, 1000));
  printf("%d - %d = %d : %d\n", 3640, -1000, 3640 - -1000,
         tsub_ok(3640, -1000));
  printf("%d - %d = %d : %d\n", -3640, -1000, -3640 - -1000,
         tsub_ok(-3640, -1000));
  printf("%d - %d = %d : %d\n", 0, -1000, 0 - -1000, tsub_ok(0, -1000));
  printf("%d - %d = %d : %d\n", 0, 1000, 0 - 1000, tsub_ok(0, 1000));
  printf("%d - %d = %d : %d\n", 100, 0, 100 - 0, tsub_ok(100, 0));
  printf("%d - %d = %d : %d\n", -100, 0, -100 - 0, tsub_ok(-100, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000008,%edi
mov    $0x7ffffff8,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xeb8(%rip),%rdi
mov    $0x80000008,%esi
mov    $0x7ffffff8,%edx
mov    $0x10,%ecx
call   1030 <printf@plt>
mov    $0x7ffffff8,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xe8b(%rip),%rdi
mov    $0x7ffffff8,%esi
mov    $0xfffffc18,%edx
mov    $0x800003e0,%ecx
call   1030 <printf@plt>
mov    $0x7ffffff8,%edi
mov    $0x3e8,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xe5e(%rip),%rdi
mov    $0x7ffffff8,%esi
mov    $0x3e8,%edx
mov    $0x7ffffc10,%ecx
call   1030 <printf@plt>
mov    $0xe38,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xe31(%rip),%rdi
mov    $0xe38,%esi
mov    $0xfffffc18,%edx
mov    $0x1220,%ecx
call   1030 <printf@plt>
mov    $0xfffff1c8,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xe04(%rip),%rdi
mov    $0xfffff1c8,%esi
mov    $0xfffffc18,%edx
mov    $0xfffff5b0,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xdda(%rip),%rdi
xor    %esi,%esi
mov    $0xfffffc18,%edx
mov    $0x3e8,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xdb3(%rip),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
mov    $0xfffffc18,%ecx
call   1030 <printf@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xd8c(%rip),%rdi
mov    $0x64,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <printf@plt>
mov    $0xffffff9c,%edi
xor    %esi,%esi
call   1040 <tsub_ok@plt>
mov    %eax,%r8d
lea    0xd68(%rip),%rdi
mov    $0xffffff9c,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80000008,%edi
mov    $0x7ffffff8,%esi
call   1040 <tsub_ok@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80000008,%esi
mov    $0x7ffffff8,%edx
mov    $0x10,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0x7ffffff8,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0x7ffffff8,%esi
mov    $0xfffffc18,%edx
mov    $0x800003e0,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0x7ffffff8,%edi
mov    $0x3e8,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0x7ffffff8,%esi
mov    $0x3e8,%edx
mov    $0x7ffffc10,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0xe38,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0xe38,%esi
mov    $0xfffffc18,%edx
mov    $0x1220,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0xfffff1c8,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0xfffff1c8,%esi
mov    $0xfffffc18,%edx
mov    $0xfffff5b0,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0xfffffc18,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xfffffc18,%edx
mov    $0x3e8,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
mov    $0xfffffc18,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0x64,%edi
xor    %esi,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %edx,%edx
mov    $0x64,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0xffffff9c,%edi
xor    %esi,%esi
call   1040 <tsub_ok@plt>
mov    %rbx,%rdi
mov    $0xffffff9c,%esi
xor    %edx,%edx
mov    $0xffffff9c,%ecx
mov    %eax,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%d - %d = %d : %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tsub_ok(i32 -2147483640, i32 2147483640)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -2147483640, i32 2147483640, i32 16, i32 %2)
%4 = call i32 @tsub_ok(i32 2147483640, i32 -1000)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2147483640, i32 -1000, i32 -2147482656, i32 %4)
%6 = call i32 @tsub_ok(i32 2147483640, i32 1000)
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2147483640, i32 1000, i32 2147482640, i32 %6)
%8 = call i32 @tsub_ok(i32 3640, i32 -1000)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3640, i32 -1000, i32 4640, i32 %8)
%10 = call i32 @tsub_ok(i32 -3640, i32 -1000)
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -3640, i32 -1000, i32 -2640, i32 %10)
%12 = call i32 @tsub_ok(i32 0, i32 -1000)
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1000, i32 1000, i32 %12)
%14 = call i32 @tsub_ok(i32 0, i32 1000)
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 1000, i32 -1000, i32 %14)
%16 = call i32 @tsub_ok(i32 100, i32 0)
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 0, i32 100, i32 %16)
%18 = call i32 @tsub_ok(i32 -100, i32 0)
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -100, i32 0, i32 -100, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d - %d = %d : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @tsub_ok(i32 -2147483640, i32 2147483640)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -2147483640, i32 2147483640, i32 16, i32 %1)
%3 = tail call i32 @tsub_ok(i32 2147483640, i32 -1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2147483640, i32 -1000, i32 -2147482656, i32 %3)
%5 = tail call i32 @tsub_ok(i32 2147483640, i32 1000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2147483640, i32 1000, i32 2147482640, i32 %5)
%7 = tail call i32 @tsub_ok(i32 3640, i32 -1000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3640, i32 -1000, i32 4640, i32 %7)
%9 = tail call i32 @tsub_ok(i32 -3640, i32 -1000)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -3640, i32 -1000, i32 -2640, i32 %9)
%11 = tail call i32 @tsub_ok(i32 0, i32 -1000)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1000, i32 1000, i32 %11)
%13 = tail call i32 @tsub_ok(i32 0, i32 1000)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 1000, i32 -1000, i32 %13)
%15 = tail call i32 @tsub_ok(i32 100, i32 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 100, i32 0, i32 100, i32 %15)
%17 = tail call i32 @tsub_ok(i32 -100, i32 0)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -100, i32 0, i32 -100, i32 %17)
ret i32 0
}