#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 *, unsigned int);
int main() {
  unsigned int x = 0xAABBCCDD;
  unsigned int d = x & 0xff;
  unsigned int c = (x & 0xff00) >> 8;
  unsigned int b = (x & 0xff0000) >> 16;
  unsigned int a = (x & 0xff000000) >> 24;
  printf("x = %x\n", x);
  printf("d = %x\n", d);
  printf("c = %x\n", c);
  printf("b = %x\n", b);
  printf("a = %x\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaabbccdd,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xaabbccdd,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xdd,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0xbb,%esi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0xaa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"x = %x\0A\00"
@.str.1 = [8 x i8] c"d = %x\0A\00"
@.str.2 = [8 x i8] c"c = %x\0A\00"
@.str.3 = [8 x i8] c"b = %x\0A\00"
@.str.4 = [8 x i8] c"a = %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 -1430532899, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = lshr i32 %10, 8
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 16711680
%14 = lshr i32 %13, 16
store i32 %14, i32* %5
%15 = load i32, i32* %2
%16 = and i32 %15, -16777216
%17 = lshr i32 %16, 24
store i32 %17, i32* %6
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %x\0A\00"
@.str.1 = [8 x i8] c"d = %x\0A\00"
@.str.2 = [8 x i8] c"c = %x\0A\00"
@.str.3 = [8 x i8] c"b = %x\0A\00"
@.str.4 = [8 x i8] c"a = %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 -1430532899)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 221)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 204)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 187)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 170)
ret i32 0
}