#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*/ test(int, int);
int main(void) {
  test(500, 50);
  test(500, -50);
  test(-500, 50);
  test(-500, -50);
  test(100, 7);
  test(-100, 7);
  test(100, -7);
  test(-100, -7);
  test(1, 0);
  test(0, 0);
  test(-1, 0);
  test(0x80000000, 0);
  test(0x7FFFFFFF, 0);
  test(0x80000000, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1f4,%edi
mov    $0x32,%esi
call   1030 <test@plt>
mov    $0x1f4,%edi
mov    $0xffffffce,%esi
call   1030 <test@plt>
mov    $0xfffffe0c,%edi
mov    $0x32,%esi
call   1030 <test@plt>
mov    $0xfffffe0c,%edi
mov    $0xffffffce,%esi
call   1030 <test@plt>
mov    $0x64,%edi
mov    $0x7,%esi
call   1030 <test@plt>
mov    $0xffffff9c,%edi
mov    $0x7,%esi
call   1030 <test@plt>
mov    $0x64,%edi
mov    $0xfffffff9,%esi
call   1030 <test@plt>
mov    $0xffffff9c,%edi
mov    $0xfffffff9,%esi
call   1030 <test@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <test@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <test@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x80000000,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x7fffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x80000000,%edi
mov    $0xffffffff,%esi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f4,%edi
mov    $0x32,%esi
call   1030 <test@plt>
mov    $0x1f4,%edi
mov    $0xffffffce,%esi
call   1030 <test@plt>
mov    $0xfffffe0c,%edi
mov    $0x32,%esi
call   1030 <test@plt>
mov    $0xfffffe0c,%edi
mov    $0xffffffce,%esi
call   1030 <test@plt>
mov    $0x64,%edi
mov    $0x7,%esi
call   1030 <test@plt>
mov    $0xffffff9c,%edi
mov    $0x7,%esi
call   1030 <test@plt>
mov    $0x64,%edi
mov    $0xfffffff9,%esi
call   1030 <test@plt>
mov    $0xffffff9c,%edi
mov    $0xfffffff9,%esi
call   1030 <test@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <test@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x80000000,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x7fffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0x80000000,%edi
mov    $0xffffffff,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 500, i32 50)
%3 = call i32 @test(i32 500, i32 -50)
%4 = call i32 @test(i32 -500, i32 50)
%5 = call i32 @test(i32 -500, i32 -50)
%6 = call i32 @test(i32 100, i32 7)
%7 = call i32 @test(i32 -100, i32 7)
%8 = call i32 @test(i32 100, i32 -7)
%9 = call i32 @test(i32 -100, i32 -7)
%10 = call i32 @test(i32 1, i32 0)
%11 = call i32 @test(i32 0, i32 0)
%12 = call i32 @test(i32 -1, i32 0)
%13 = call i32 @test(i32 -2147483648, i32 0)
%14 = call i32 @test(i32 2147483647, i32 0)
%15 = call i32 @test(i32 -2147483648, i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 500, i32 50)
%2 = tail call i32 @test(i32 500, i32 -50)
%3 = tail call i32 @test(i32 -500, i32 50)
%4 = tail call i32 @test(i32 -500, i32 -50)
%5 = tail call i32 @test(i32 100, i32 7)
%6 = tail call i32 @test(i32 -100, i32 7)
%7 = tail call i32 @test(i32 100, i32 -7)
%8 = tail call i32 @test(i32 -100, i32 -7)
%9 = tail call i32 @test(i32 1, i32 0)
%10 = tail call i32 @test(i32 0, i32 0)
%11 = tail call i32 @test(i32 -1, i32 0)
%12 = tail call i32 @test(i32 -2147483648, i32 0)
%13 = tail call i32 @test(i32 2147483647, i32 0)
%14 = tail call i32 @test(i32 -2147483648, i32 -1)
ret i32 0
}