#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 abs(int);
int /*<<< orphan*/ getch();
int labs(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  printf("\nnumber:%d absolute value:%d", 4, abs(4));
  printf("\nnumber:%d absolute value:%d", 0, abs(0));
  printf("\nnumber:%d absolute value:%d", -4, abs(-4));
  printf("\nnumber:%d absolute value:%d", 65535, abs(65535));
  printf("\nnumber:%ld absolute value:%ld", 65536, labs(65536));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <abs@plt>
mov    %eax,%edx
lea    0xea9(%rip),%rdi
mov    $0x4,%esi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <abs@plt>
mov    %eax,%edx
lea    0xe8f(%rip),%rdi
xor    %esi,%esi
call   1050 <printf@plt>
mov    $0xfffffffc,%edi
call   1030 <abs@plt>
mov    %eax,%edx
lea    0xe75(%rip),%rdi
mov    $0xfffffffc,%esi
call   1050 <printf@plt>
mov    $0xffff,%edi
call   1030 <abs@plt>
mov    %eax,%edx
lea    0xe58(%rip),%rdi
mov    $0xffff,%esi
call   1050 <printf@plt>
mov    $0x10000,%edi
call   1040 <labs@plt>
mov    %eax,%edx
lea    0xe58(%rip),%rdi
mov    $0x10000,%esi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffc,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffff,%esi
mov    $0xffff,%edx
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x10000,%esi
mov    $0x10000,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0Anumber:%d absolute value:%d\00"
@.str.1 = [31 x i8] c"\0Anumber:%ld absolute value:%ld\00"
define i32 @main() {
%1 = call i32 @abs(i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 4, i32 %1)
%3 = call i32 @abs(i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 0, i32 %3)
%5 = call i32 @abs(i32 -4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 -4, i32 %5)
%7 = call i32 @abs(i32 65535)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 65535, i32 %7)
%9 = call i32 @labs(i32 65536)
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 65536, i32 %9)
%11 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0Anumber:%d absolute value:%d\00"
@.str.1 = [31 x i8] c"\0Anumber:%ld absolute value:%ld\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 -4, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 65535, i32 65535)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 65536, i32 65536)
%6 = tail call i32 (...) @getch()
ret i32 0
}