#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 *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, output;
  do {
    scanf("%d", &a);
  } while (a < 0 || a > 7);
  do {
    scanf("%d", &b);
  } while (b < 0 || b > 100);
  output = (b >> a) & 1;
  printf("%d \n", output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1158 <main+0x38>
cmpl   $0x7,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
jmp    1168 <main+0x48>
lea    0xe91(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x12(%rbp)
jl     1191 <main+0x71>
cmpl   $0x64,-0xc(%rbp)
setg   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x48>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x7,(%rsp)
ja     1130 <main+0x10>
lea    0xeb8(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x64,%esi
ja     1150 <main+0x30>
mov    (%rsp),%cl
shr    %cl,%esi
and    $0x1,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp ugt i32 %7, 7
br i1 %8, label %5, label %9
9: ; preds = %5, %9
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = icmp ugt i32 %11, 100
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = load i32, i32* %1
%15 = lshr i32 %11, %14
%16 = and i32 %15, 1
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}