#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*/ displayBits(char);
int /*<<< orphan*/ printf(char *, char, ...);
void unpackCharacters(unsigned packed) {
  unsigned temp = packed;
  unsigned mask = 255;
  mask <<= 24;
  char a, b, c, d;
  temp &= mask;
  temp >>= 24;
  a = temp;
  temp = packed;
  mask >>= 8;
  temp &= mask;
  temp >>= 16;
  b = temp;
  temp = packed;
  mask >>= 8;
  temp &= mask;
  temp >>= 8;
  c = temp;
  temp = packed;
  mask >>= 8;
  temp &= mask;
  d = temp;
  printf("a = %c\nb = %c\n", a, b);
  printf("c = %c\nd = %c\n", c, d);
  printf("%c = ", a);
  displayBits(a);
  printf("%c = ", b);
  displayBits(b);
  printf("%c = ", c);
  displayBits(c);
  printf("%c = ", d);
  displayBits(d);
}


x86 assembly (clang, -O0):
<unpackCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xf(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x10(%rbp)
mov    -0xd(%rbp),%al
movsbl -0xe(%rbp),%edx
lea    0xe2d(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xf(%rbp),%al
movsbl -0x10(%rbp),%edx
lea    0xe24(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe22(%rip),%rdi
movsbl -0xd(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xd(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xe07(%rip),%rdi
movsbl -0xe(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xe(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xdec(%rip),%rdi
movsbl -0xf(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0xf(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xdd1(%rip),%rdi
movsbl -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x10(%rbp),%edi
call   1040 <displayBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackCharacters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x10,%eax
mov    %edi,%r14d
shr    $0x8,%r14d
mov    %edi,%ebp
sar    $0x18,%ebp
lea    0xebb(%rip),%rdi
movsbl %al,%r15d
mov    %ebp,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl %r14b,%r13d
lea    0xeaf(%rip),%rdi
movsbl %bl,%r14d
mov    %r13d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea6(%rip),%r12
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <displayBits@plt>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15d,%edi
call   1040 <displayBits@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13d,%edi
call   1040 <displayBits@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <displayBits@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"a = %c\0Ab = %c\0A\00"
@.str.1 = [15 x i8] c"c = %c\0Ad = %c\0A\00"
@.str.2 = [6 x i8] c"%c = \00"
define void @unpackCharacters(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %2
%9 = load i32, i32* %2
store i32 %9, i32* %3
store i32 255, i32* %4
%10 = load i32, i32* %4
%11 = shl i32 %10, 24
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = and i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = lshr i32 %15, 24
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i32, i32* %2
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = lshr i32 %20, 8
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = and i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = lshr i32 %25, 16
store i32 %26, i32* %3
%27 = load i32, i32* %3
%28 = trunc i32 %27 to i8
store i8 %28, i8* %6
%29 = load i32, i32* %2
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = lshr i32 %30, 8
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = and i32 %33, %32
store i32 %34, i32* %3
%35 = load i32, i32* %3
%36 = lshr i32 %35, 8
store i32 %36, i32* %3
%37 = load i32, i32* %3
%38 = trunc i32 %37 to i8
store i8 %38, i8* %7
%39 = load i32, i32* %2
store i32 %39, i32* %3
%40 = load i32, i32* %4
%41 = lshr i32 %40, 8
store i32 %41, i32* %4
%42 = load i32, i32* %4
%43 = load i32, i32* %3
%44 = and i32 %43, %42
store i32 %44, i32* %3
%45 = load i32, i32* %3
%46 = trunc i32 %45 to i8
store i8 %46, i8* %8
%47 = load i8, i8* %5
%48 = load i8, i8* %6
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %47, i32 %49)
%51 = load i8, i8* %7
%52 = load i8, i8* %8
%53 = sext i8 %52 to i32
%54 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8 signext %51, i32 %53)
%55 = load i8, i8* %5
%56 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %55)
%57 = load i8, i8* %5
%58 = call i32 @displayBits(i8 signext %57)
%59 = load i8, i8* %6
%60 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %59)
%61 = load i8, i8* %6
%62 = call i32 @displayBits(i8 signext %61)
%63 = load i8, i8* %7
%64 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %63)
%65 = load i8, i8* %7
%66 = call i32 @displayBits(i8 signext %65)
%67 = load i8, i8* %8
%68 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %67)
%69 = load i8, i8* %8
%70 = call i32 @displayBits(i8 signext %69)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"a = %c\0Ab = %c\0A\00"
@.str.1 = [15 x i8] c"c = %c\0Ad = %c\0A\00"
@.str.2 = [6 x i8] c"%c = \00"
define void @unpackCharacters(i32 %0) {
%2 = lshr i32 %0, 24
%3 = trunc i32 %2 to i8
%4 = lshr i32 %0, 16
%5 = trunc i32 %4 to i8
%6 = lshr i32 %0, 8
%7 = trunc i32 %6 to i8
%8 = trunc i32 %0 to i8
%9 = shl i32 %4, 24
%10 = ashr exact i32 %9, 24
%11 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %3, i32 %10)
%12 = shl i32 %0, 24
%13 = ashr exact i32 %12, 24
%14 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8 signext %7, i32 %13)
%15 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %3)
%16 = tail call i32 @displayBits(i8 signext %3)
%17 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %5)
%18 = tail call i32 @displayBits(i8 signext %5)
%19 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %7)
%20 = tail call i32 @displayBits(i8 signext %7)
%21 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8 signext %8)
%22 = tail call i32 @displayBits(i8 signext %8)
ret void
}