#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 short, ...);
int main(int argc, const char *argv[]) {
  int x = 193;
  int y = x & 0xf0;
  printf("%d\n", y);
  printf("%d\n", x << 2);
  for (int i = 1; i <= 128;) {
    printf("%d\n", i);
    i = i << 1;
  }
  for (int i = 1; i <= 128;) {
    printf("%d\n", i);
    i |= (i << 1);
  }
  unsigned short test = 1;
  printf("~%d = %d\n", test, ~test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
lea    0xec4(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
lea    0xead(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x80,-0x1c(%rbp)
jg     1199 <main+0x89>
mov    -0x1c(%rbp),%eax
lea    0xe85(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116a <main+0x5a>
movl   $0x1,-0x20(%rbp)
cmpl   $0x80,-0x20(%rbp)
jg     11d2 <main+0xc2>
mov    -0x20(%rbp),%eax
lea    0xe4f(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11a0 <main+0x90>
movw   $0x1,-0x22(%rbp)
mov    -0x22(%rbp),%ax
movzwl -0x22(%rbp),%edx
xor    $0xffffffff,%edx
lea    0xe16(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeee(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc0,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x304,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1f,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3f,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7f,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xde2(%rip),%rdi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [10 x i8] c"~%d = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 193, i32* %6
%11 = load i32, i32* %6
%12 = and i32 %11, 240
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = trunc i32 %13 to i16
%15 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %14)
%16 = load i32, i32* %6
%17 = shl i32 %16, 2
%18 = trunc i32 %17 to i16
%19 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %18)
store i32 1, i32* %8
br label %20
20: ; preds = %23, %2
%21 = load i32, i32* %8
%22 = icmp sle i32 %21, 128
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %8
%25 = trunc i32 %24 to i16
%26 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %25)
%27 = load i32, i32* %8
%28 = shl i32 %27, 1
store i32 %28, i32* %8
br label %20
29: ; preds = %20
store i32 1, i32* %9
br label %30
30: ; preds = %33, %29
%31 = load i32, i32* %9
%32 = icmp sle i32 %31, 128
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = load i32, i32* %9
%35 = trunc i32 %34 to i16
%36 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext %35)
%37 = load i32, i32* %9
%38 = shl i32 %37, 1
%39 = load i32, i32* %9
%40 = or i32 %39, %38
store i32 %40, i32* %9
br label %30
41: ; preds = %30
store i16 1, i16* %10
%42 = load i16, i16* %10
%43 = load i16, i16* %10
%44 = zext i16 %43 to i32
%45 = xor i32 %44, -1
%46 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %42, i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [10 x i8] c"~%d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 192)
%4 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 772)
%5 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 1)
%6 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 2)
%7 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 4)
%8 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 8)
%9 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 16)
%10 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 32)
%11 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 64)
%12 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 128)
%13 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 1)
%14 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 3)
%15 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 7)
%16 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 15)
%17 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 31)
%18 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 63)
%19 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 zeroext 127)
%20 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i16 zeroext 1, i32 -2)
ret i32 0
}