#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();
long long abs64(long long volatile);
long long abs64_in_dreg(long long volatile);
int main(void) {
  volatile long long ll0 = 0LL, ll1 = 1LL, llm1 = -1LL;
  if (abs64(ll0) != 0LL)
    abort();
  if (abs64(ll1) != 1LL)
    abort();
  if (abs64(llm1) != 1LL)
    abort();
  if (abs64_in_dreg(ll0) != 0LL)
    abort();
  if (abs64_in_dreg(ll1) != 1LL)
    abort();
  if (abs64_in_dreg(llm1) != 1LL)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x10(%rbp),%rdi
call   1050 <abs64@plt>
cmp    $0x0,%rax
je     1171 <main+0x41>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rdi
call   1050 <abs64@plt>
cmp    $0x1,%rax
je     118b <main+0x5b>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x20(%rbp),%rdi
call   1050 <abs64@plt>
cmp    $0x1,%rax
je     11a5 <main+0x75>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1030 <abs64_in_dreg@plt>
cmp    $0x0,%rax
je     11bf <main+0x8f>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rdi
call   1030 <abs64_in_dreg@plt>
cmp    $0x1,%rax
je     11d9 <main+0xa9>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x20(%rbp),%rdi
call   1030 <abs64_in_dreg@plt>
cmp    $0x1,%rax
je     11f3 <main+0xc3>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x1,0x8(%rsp)
movq   $0xffffffffffffffff,(%rsp)
ff
mov    0x10(%rsp),%rdi
call   1050 <abs64@plt>
test   %rax,%rax
jne    11b1 <main+0x81>
mov    0x8(%rsp),%rdi
call   1050 <abs64@plt>
cmp    $0x1,%rax
jne    11b1 <main+0x81>
mov    (%rsp),%rdi
call   1050 <abs64@plt>
cmp    $0x1,%rax
jne    11b1 <main+0x81>
mov    0x10(%rsp),%rdi
call   1030 <abs64_in_dreg@plt>
test   %rax,%rax
jne    11b1 <main+0x81>
mov    0x8(%rsp),%rdi
call   1030 <abs64_in_dreg@plt>
cmp    $0x1,%rax
jne    11b1 <main+0x81>
mov    (%rsp),%rdi
call   1030 <abs64_in_dreg@plt>
cmp    $0x1,%rax
jne    11b1 <main+0x81>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1040 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store volatile i64 0, i64* %1
%5 = bitcast i64* %2 to i8*
store volatile i64 1, i64* %2
%6 = bitcast i64* %3 to i8*
store volatile i64 -1, i64* %3
%7 = load volatile i64, i64* %1
%8 = tail call i64 @abs64(i64 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = load volatile i64, i64* %2
%14 = tail call i64 @abs64(i64 %13)
%15 = icmp eq i64 %14, 1
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %12
%19 = load volatile i64, i64* %3
%20 = tail call i64 @abs64(i64 %19)
%21 = icmp eq i64 %20, 1
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %18
%25 = load volatile i64, i64* %1
%26 = tail call i64 @abs64_in_dreg(i64 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 (...) @abort()
unreachable
30: ; preds = %24
%31 = load volatile i64, i64* %2
%32 = tail call i64 @abs64_in_dreg(i64 %31)
%33 = icmp eq i64 %32, 1
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = tail call i32 (...) @abort()
unreachable
36: ; preds = %30
%37 = load volatile i64, i64* %3
%38 = tail call i64 @abs64_in_dreg(i64 %37)
%39 = icmp eq i64 %38, 1
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = tail call i32 (...) @abort()
unreachable
42: ; preds = %36
ret i32 0
}