#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, i;
  int binary[7];
  do {
    scanf("%d", &a);
  } while (a < 0 || a > 7);
  do {
    scanf("%d", &b);
  } while (a < 0 || a > 200);
  for (i = 0; b != 0; i++) {
    binary[i] = b % 2;
    b /= 2;
  }
  printf("%d", binary[a - 1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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,-0x31(%rbp)
jl     1158 <main+0x38>
cmpl   $0x7,-0x8(%rbp)
setg   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%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,-0x8(%rbp)
mov    %al,-0x32(%rbp)
jl     1194 <main+0x74>
cmpl   $0xc8,-0x8(%rbp)
setg   %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x48>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11df <main+0xbf>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq -0x10(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a6 <main+0x86>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed2(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x7,0xc(%rsp)
ja     1140 <main+0x20>
lea    0xea7(%rip),%r14
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
cmp    $0xc8,%rax
ja     1160 <main+0x40>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
je     11b4 <main+0x94>
lea    0x10(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%ebx
shr    $0x1f,%ecx
add    %ebx,%ecx
mov    %ecx,%edi
and    $0xfffffffe,%edi
mov    %ebx,%esi
sub    %edi,%esi
mov    %esi,(%rdx)
sar    %ecx
add    $0x1,%ebx
add    $0x4,%rdx
cmp    $0x2,%ebx
ja     1190 <main+0x70>
mov    %ecx,0x8(%rsp)
mov    0xc(%rsp,%rax,4),%esi
lea    0xe41(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [7 x i32]
store i32 0, i32* %1
br label %6
6: ; preds = %14, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 7
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br i1 %15, label %6, label %16
16: ; preds = %14
br label %17
17: ; preds = %25, %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %19
19: ; preds = %17
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp sgt i32 %23, 200
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ true, %19 ], [ %24, %22 ]
br i1 %26, label %17, label %27
27: ; preds = %25
store i32 0, i32* %4
br label %28
28: ; preds = %39, %27
%29 = load i32, i32* %3
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %28
%32 = load i32, i32* %3
%33 = srem i32 %32, 2
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 %35
store i32 %33, i32* %36
%37 = load i32, i32* %3
%38 = sdiv i32 %37, 2
store i32 %38, i32* %3
br label %39
39: ; preds = %31
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %28
42: ; preds = %28
%43 = load i32, i32* %2
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [7 x i32], [7 x i32]* %5, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [7 x i32]* %3 to i8*
br label %7
7: ; preds = %7, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp ugt i32 %9, 7
br i1 %10, label %7, label %11
11: ; preds = %7, %11
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %1
%14 = icmp ugt i32 %13, 200
br i1 %14, label %11, label %15
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %15, %18
%19 = phi i64 [ %24, %18 ], [ 0, %15 ]
%20 = phi i32 [ %23, %18 ], [ %16, %15 ]
%21 = srem i32 %20, 2
%22 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %19
store i32 %21, i32* %22
%23 = sdiv i32 %20, 2
%24 = add nuw i64 %19, 1
%25 = add i32 %20, 1
%26 = icmp ult i32 %25, 3
br i1 %26, label %27, label %18
27: ; preds = %18
store i32 %23, i32* %2
br label %28
28: ; preds = %27, %15
%29 = add nsw i32 %13, -1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %32)
ret i32 0
}