#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(unsigned int);
int /*<<< orphan*/ puts(char *);
void fig10_13() {
  unsigned int number1 = 960;
  puts("\nThe result of left shifting");
  displayBits(number1);
  puts("8 bit positions using the left shift operator << is");
  displayBits(number1 << 8);
  puts("\nThe result of right shifting");
  displayBits(number1);
  puts("8 bit positions using the right shift operator >> is");
  displayBits(number1 >> 8);
}


x86 assembly (clang, -O0):
<fig10_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3c0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
call   1040 <displayBits@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
call   1040 <displayBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig10_13>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c0,%edi
call   1040 <displayBits@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c000,%edi
call   1040 <displayBits@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c0,%edi
call   1040 <displayBits@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
pop    %rax
jmp    1040 <displayBits@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0AThe result of left shifting\00"
@.str.1 = [52 x i8] c"8 bit positions using the left shift operator << is\00"
@.str.2 = [30 x i8] c"\0AThe result of right shifting\00"
@.str.3 = [53 x i8] c"8 bit positions using the right shift operator >> is\00"
define void @fig10_13() {
%1 = alloca i32
store i32 960, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = call i32 @displayBits(i32 %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = shl i32 %6, 8
%8 = call i32 @displayBits(i32 %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = call i32 @displayBits(i32 %10)
%12 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* %1
%14 = lshr i32 %13, 8
%15 = call i32 @displayBits(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0AThe result of left shifting\00"
@.str.1 = [52 x i8] c"8 bit positions using the left shift operator << is\00"
@.str.2 = [30 x i8] c"\0AThe result of right shifting\00"
@.str.3 = [53 x i8] c"8 bit positions using the right shift operator >> is\00"
define void @fig10_13() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @displayBits(i32 960)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @displayBits(i32 245760)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @displayBits(i32 960)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @displayBits(i32 3)
ret void
}