#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 */
unsigned int INT_MAX;
int INT_MIN;
unsigned int UINT_MAX;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
void range_int(void) {
  unsigned int max, umax;
  int min;
  int BITS = 32;
  min = INT_MIN;
  max = INT_MAX;
  umax = UINT_MAX;
  printf("limit.h: int\n");
  printf(" %19d\tmin\n%20d\tmax\n%20u\tumax\n", min, max, umax);
  min = ~0 << (BITS - 1);
  max = ~(~0 << (BITS - 1));
  umax = ~0;
  printf("bitshift: int\n");
  printf(" %19d\tmin\n%20d\tmax\n%20u\tumax\n", min, max, umax);
  puts("");
  return;
}


x86 assembly (clang, -O0):
<range_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x20,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2e9a(%rip),%rax
mov    (%rax),%r14d
mov    0x2ea0(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8f(%rip),%rax
mov    (%rax),%ebx
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9a(%rip),%r15
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
mov    $0x80000000,%esi
mov    $0x7fffffff,%edx
mov    $0xffffffff,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
@.str = [14 x i8] c"limit.h: int\0A\00"
@.str.1 = [30 x i8] c" %19d\09min\0A%20d\09max\0A%20u\09umax\0A\00"
@.str.2 = [15 x i8] c"bitshift: int\0A\00"
@.str.3 = [1 x i8] zeroinitializer
define void @range_int() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 32, i32* %4
%5 = load i32, i32* @INT_MIN
store i32 %5, i32* %3
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %1
%7 = load i32, i32* @UINT_MAX
store i32 %7, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = shl i32 -1, %14
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = shl i32 -1, %17
%19 = xor i32 %18, -1
store i32 %19, i32* %1
store i32 -1, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
%25 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
@.str.1 = [30 x i8] c" %19d\09min\0A%20d\09max\0A%20u\09umax\0A\00"
@str = [13 x i8] c"limit.h: int\00"
@str.4 = [14 x i8] c"bitshift: int\00"
define void @range_int() {
%1 = load i32, i32* @INT_MIN
%2 = load i32, i32* @INT_MAX
%3 = load i32, i32* @UINT_MAX
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648, i32 2147483647, i32 -1)
%8 = tail call i32 @putchar(i32 10)
ret void
}