#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 increment(int);
int negate(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("\n10 incremented inversed");
  printf("\t%d\t%d\n", increment(10), negate(10));
  puts("\n0 incremented inversed");
  printf("\t%d\t%d\n", increment(0), negate(0));
  puts("\n-10 incremented inversed");
  printf("\t%d\t%d\n", increment(-10), negate(-10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <increment@plt>
mov    %eax,-0x10(%rbp)
mov    $0xa,%edi
call   1060 <negate@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <increment@plt>
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
call   1060 <negate@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe6d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffff6,%edi
call   1040 <increment@plt>
mov    %eax,-0x8(%rbp)
mov    $0xfffffff6,%edi
call   1060 <negate@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe39(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1040 <increment@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1060 <negate@plt>
lea    0xead(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <increment@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1060 <negate@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffff6,%edi
call   1040 <increment@plt>
mov    %eax,%ebp
mov    $0xfffffff6,%edi
call   1060 <negate@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A10 incremented inversed\00"
@.str.1 = [8 x i8] c"\09%d\09%d\0A\00"
@.str.2 = [24 x i8] c"\0A0 incremented inversed\00"
@.str.3 = [26 x i8] c"\0A-10 incremented inversed\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @increment(i32 10)
%4 = call i32 @negate(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @increment(i32 0)
%8 = call i32 @negate(i32 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @increment(i32 -10)
%12 = call i32 @negate(i32 -10)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A10 incremented inversed\00"
@.str.1 = [8 x i8] c"\09%d\09%d\0A\00"
@.str.2 = [24 x i8] c"\0A0 incremented inversed\00"
@.str.3 = [26 x i8] c"\0A-10 incremented inversed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @increment(i32 10)
%3 = tail call i32 @negate(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @increment(i32 0)
%7 = tail call i32 @negate(i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @increment(i32 -10)
%11 = tail call i32 @negate(i32 -10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}