#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 */
scalar_t__ test__addvsi3(int, int);
int main() {
  if (test__addvsi3(0x80000000, 1))
    return 1;
  if (test__addvsi3(1, 0x80000000))
    return 1;
  if (test__addvsi3(0x80000000, 0))
    return 1;
  if (test__addvsi3(0, 0x80000000))
    return 1;
  if (test__addvsi3(0x7FFFFFFF, -1))
    return 1;
  if (test__addvsi3(-1, 0x7FFFFFFF))
    return 1;
  if (test__addvsi3(0x7FFFFFFF, 0))
    return 1;
  if (test__addvsi3(0, 0x7FFFFFFF))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000000,%edi
mov    $0x1,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     1144 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
mov    $0x1,%edi
mov    $0x80000000,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     1169 <main+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
mov    $0x80000000,%edi
xor    %esi,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     118b <main+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
xor    %edi,%edi
mov    $0x80000000,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     11ad <main+0x9d>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
mov    $0x7fffffff,%edi
mov    $0xffffffff,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     11d2 <main+0xc2>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
mov    $0xffffffff,%edi
mov    $0x7fffffff,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     11f7 <main+0xe7>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
mov    $0x7fffffff,%edi
xor    %esi,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     1219 <main+0x109>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
xor    %edi,%edi
mov    $0x7fffffff,%esi
call   1030 <test__addvsi3@plt>
cmp    $0x0,%rax
je     123b <main+0x12b>
movl   $0x1,-0x4(%rbp)
jmp    1242 <main+0x132>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
mov    $0x80000000,%edi
mov    $0x1,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
mov    $0x1,%ebx
mov    $0x1,%edi
mov    $0x80000000,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
mov    $0x80000000,%edi
xor    %esi,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
xor    %edi,%edi
mov    $0x80000000,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
mov    $0x7fffffff,%edi
mov    $0xffffffff,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
mov    $0xffffffff,%edi
mov    $0x7fffffff,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
mov    $0x7fffffff,%edi
xor    %esi,%esi
call   1030 <test__addvsi3@plt>
test   %rax,%rax
jne    11b6 <main+0xa6>
xor    %edi,%edi
mov    $0x7fffffff,%esi
call   1030 <test__addvsi3@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @test__addvsi3(i32 -2147483648, i32 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %34
5: ; preds = %0
%6 = call i64 @test__addvsi3(i32 1, i32 -2147483648)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %34
9: ; preds = %5
%10 = call i64 @test__addvsi3(i32 -2147483648, i32 0)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %1
br label %34
13: ; preds = %9
%14 = call i64 @test__addvsi3(i32 0, i32 -2147483648)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %1
br label %34
17: ; preds = %13
%18 = call i64 @test__addvsi3(i32 2147483647, i32 -1)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %1
br label %34
21: ; preds = %17
%22 = call i64 @test__addvsi3(i32 -1, i32 2147483647)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %1
br label %34
25: ; preds = %21
%26 = call i64 @test__addvsi3(i32 2147483647, i32 0)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %1
br label %34
29: ; preds = %25
%30 = call i64 @test__addvsi3(i32 0, i32 2147483647)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 1, i32* %1
br label %34
33: ; preds = %29
store i32 0, i32* %1
br label %34
34: ; preds = %33, %32, %28, %24, %20, %16, %12, %8, %4
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test__addvsi3(i32 -2147483648, i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %25
3: ; preds = %0
%4 = tail call i64 @test__addvsi3(i32 1, i32 -2147483648)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = tail call i64 @test__addvsi3(i32 -2147483648, i32 0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = tail call i64 @test__addvsi3(i32 0, i32 -2147483648)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = tail call i64 @test__addvsi3(i32 2147483647, i32 -1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = tail call i64 @test__addvsi3(i32 -1, i32 2147483647)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = tail call i64 @test__addvsi3(i32 2147483647, i32 0)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = tail call i64 @test__addvsi3(i32 0, i32 2147483647)
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %21, %18, %15, %12, %9, %6, %3, %0
%26 = phi i32 [ 1, %0 ], [ 1, %3 ], [ 1, %6 ], [ 1, %9 ], [ 1, %12 ], [ 1, %15 ], [ 1, %18 ], [ %24, %21 ]
ret i32 %26
}