#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*/ dec_to_bin(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  int binary[8] = {0, 0, 0, 0, 0, 0, 0, 0};
  do {
    scanf("%d", &a);
  } while (a < 0 || a > 7);
  do {
    scanf("%d", &b);
  } while (a < 0 || a > 200);
  dec_to_bin(binary, b);
  printf("%d", binary[7 - a]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x31(%rbp)
jl     1188 <main+0x48>
cmpl   $0x7,-0x8(%rbp)
setg   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    115f <main+0x1f>
jmp    1198 <main+0x58>
lea    0xe61(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x32(%rbp)
jl     11c4 <main+0x84>
cmpl   $0xc8,-0x8(%rbp)
setg   %al
mov    %al,-0x32(%rbp)
mov    -0x32(%rbp),%al
test   $0x1,%al
jne    1198 <main+0x58>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <dec_to_bin@plt>
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
cltq
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xeb5(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0x7,0x8(%rsp)
ja     1150 <main+0x20>
lea    0xe97(%rip),%r14
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpl   $0xc8,0x8(%rsp)
ja     1170 <main+0x40>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1030 <dec_to_bin@plt>
movslq 0x8(%rsp),%rax
mov    $0x7,%ecx
sub    %rax,%rcx
mov    0x10(%rsp,%rcx,4),%esi
lea    0xe55(%rip),%rdi
call   1040 <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 [8 x i32]
store i32 0, i32* %1
%5 = bitcast [8 x i32]* %4 to i8*
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
%28 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%29 = load i32, i32* %3
%30 = call i32 @dec_to_bin(i32* %28, i32 %29)
%31 = load i32, i32* %2
%32 = sub nsw i32 7, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [8 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 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%17 = load i32, i32* %2
%18 = call i32 @dec_to_bin(i32* %16, i32 %17)
%19 = load i32, i32* %1
%20 = sub nsw i32 7, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}