#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 seq_num = 0;
  seq_num = 0x87654321;
  printf("\n%x", seq_num);
  seq_num =
      ((seq_num & 0xF) << 28) | (((seq_num & 0xF0) >> 4) << 24) |
      (((seq_num & 0xF00) >> 8) << 20) | (((seq_num & 0xF000) >> 12) << 16) |
      (((seq_num & 0xF0000) >> 16) << 12) |
      (((seq_num & 0xF00000) >> 20) << 8) |
      (((seq_num & 0xF000000) >> 24) << 4) | ((seq_num & 0xF0000000) >> 28);
  printf("\n%x", seq_num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x87654321,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
shl    $0x1c,%eax
mov    -0x8(%rbp),%ecx
and    $0xf0,%ecx
shr    $0x4,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf00,%ecx
shr    $0x8,%ecx
shl    $0x14,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf000,%ecx
shr    $0xc,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf0000,%ecx
shr    $0x10,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf00000,%ecx
shr    $0x14,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf000000,%ecx
shr    $0x18,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xf0000000,%ecx
shr    $0x1c,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 -2023406815, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = and i32 %5, 15
%7 = shl i32 %6, 28
%8 = load i32, i32* %2
%9 = and i32 %8, 240
%10 = lshr i32 %9, 4
%11 = shl i32 %10, 24
%12 = or i32 %7, %11
%13 = load i32, i32* %2
%14 = and i32 %13, 3840
%15 = lshr i32 %14, 8
%16 = shl i32 %15, 20
%17 = or i32 %12, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 61440
%20 = lshr i32 %19, 12
%21 = shl i32 %20, 16
%22 = or i32 %17, %21
%23 = load i32, i32* %2
%24 = and i32 %23, 983040
%25 = lshr i32 %24, 16
%26 = shl i32 %25, 12
%27 = or i32 %22, %26
%28 = load i32, i32* %2
%29 = and i32 %28, 15728640
%30 = lshr i32 %29, 20
%31 = shl i32 %30, 8
%32 = or i32 %27, %31
%33 = load i32, i32* %2
%34 = and i32 %33, 251658240
%35 = lshr i32 %34, 24
%36 = shl i32 %35, 4
%37 = or i32 %32, %36
%38 = load i32, i32* %2
%39 = and i32 %38, -268435456
%40 = lshr i32 %39, 28
%41 = or i32 %37, %40
store i32 %41, i32* %2
%42 = load i32, i32* %2
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%x\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -2023406815)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 305419896)
ret i32 0
}