#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 EXIT_SUCCESS;
int /*<<< orphan*/ check_stack_growth(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("sizeof(char)                %zu\n", sizeof(char));
  printf("sizeof(unsigned char)       %zu\n", sizeof(unsigned char));
  printf("sizeof(short)               %zu\n", sizeof(short));
  printf("sizeof(unsigned short)      %zu\n", sizeof(unsigned short));
  printf("sizeof(int)                 %zu\n", sizeof(int));
  printf("sizeof(unsigned int)        %zu\n", sizeof(unsigned int));
  printf("sizeof(long)                %zu\n", sizeof(long));
  printf("sizeof(unsigned long)       %zu\n", sizeof(unsigned long));
  printf("sizeof(long long)           %zu\n", sizeof(long long));
  printf("sizeof(unsigned long long)  %zu\n", sizeof(unsigned long long));
  printf("sizeof(float)               %zu\n", sizeof(float));
  printf("sizeof(double)              %zu\n", sizeof(double));
  printf("\n");
  unsigned int a = 0x12345678;
  unsigned char *p = (unsigned char *)&a;
  if (*p == 0x78)
    printf("Endianess is little endian\n");
  else
    printf("Endianess is big endian\n");
  check_stack_growth(NULL);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2c(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf56(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf64(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x78,%eax
jne    1253 <main+0x133>
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1261 <main+0x141>
lea    0xf4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <check_stack_growth@plt>
mov    0x2d6f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf1a(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf28(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf36(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf44(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf56(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <check_stack_growth@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"sizeof(char) %zu\0A\00"
@.str.1 = [33 x i8] c"sizeof(unsigned char) %zu\0A\00"
@.str.2 = [33 x i8] c"sizeof(short) %zu\0A\00"
@.str.3 = [33 x i8] c"sizeof(unsigned short) %zu\0A\00"
@.str.4 = [33 x i8] c"sizeof(int) %zu\0A\00"
@.str.5 = [33 x i8] c"sizeof(unsigned int) %zu\0A\00"
@.str.6 = [33 x i8] c"sizeof(long) %zu\0A\00"
@.str.7 = [33 x i8] c"sizeof(unsigned long) %zu\0A\00"
@.str.8 = [33 x i8] c"sizeof(long long) %zu\0A\00"
@.str.9 = [33 x i8] c"sizeof(unsigned long long) %zu\0A\00"
@.str.10 = [33 x i8] c"sizeof(float) %zu\0A\00"
@.str.11 = [33 x i8] c"sizeof(double) %zu\0A\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [28 x i8] c"Endianess is little endian\0A\00"
@.str.14 = [25 x i8] c"Endianess is big endian\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 1)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64 2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i64 4)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i64 4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i64 8)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 8)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i64 8)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i64 8)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i64 4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i64 8)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32 305419896, i32* %2
%17 = bitcast i32* %2 to i8*
store i8* %17, i8** %3
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 120
br i1 %21, label %22, label %24
22: ; preds = %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
br label %26
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
%27 = call i32 @check_stack_growth(i32* null)
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@.str = [33 x i8] c"sizeof(char) %zu\0A\00"
@.str.1 = [33 x i8] c"sizeof(unsigned char) %zu\0A\00"
@.str.2 = [33 x i8] c"sizeof(short) %zu\0A\00"
@.str.3 = [33 x i8] c"sizeof(unsigned short) %zu\0A\00"
@.str.4 = [33 x i8] c"sizeof(int) %zu\0A\00"
@.str.5 = [33 x i8] c"sizeof(unsigned int) %zu\0A\00"
@.str.6 = [33 x i8] c"sizeof(long) %zu\0A\00"
@.str.7 = [33 x i8] c"sizeof(unsigned long) %zu\0A\00"
@.str.8 = [33 x i8] c"sizeof(long long) %zu\0A\00"
@.str.9 = [33 x i8] c"sizeof(unsigned long long) %zu\0A\00"
@.str.10 = [33 x i8] c"sizeof(float) %zu\0A\00"
@.str.11 = [33 x i8] c"sizeof(double) %zu\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [27 x i8] c"Endianess is little endian\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i64 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i64 4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i64 8)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 8)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i64 8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i64 8)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i64 4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0), i64 8)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @check_stack_growth(i32* null)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}