#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 */
void *pow(long, int);
int /*<<< orphan*/ printf(char *, int, long);
int main() {
  long a = 2;
  long ini = 0;
  long ran_char = pow(a, 8);
  short int ran_shint = pow(a, 16);
  unsigned long int ran1_lnint = pow(a, 32);
  long int ran_lnint = pow(a, 32);
  printf("Unsigned Char: %d a %d\n", ini, ran_char - 1);
  printf("Signed Char: %d a %d\n", 0 - (ran_char / 2), ran_char / 2 - 1);
  printf("Unsigned Short Int: %d a %hi\n", ini, ran_shint - 1);
  printf("Signed Short Int: %hi a %hi\n", 0 - (ran_shint / 2),
         ran_shint / 2 - 1);
  printf("Unsigned Long Int: %d a %lu\n", ini, ran1_lnint - 1);
  printf("Signed Long Int: %li a %li\n", (0 - (ran_lnint / 2)) * -1,
         (ran_lnint / 2 - 1) * -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1040 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <pow@plt>
mov    %ax,-0x22(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <pow@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <pow@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdx
sub    $0x1,%rdx
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
movswl -0x22(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rdx
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
movswl -0x22(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %esi,%esi
sub    %eax,%esi
movswl -0x22(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
movslq %eax,%rdx
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    -0x30(%rbp),%rdx
sub    $0x1,%rdx
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
imul   $0xffffffffffffffff,%rax,%rax
mov    %eax,%esi
mov    -0x38(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
sub    $0x1,%rax
imul   $0xffffffffffffffff,%rax,%rdx
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <pow@plt>
mov    %rax,%rbx
mov    $0x2,%edi
mov    $0x10,%esi
call   1040 <pow@plt>
mov    %rax,%r15
mov    $0x2,%edi
mov    $0x20,%esi
call   1040 <pow@plt>
mov    %rax,%r12
mov    $0x2,%edi
mov    $0x20,%esi
call   1040 <pow@plt>
mov    %rax,%r14
lea    -0x1(%rbx),%rdx
lea    0xe85(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdx
shr    $0x3f,%rdx
add    %rbx,%rdx
sar    %rdx
mov    %edx,%esi
neg    %esi
add    $0xffffffffffffffff,%rdx
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
movswl %r15w,%ebx
lea    -0x1(%rbx),%eax
movslq %eax,%rdx
lea    0xe7a(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movzwl %bx,%eax
shr    $0xf,%eax
add    %r15d,%eax
cwtl
sar    %eax
mov    %eax,%esi
neg    %esi
add    $0xffffffff,%eax
movslq %eax,%rdx
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%r12
lea    0xe81(%rip),%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1030 <printf@plt>
mov    %r14,%rsi
shr    $0x3f,%rsi
add    %r14,%rsi
sar    %rsi
mov    $0x1,%edx
sub    %rsi,%rdx
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Unsigned Char: %d a %d\0A\00"
@.str.1 = [22 x i8] c"Signed Char: %d a %d\0A\00"
@.str.2 = [30 x i8] c"Unsigned Short Int: %d a %hi\0A\00"
@.str.3 = [29 x i8] c"Signed Short Int: %hi a %hi\0A\00"
@.str.4 = [29 x i8] c"Unsigned Long Int: %d a %lu\0A\00"
@.str.5 = [28 x i8] c"Signed Long Int: %li a %li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
store i64 2, i64* %2
store i64 0, i64* %3
%8 = load i64, i64* %2
%9 = call i8* @pow(i64 %8, i32 8)
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %4
%11 = load i64, i64* %2
%12 = call i8* @pow(i64 %11, i32 16)
%13 = ptrtoint i8* %12 to i16
store i16 %13, i16* %5
%14 = load i64, i64* %2
%15 = call i8* @pow(i64 %14, i32 32)
%16 = ptrtoint i8* %15 to i64
store i64 %16, i64* %6
%17 = load i64, i64* %2
%18 = call i8* @pow(i64 %17, i32 32)
%19 = ptrtoint i8* %18 to i64
store i64 %19, i64* %7
%20 = load i64, i64* %3
%21 = trunc i64 %20 to i32
%22 = load i64, i64* %4
%23 = sub nsw i64 %22, 1
%24 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %21, i64 %23)
%25 = load i64, i64* %4
%26 = sdiv i64 %25, 2
%27 = sub nsw i64 0, %26
%28 = trunc i64 %27 to i32
%29 = load i64, i64* %4
%30 = sdiv i64 %29, 2
%31 = sub nsw i64 %30, 1
%32 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %28, i64 %31)
%33 = load i64, i64* %3
%34 = trunc i64 %33 to i32
%35 = load i16, i16* %5
%36 = sext i16 %35 to i32
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %34, i64 %38)
%40 = load i16, i16* %5
%41 = sext i16 %40 to i32
%42 = sdiv i32 %41, 2
%43 = sub nsw i32 0, %42
%44 = load i16, i16* %5
%45 = sext i16 %44 to i32
%46 = sdiv i32 %45, 2
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %43, i64 %48)
%50 = load i64, i64* %3
%51 = trunc i64 %50 to i32
%52 = load i64, i64* %6
%53 = sub i64 %52, 1
%54 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %51, i64 %53)
%55 = load i64, i64* %7
%56 = sdiv i64 %55, 2
%57 = sub nsw i64 0, %56
%58 = mul nsw i64 %57, -1
%59 = trunc i64 %58 to i32
%60 = load i64, i64* %7
%61 = sdiv i64 %60, 2
%62 = sub nsw i64 %61, 1
%63 = mul nsw i64 %62, -1
%64 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %59, i64 %63)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unsigned Char: %d a %d\0A\00"
@.str.1 = [22 x i8] c"Signed Char: %d a %d\0A\00"
@.str.2 = [30 x i8] c"Unsigned Short Int: %d a %hi\0A\00"
@.str.3 = [29 x i8] c"Signed Short Int: %hi a %hi\0A\00"
@.str.4 = [29 x i8] c"Unsigned Long Int: %d a %lu\0A\00"
@.str.5 = [28 x i8] c"Signed Long Int: %li a %li\0A\00"
define i32 @main() {
%1 = tail call i8* @pow(i64 2, i32 8)
%2 = ptrtoint i8* %1 to i64
%3 = tail call i8* @pow(i64 2, i32 16)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i8* @pow(i64 2, i32 32)
%7 = ptrtoint i8* %6 to i64
%8 = tail call i8* @pow(i64 2, i32 32)
%9 = ptrtoint i8* %8 to i64
%10 = add nsw i64 %2, -1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i64 %10)
%12 = sdiv i64 %2, 2
%13 = trunc i64 %12 to i32
%14 = sub i32 0, %13
%15 = add nsw i64 %12, -1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %14, i64 %15)
%17 = shl i32 %5, 16
%18 = ashr exact i32 %17, 16
%19 = add nsw i32 %18, -1
%20 = sext i32 %19 to i64
%21 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 0, i64 %20)
%22 = trunc i64 %4 to i16
%23 = sdiv i16 %22, 2
%24 = sext i16 %23 to i32
%25 = sub nsw i32 0, %24
%26 = add nsw i32 %24, -1
%27 = sext i32 %26 to i64
%28 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %25, i64 %27)
%29 = add i64 %7, -1
%30 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 0, i64 %29)
%31 = sdiv i64 %9, 2
%32 = trunc i64 %31 to i32
%33 = sub nsw i64 1, %31
%34 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i32 %32, i64 %33)
ret i32 0
}