#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, unsigned int);
int main() {
  int a = 0xfafa;
  unsigned int b = 0xfafa;
  printf("0x%x, %d\n", a, a);
  printf("0x%x, %u\n", b, b);
  printf("0x%x, %d\n", a >> 8, a >> 8);
  printf("0x%x, %d\n", b >> 8, b >> 8);
  a = 0xfffffafa;
  b = 0xfffffafa;
  printf("0x%x, %d\n", a, a);
  printf("0x%x, %u\n", b, b);
  printf("0x%x, %d\n", a >> 8, a >> 8);
  printf("0x%x, %u\n", b >> 8, b >> 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfafa,-0x8(%rbp)
movl   $0xfafa,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    -0x8(%rbp),%edx
sar    $0x8,%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shr    $0x8,%esi
mov    -0xc(%rbp),%edx
shr    $0x8,%edx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffafa,-0x8(%rbp)
movl   $0xfffffafa,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    -0x8(%rbp),%edx
sar    $0x8,%edx
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
shr    $0x8,%esi
mov    -0xc(%rbp),%edx
shr    $0x8,%edx
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfafa,%esi
mov    $0xfafa,%edx
call   1030 <printf@plt>
lea    0xed6(%rip),%r14
mov    %r14,%rdi
mov    $0xfafa,%esi
mov    $0xfafa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
mov    $0xfa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
mov    $0xfa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffafa,%esi
mov    $0xfffffafa,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xfffffafa,%esi
mov    $0xfffffafa,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffa,%esi
mov    $0xfffffffa,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xfffffa,%esi
mov    $0xfffffa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"0x%x, %d\0A\00"
@.str.1 = [10 x i8] c"0x%x, %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 64250, i32* %2
store i32 64250, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 8
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13)
%15 = load i32, i32* %3
%16 = lshr i32 %15, 8
%17 = load i32, i32* %3
%18 = lshr i32 %17, 8
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18)
store i32 -1286, i32* %2
store i32 -1286, i32* %3
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %24)
%26 = load i32, i32* %2
%27 = ashr i32 %26, 8
%28 = load i32, i32* %2
%29 = ashr i32 %28, 8
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %29)
%31 = load i32, i32* %3
%32 = lshr i32 %31, 8
%33 = load i32, i32* %3
%34 = lshr i32 %33, 8
%35 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"0x%x, %d\0A\00"
@.str.1 = [10 x i8] c"0x%x, %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 64250, i32 64250)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 64250, i32 64250)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 250, i32 250)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 250, i32 250)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -1286, i32 -1286)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 -1286, i32 -1286)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -6, i32 -6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 16777210, i32 16777210)
ret i32 0
}