#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*/ abort();
int neg32(int);
int neg32_in_sreg(int);
int neg64(long long);
int neg64_in_dreg(long long);
int main(void) {
  long long a;
  int b;
  a = 61;
  b = 313;
  if (neg64(a) != -61)
    abort();
  if (neg64_in_dreg(a) != -61)
    abort();
  if (neg32(b) != -313)
    abort();
  if (neg32_in_sreg(b) != -313)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3d,-0x10(%rbp)
movl   $0x139,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <neg64@plt>
cmp    $0xffffffc3,%eax
je     1187 <main+0x37>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1070 <neg64_in_dreg@plt>
cmp    $0xffffffc3,%eax
je     11a0 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x14(%rbp),%edi
call   1050 <neg32@plt>
cmp    $0xfffffec7,%eax
je     11ba <main+0x6a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x14(%rbp),%edi
call   1040 <neg32_in_sreg@plt>
cmp    $0xfffffec7,%eax
je     11d4 <main+0x84>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3d,%edi
call   1060 <neg64@plt>
cmp    $0xffffffc3,%eax
jne    1195 <main+0x45>
mov    $0x3d,%edi
call   1070 <neg64_in_dreg@plt>
cmp    $0xffffffc3,%eax
jne    1195 <main+0x45>
mov    $0x139,%edi
call   1050 <neg32@plt>
cmp    $0xfffffec7,%eax
jne    1195 <main+0x45>
mov    $0x139,%edi
call   1040 <neg32_in_sreg@plt>
cmp    $0xfffffec7,%eax
jne    1195 <main+0x45>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 61, i64* %2
store i32 313, i32* %3
%4 = load i64, i64* %2
%5 = call i32 @neg64(i64 %4)
%6 = icmp ne i32 %5, -61
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = load i64, i64* %2
%11 = call i32 @neg64_in_dreg(i64 %10)
%12 = icmp ne i32 %11, -61
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %9
%16 = load i32, i32* %3
%17 = call i32 @neg32(i32 %16)
%18 = icmp ne i32 %17, -313
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %15
%22 = load i32, i32* %3
%23 = call i32 @neg32_in_sreg(i32 %22)
%24 = icmp ne i32 %23, -313
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @abort()
unreachable
27: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @neg64(i64 61)
%2 = icmp eq i32 %1, -61
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @neg64_in_dreg(i64 61)
%7 = icmp eq i32 %6, -61
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @neg32(i32 313)
%12 = icmp eq i32 %11, -313
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i32 @neg32_in_sreg(i32 313)
%17 = icmp eq i32 %16, -313
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %15
ret i32 0
}