#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 /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  n = sizeof(void *);
  int bit;
  if (n == 4) {
    bit = 32;
  } else {
    bit = 64;
  }
  char *endian;
  int num = 1;
  if (*(char *)&num == 1) {
    endian = "Little";
  } else {
    endian = "Big";
  }
  printf("Memory Dump (%d-bit %s Endian Machine)\n", bit, endian);
  printf("Address Words In Hexadecimal ASCII characters\n");
  printf("--------- -------- -------- -------- -------- ----------------\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x20,-0xc(%rbp)
jmp    1143 <main+0x33>
movl   $0x40,-0xc(%rbp)
movl   $0x1,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x1,%eax
jne    1167 <main+0x57>
lea    0xea2(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1172 <main+0x62>
lea    0xe99(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
lea    0xed1(%rip),%rdx
mov    $0x40,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Little\00"
@.str.1 = [4 x i8] c"Big\00"
@.str.2 = [40 x i8] c"Memory Dump (%d-bit %s Endian Machine)\0A\00"
@.str.3 = [47 x i8] c"Address Words In Hexadecimal ASCII characters\0A\00"
@.str.4 = [64 x i8] c"--------- -------- -------- -------- -------- ----------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
store i32 8, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 32, i32* %3
br label %10
9: ; preds = %0
store i32 64, i32* %3
br label %10
10: ; preds = %9, %8
store i32 1, i32* %5
%11 = bitcast i32* %5 to i8*
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %10
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
br label %17
16: ; preds = %10
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
%19 = load i8*, i8** %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %18, i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"Little\00"
@.str.2 = [40 x i8] c"Memory Dump (%d-bit %s Endian Machine)\0A\00"
@str = [46 x i8] c"Address Words In Hexadecimal ASCII characters\00"
@str.5 = [63 x i8] c"--------- -------- -------- -------- -------- ----------------\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}