#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 */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ neg16(int);
int /*<<< orphan*/ neg32(int);
int /*<<< orphan*/ neg64(int);
int /*<<< orphan*/ neg8(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ zero_sub16(int);
int /*<<< orphan*/ zero_sub32(int);
int /*<<< orphan*/ zero_sub64(int);
int /*<<< orphan*/ zero_sub8(int);
int main() {
  int64_t data = 0xDEADBEEFFEEDBACC;
  printf(" NEG8: %lx -> %lx\n", data, neg8(data));
  printf("NEG16: %lx -> %lx\n", data, neg16(data));
  printf("NEG32: %lx -> %lx\n", data, neg32(data));
  printf("NEG64: %lx -> %lx\n", data, neg64(data));
  printf(" ZERO_SUB8: %lx -> %lx\n", data, zero_sub8(data));
  printf("ZERO_SUB16: %lx -> %lx\n", data, zero_sub16(data));
  printf("ZERO_SUB32: %lx -> %lx\n", data, zero_sub32(data));
  printf("ZERO_SUB64: %lx -> %lx\n", data, zero_sub64(data));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfeedbacc,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <neg8@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%edi
call   10a0 <neg16@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <neg32@plt>
mov    -0x20(%rbp),%esi
mov    %eax,%edx
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <neg64@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   10b0 <zero_sub8@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <zero_sub16@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1090 <zero_sub32@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe02(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <zero_sub64@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfeedbacc,%edi
call   1030 <neg8@plt>
lea    0xe5e(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   10a0 <neg16@plt>
lea    0xe54(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   1050 <neg32@plt>
lea    0xe4a(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   1070 <neg64@plt>
lea    0xe40(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   10b0 <zero_sub8@plt>
lea    0xe36(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   1080 <zero_sub16@plt>
lea    0xe31(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   1090 <zero_sub32@plt>
lea    0xe2c(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xfeedbacc,%edi
call   1060 <zero_sub64@plt>
lea    0xe27(%rip),%rdi
mov    $0xfeedbacc,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c" NEG8: %lx -> %lx\0A\00"
@.str.1 = [19 x i8] c"NEG16: %lx -> %lx\0A\00"
@.str.2 = [19 x i8] c"NEG32: %lx -> %lx\0A\00"
@.str.3 = [19 x i8] c"NEG64: %lx -> %lx\0A\00"
@.str.4 = [24 x i8] c" ZERO_SUB8: %lx -> %lx\0A\00"
@.str.5 = [24 x i8] c"ZERO_SUB16: %lx -> %lx\0A\00"
@.str.6 = [24 x i8] c"ZERO_SUB32: %lx -> %lx\0A\00"
@.str.7 = [24 x i8] c"ZERO_SUB64: %lx -> %lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -17974580, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @neg8(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @neg16(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @neg32(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @neg64(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %2
%21 = call i32 @zero_sub8(i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %19, i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = call i32 @zero_sub16(i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 %23, i32 %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %2
%29 = call i32 @zero_sub32(i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %27, i32 %29)
%31 = load i32, i32* %2
%32 = load i32, i32* %2
%33 = call i32 @zero_sub64(i32 %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %31, i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c" NEG8: %lx -> %lx\0A\00"
@.str.1 = [19 x i8] c"NEG16: %lx -> %lx\0A\00"
@.str.2 = [19 x i8] c"NEG32: %lx -> %lx\0A\00"
@.str.3 = [19 x i8] c"NEG64: %lx -> %lx\0A\00"
@.str.4 = [24 x i8] c" ZERO_SUB8: %lx -> %lx\0A\00"
@.str.5 = [24 x i8] c"ZERO_SUB16: %lx -> %lx\0A\00"
@.str.6 = [24 x i8] c"ZERO_SUB32: %lx -> %lx\0A\00"
@.str.7 = [24 x i8] c"ZERO_SUB64: %lx -> %lx\0A\00"
define i32 @main() {
%1 = tail call i32 @neg8(i32 -17974580)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -17974580, i32 %1)
%3 = tail call i32 @neg16(i32 -17974580)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 -17974580, i32 %3)
%5 = tail call i32 @neg32(i32 -17974580)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 -17974580, i32 %5)
%7 = tail call i32 @neg64(i32 -17974580)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 -17974580, i32 %7)
%9 = tail call i32 @zero_sub8(i32 -17974580)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 -17974580, i32 %9)
%11 = tail call i32 @zero_sub16(i32 -17974580)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i32 -17974580, i32 %11)
%13 = tail call i32 @zero_sub32(i32 -17974580)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 -17974580, i32 %13)
%15 = tail call i32 @zero_sub64(i32 -17974580)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 -17974580, i32 %15)
ret i32 0
}