#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 SCHAR_MAX;
int SCHAR_MIN;
int UCHAR_MAX;
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  printf("Unsigned char max: %d\n", UCHAR_MAX);
  printf("Signed char max: %d\n", SCHAR_MAX);
  printf("Signed char min: %d\n", SCHAR_MIN);
  unsigned int i = ~0;
  printf("Unsigned int max: %u\n", i);
  printf("Signed int max: %d\n", i / 2);
  printf("Signed int min: %d\n", -(i / 2) - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
shr    $0x1,%esi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    %esi,%esi
sub    %eax,%esi
sub    $0x1,%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x7fffffff,%esi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x80000000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Unsigned char max: %d\0A\00"
@UCHAR_MAX = global i32 0
@.str.1 = [21 x i8] c"Signed char max: %d\0A\00"
@SCHAR_MAX = global i32 0
@.str.2 = [21 x i8] c"Signed char min: %d\0A\00"
@SCHAR_MIN = global i32 0
@.str.3 = [22 x i8] c"Unsigned int max: %u\0A\00"
@.str.4 = [20 x i8] c"Signed int max: %d\0A\00"
@.str.5 = [20 x i8] c"Signed int min: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @UCHAR_MAX
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @SCHAR_MAX
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @SCHAR_MIN
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %6)
store i32 -1, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = udiv i32 %10, 2
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
%14 = udiv i32 %13, 2
%15 = sub i32 0, %14
%16 = sub i32 %15, 1
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Unsigned char max: %d\0A\00"
@UCHAR_MAX = global i32 0
@.str.1 = [21 x i8] c"Signed char max: %d\0A\00"
@SCHAR_MAX = global i32 0
@.str.2 = [21 x i8] c"Signed char min: %d\0A\00"
@SCHAR_MIN = global i32 0
@.str.3 = [22 x i8] c"Unsigned int max: %u\0A\00"
@.str.4 = [20 x i8] c"Signed int max: %d\0A\00"
@.str.5 = [20 x i8] c"Signed int min: %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @UCHAR_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @SCHAR_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @SCHAR_MIN
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 2147483647)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 -2147483648)
ret i32 0
}