#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 *, long);
int main(void) {
  long s17, bit;
  int i, a, y;
  s17 = 0x8988;
  for (i = 0; i < 260; i++) {
    bit = (s17 & 0x200) >> 7;
    bit ^= (s17 & 2);
    if (bit)
      bit = 0x10000;
    s17 |= bit;
    s17 >>= 1;
    printf("%X\t", s17);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x8988,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x104,-0x1c(%rbp)
jge    11a6 <main+0x96>
mov    -0x10(%rbp),%rax
and    $0x200,%rax
sar    $0x7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x2,%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <main+0x60>
movq   $0x10000,-0x18(%rbp)
mov    -0x18(%rbp),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x8988,%eax
mov    $0x104,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rcx
shr    $0x7,%rcx
and    $0x4,%ecx
mov    %eax,%edx
and    $0x2,%edx
xor    %ebx,%ebx
or     %rcx,%rdx
setne  %bl
shl    $0x10,%rbx
or     %rax,%rbx
sar    %rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%X\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i64 35208, i64* %2
store i32 0, i32* %4
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 260
br i1 %9, label %10, label %32
10: ; preds = %7
%11 = load i64, i64* %2
%12 = and i64 %11, 512
%13 = ashr i64 %12, 7
store i64 %13, i64* %3
%14 = load i64, i64* %2
%15 = and i64 %14, 2
%16 = load i64, i64* %3
%17 = xor i64 %16, %15
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %10
store i64 65536, i64* %3
br label %21
21: ; preds = %20, %10
%22 = load i64, i64* %3
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = ashr i64 %25, 1
store i64 %26, i64* %2
%27 = load i64, i64* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %27)
br label %29
29: ; preds = %21
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %7
32: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%X\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 35208, %0 ], [ %11, %1 ]
%3 = phi i32 [ 0, %0 ], [ %13, %1 ]
%4 = lshr i64 %2, 7
%5 = and i64 %4, 4
%6 = and i64 %2, 2
%7 = or i64 %5, %6
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i64 0, i64 65536
%10 = or i64 %9, %2
%11 = ashr i64 %10, 1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = add nuw nsw i32 %3, 1
%14 = icmp eq i32 %13, 260
br i1 %14, label %15, label %1
15: ; preds = %1
ret i32 0
}