#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);
int main(void) {
  int i = 0X78563412;
  printf("%#X\n", (char)i);
  printf("%#X\n", (char)(i >> 8));
  printf("%#X\n", (char)(i >> 16));
  printf("%#X\n", (char)(i >> 24));
  int a = 0X12;
  int b = 0X34;
  int c = 0X56;
  int d = 0X78;
  int j = (d << 24) | (c << 16) | (b << 8) | a;
  printf("%#X\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x78563412,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
movsbl %al,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
movsbl %al,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sar    $0x18,%eax
movsbl %al,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x12,-0xc(%rbp)
movl   $0x34,-0x10(%rbp)
movl   $0x56,-0x14(%rbp)
movl   $0x78,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x18,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x56,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x78563412,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%#X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 2018915346, i32* %2
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = sext i8 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i8
%15 = sext i8 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %2
%18 = ashr i32 %17, 16
%19 = trunc i32 %18 to i8
%20 = sext i8 %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = ashr i32 %22, 24
%24 = trunc i32 %23 to i8
%25 = sext i8 %24 to i32
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
store i32 18, i32* %3
store i32 52, i32* %4
store i32 86, i32* %5
store i32 120, i32* %6
%27 = load i32, i32* %6
%28 = shl i32 %27, 24
%29 = load i32, i32* %5
%30 = shl i32 %29, 16
%31 = or i32 %28, %30
%32 = load i32, i32* %4
%33 = shl i32 %32, 8
%34 = or i32 %31, %33
%35 = load i32, i32* %3
%36 = or i32 %34, %35
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%#X\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 18)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 52)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 86)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 120)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2018915346)
ret i32 0
}