#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 */
scalar_t__ epr_is_big_endian_order();
scalar_t__ epr_is_little_endian_order();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (epr_is_little_endian_order()) {
    printf("LE\n");
  } else if (epr_is_big_endian_order()) {
    printf("BE\n");
  } else {
    printf("?\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <epr_is_little_endian_order@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    119b <main+0x6b>
mov    $0x0,%al
call   1050 <epr_is_big_endian_order@plt>
cmp    $0x0,%rax
je     118a <main+0x5a>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
jmp    1196 <main+0x66>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
jmp    119b <main+0x6b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <epr_is_little_endian_order@plt>
test   %rax,%rax
je     1146 <main+0x16>
lea    0xec1(%rip),%rdi
jmp    1162 <main+0x32>
xor    %eax,%eax
call   1050 <epr_is_big_endian_order@plt>
test   %rax,%rax
lea    0xea9(%rip),%rax
lea    0xea4(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"LE\0A\00"
@.str.1 = [4 x i8] c"BE\0A\00"
@.str.2 = [3 x i8] c"?\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @epr_is_little_endian_order()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %18
10: ; preds = %2
%11 = call i64 (...) @epr_is_big_endian_order()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %18
18: ; preds = %17, %8
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"?\00"
@str.3 = [3 x i8] c"BE\00"
@str.4 = [3 x i8] c"LE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @epr_is_little_endian_order()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 (...) @epr_is_big_endian_order()
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0)
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), %2 ], [ %8, %5 ]
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}