#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 CHAR_MAX;
int CHAR_MIN;
int UCHAR_MAX;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int an_int;
  unsigned int an_unsigned_int;
  an_int = an_unsigned_int = 0x0;
  printf("\nThese are the ranges for this computer:\n\n");
  printf("max for char is: %d\n", CHAR_MAX);
  printf("min for char is: %d\n", CHAR_MIN);
  printf("max for unsigned char is: %u\n\n", UCHAR_MAX);
  an_int = 0b01111111111111111111111111111111;
  printf("max for int is: %d\n", an_int);
  an_int = 0b10000000000000000000000000000000;
  printf("min for int is: %d\n", an_int);
  an_unsigned_int = 0b11111111111111111111111111111111;
  printf("max for unsigned int is: %u\n", an_unsigned_int);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf66(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x7fffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x80000000,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0AThese are the ranges for this computer:\0A\0A\00"
@.str.1 = [21 x i8] c"max for char is: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.2 = [21 x i8] c"min for char is: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.3 = [31 x i8] c"max for unsigned char is: %u\0A\0A\00"
@UCHAR_MAX = global i32 0
@.str.4 = [20 x i8] c"max for int is: %d\0A\00"
@.str.5 = [20 x i8] c"min for int is: %d\0A\00"
@.str.6 = [29 x i8] c"max for unsigned int is: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @CHAR_MAX
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @CHAR_MIN
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @UCHAR_MAX
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %9)
store i32 2147483647, i32* %2
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %11)
store i32 -2147483648, i32* %2
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %13)
store i32 -1, i32* %3
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"max for char is: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.2 = [21 x i8] c"min for char is: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.3 = [31 x i8] c"max for unsigned char is: %u\0A\0A\00"
@UCHAR_MAX = global i32 0
@.str.4 = [20 x i8] c"max for int is: %d\0A\00"
@.str.5 = [20 x i8] c"min for int is: %d\0A\00"
@.str.6 = [29 x i8] c"max for unsigned int is: %u\0A\00"
@str = [42 x i8] c"\0AThese are the ranges for this computer:\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @CHAR_MAX
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @CHAR_MIN
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @UCHAR_MAX
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 2147483647)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 -2147483648)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 -1)
ret i32 0
}