#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 *);
void gen_byteorder(void) {
  union {
    unsigned char c[4];
    unsigned int ui;
  } u4;
  u4.ui = 0xAABBCCDD;
  if (u4.c[0] == 0xAA && u4.c[1] == 0xBB && u4.c[2] == 0xCC && u4.c[3] == 0xDD)
    printf("#define HH_MOST_SIGNIFICANT_BYTE_FIRST\n");
  else if (u4.c[0] == 0xDD && u4.c[1] == 0xCC && u4.c[2] == 0xBB &&
           u4.c[3] == 0xAA)
    printf("#define HH_LEAST_SIGNIFICANT_BYTE_FIRST\n");
  else
    printf(";; Unrecognized byte order.\n");
}


x86 assembly (clang, -O0):
<gen_byteorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xaabbccdd,-0x8(%rbp)
movzbl -0x8(%rbp),%eax
cmp    $0xaa,%eax
jne    116c <gen_byteorder+0x5c>
movzbl -0x7(%rbp),%eax
cmp    $0xbb,%eax
jne    116c <gen_byteorder+0x5c>
movzbl -0x6(%rbp),%eax
cmp    $0xcc,%eax
jne    116c <gen_byteorder+0x5c>
movzbl -0x5(%rbp),%eax
cmp    $0xdd,%eax
jne    116c <gen_byteorder+0x5c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <gen_byteorder+0xba>
movzbl -0x8(%rbp),%eax
cmp    $0xdd,%eax
jne    11b9 <gen_byteorder+0xa9>
movzbl -0x7(%rbp),%eax
cmp    $0xcc,%eax
jne    11b9 <gen_byteorder+0xa9>
movzbl -0x6(%rbp),%eax
cmp    $0xbb,%eax
jne    11b9 <gen_byteorder+0xa9>
movzbl -0x5(%rbp),%eax
cmp    $0xaa,%eax
jne    11b9 <gen_byteorder+0xa9>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    11c5 <gen_byteorder+0xb5>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <gen_byteorder+0xba>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_byteorder>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [40 x i8] c"#define HH_MOST_SIGNIFICANT_BYTE_FIRST\0A\00"
@.str.1 = [41 x i8] c"#define HH_LEAST_SIGNIFICANT_BYTE_FIRST\0A\00"
@.str.2 = [29 x i8] c";; Unrecognized byte order.\0A\00"
define void @gen_byteorder() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 -1430532899, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 170
br i1 %7, label %8, label %28
8: ; preds = %0
%9 = bitcast %union.anon* %1 to [4 x i8]*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 187
br i1 %13, label %14, label %28
14: ; preds = %8
%15 = bitcast %union.anon* %1 to [4 x i8]*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 204
br i1 %19, label %20, label %28
20: ; preds = %14
%21 = bitcast %union.anon* %1 to [4 x i8]*
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp eq i32 %24, 221
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %57
28: ; preds = %20, %14, %8, %0
%29 = bitcast %union.anon* %1 to [4 x i8]*
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %29, i64 0, i64 0
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 221
br i1 %33, label %34, label %54
34: ; preds = %28
%35 = bitcast %union.anon* %1 to [4 x i8]*
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %35, i64 0, i64 1
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = icmp eq i32 %38, 204
br i1 %39, label %40, label %54
40: ; preds = %34
%41 = bitcast %union.anon* %1 to [4 x i8]*
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %41, i64 0, i64 2
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = icmp eq i32 %44, 187
br i1 %45, label %46, label %54
46: ; preds = %40
%47 = bitcast %union.anon* %1 to [4 x i8]*
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %47, i64 0, i64 3
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = icmp eq i32 %50, 170
br i1 %51, label %52, label %54
52: ; preds = %46
%53 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %56
54: ; preds = %46, %40, %34, %28
%55 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %54, %52
br label %57
57: ; preds = %56, %26
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"#define HH_LEAST_SIGNIFICANT_BYTE_FIRST\00"
define void @gen_byteorder() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}