#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 SHRT_MAX;
int SHRT_MIN;
int UINT_MAX;
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  printf("On this machine an int takes up %lu bytes\n", sizeof(int));
  printf("And ints can store values from %i to %i\n", 0, UINT_MAX);
  printf("And shorts can store values from %i to %i\n", SHRT_MIN, SHRT_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
lea    0xef0(%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    0xee8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
lea    0xef7(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
lea    0xefe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"On this machine an int takes up %lu bytes\0A\00"
@.str.1 = [41 x i8] c"And ints can store values from %i to %i\0A\00"
@UINT_MAX = global i32 0
@.str.2 = [43 x i8] c"And shorts can store values from %i to %i\0A\00"
@SHRT_MIN = global i32 0
@SHRT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = load i32, i32* @UINT_MAX
%4 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %3)
%5 = load i32, i32* @SHRT_MIN
%6 = load i32, i32* @SHRT_MAX
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"On this machine an int takes up %lu bytes\0A\00"
@.str.1 = [41 x i8] c"And ints can store values from %i to %i\0A\00"
@UINT_MAX = global i32 0
@.str.2 = [43 x i8] c"And shorts can store values from %i to %i\0A\00"
@SHRT_MIN = global i32 0
@SHRT_MAX = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = load i32, i32* @UINT_MAX
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %2)
%4 = load i32, i32* @SHRT_MIN
%5 = load i32, i32* @SHRT_MAX
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}