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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3c0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
shl    $0x8,%edi
call   1040 <displayBits@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <displayBits@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
shr    $0x8,%edi
call   1040 <displayBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c0,%edi
call   1050 <displayBits@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c000,%edi
call   1050 <displayBits@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3c0,%edi
call   1050 <displayBits@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1050 <displayBits@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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