#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*/ getchar();
scalar_t__ is_litter_endian();
int mask_lsb(int, int);
int mask_msb(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int test_hex_0 = 0x89ABCDEF;
  int test_hex_1 = 0X76543210;
  int result = mask_lsb(test_hex_0, test_hex_1);
  (is_litter_endian()) && (result = mask_msb(test_hex_0, test_hex_1));
  printf("%X\n", result);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x89abcdef,-0x8(%rbp)
movl   $0x76543210,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <mask_lsb@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <is_litter_endian@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     11ab <main+0x5b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mask_msb@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x89abcdef,%edi
mov    $0x76543210,%esi
call   1060 <mask_lsb@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <is_litter_endian@plt>
test   %rax,%rax
je     117f <main+0x2f>
mov    $0x89abcdef,%edi
mov    $0x76543210,%esi
call   1030 <mask_msb@plt>
mov    %eax,%ebx
lea    0xe7a(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -1985229329, i32* %2
store i32 1985229328, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @mask_lsb(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = call i64 (...) @is_litter_endian()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @mask_msb(i32 %11, i32 %12)
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %0
%16 = phi i1 [ false, %0 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%X\0A\00"
define i32 @main() {
%1 = tail call i32 @mask_lsb(i32 -1985229329, i32 1985229328)
%2 = tail call i64 (...) @is_litter_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @mask_msb(i32 -1985229329, i32 1985229328)
br label %6
6: ; preds = %4, %0
%7 = phi i32 [ %5, %4 ], [ %1, %0 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @getchar()
ret i32 0
}