#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*/ puts(char *);
int main() {
  unsigned int u1;
  char *c;
  double d1;
  float *f1;
  c = (char *)&u1;
  u1 = 0x0F;
  if (c[0] == 0x0F)
    puts("#define HOST_LITTLE_ENDIAN\n");
  else
    puts("#define HOST_BIG_ENDIAN\n");
  d1 = 1.0;
  f1 = (float *)&d1;
  if (*((int *)f1) != 0x3ff00000)
    puts("#define HOST_LITTLE_ENDIAN_FLOAT\n");
  else
    puts("#define HOST_BIG_ENDIAN_FLOAT\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0xf,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xf,%eax
jne    114f <main+0x3f>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
jmp    115b <main+0x4b>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x3ff00000,(%rax)
je     1191 <main+0x81>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
jmp    119d <main+0x8d>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"#define HOST_LITTLE_ENDIAN\0A\00"
@.str.1 = [25 x i8] c"#define HOST_BIG_ENDIAN\0A\00"
@.str.2 = [34 x i8] c"#define HOST_LITTLE_ENDIAN_FLOAT\0A\00"
@.str.3 = [31 x i8] c"#define HOST_BIG_ENDIAN_FLOAT\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca double
%5 = alloca float*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %3
store i32 15, i32* %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 15
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
store double 1.000000e+00, double* %4
%17 = bitcast double* %4 to float*
store float* %17, float** %5
%18 = load float*, float** %5
%19 = bitcast float* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 1072693248
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %26
24: ; preds = %16
%25 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"#define HOST_LITTLE_ENDIAN\0A\00"
@.str.2 = [34 x i8] c"#define HOST_LITTLE_ENDIAN_FLOAT\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}