#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*/ printf(char *, char *, unsigned long, ...);
int main(void) {
  struct {
    char *type;
    char len;
  } t[4] = {{"char", sizeof(char)},
            {"short", sizeof(short)},
            {"int", sizeof(int)},
            {"long", sizeof(long)}};
  int i;
  for (i = 0; i < 4; i++) {
    printf("%s : %d -> %d\n", t[i].type, -(1 << (t[i].len * 7)),
           (1 << (t[i].len * 7)) - 1);
    printf("unsigned %s : 0 -> %u\n", t[i].type,
           (((unsigned long)(-1)) >> (1 << 31) - (t[i].len * 8)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2ca6(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x4,-0x54(%rbp)
jge    1216 <main+0xf6>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsbl 0x8(%rax),%eax
imul   $0x7,%eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
movslq %eax,%rdx
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsbl 0x8(%rax),%eax
imul   $0x7,%eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
sub    $0x1,%ecx
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movsbl 0x8(%rax),%ecx
shl    $0x3,%ecx
mov    $0x80000000,%eax
sub    %ecx,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rdx
shr    %cl,%rdx
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xef8(%rip),%r14
lea    0xedd(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xffffffffffffff80,%rdx
mov    $0x7f,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeac(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xffffffffffffc000,%rdx
mov    $0x3fff,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe83(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xfffffffff0000000,%rdx
mov    $0xfffffff,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe58(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i8 }
@.str = [5 x i8] c"char\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"long\00"
@__const.main.t = [4 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 1 }, %struct.anon { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8 2 }, %struct.anon { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8 4 }, %struct.anon { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8 8 }]
@.str.4 = [15 x i8] c"%s : %d -> %d\0A\00"
@.str.5 = [23 x i8] c"unsigned %s : 0 -> %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x %struct.anon]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x %struct.anon]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %50, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %53
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x %struct.anon], [4 x %struct.anon]* %2, i64 0, i64 %10
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%13 = load i8*, i8** %12
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x %struct.anon], [4 x %struct.anon]* %2, i64 0, i64 %15
%17 = getelementptr inbounds %struct.anon, %struct.anon* %16, i32 0, i32 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = mul nsw i32 %19, 7
%21 = shl i32 1, %20
%22 = sub nsw i32 0, %21
%23 = sext i32 %22 to i64
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x %struct.anon], [4 x %struct.anon]* %2, i64 0, i64 %25
%27 = getelementptr inbounds %struct.anon, %struct.anon* %26, i32 0, i32 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = mul nsw i32 %29, 7
%31 = shl i32 1, %30
%32 = sub nsw i32 %31, 1
%33 = call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %13, i64 %23, i32 %32)
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4 x %struct.anon], [4 x %struct.anon]* %2, i64 0, i64 %35
%37 = getelementptr inbounds %struct.anon, %struct.anon* %36, i32 0, i32 0
%38 = load i8*, i8** %37
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [4 x %struct.anon], [4 x %struct.anon]* %2, i64 0, i64 %40
%42 = getelementptr inbounds %struct.anon, %struct.anon* %41, i32 0, i32 1
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = mul nsw i32 %44, 8
%46 = sub nsw i32 -2147483648, %45
%47 = zext i32 %46 to i64
%48 = lshr i64 -1, %47
%49 = call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %38, i64 %48)
br label %50
50: ; preds = %8
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %5
53: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"char\00"
@.str.1 = [6 x i8] c"short\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [5 x i8] c"long\00"
@.str.4 = [15 x i8] c"%s : %d -> %d\0A\00"
@.str.5 = [23 x i8] c"unsigned %s : 0 -> %u\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 -128, i32 127)
%2 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 0)
%3 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 -16384, i32 16383)
%4 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 0)
%5 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 -268435456, i32 268435455)
%6 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 0)
%7 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 poison, i32 poison)
%8 = tail call i32 (i8*, i8*, i64, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 0)
ret i32 0
}