#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, count, input[8];
  scanf("%d", &a);
  if (a < 0 || a > 7) {
    return 0;
  }
  scanf("%d", &b);
  if (b < 0 || b > 200) {
    return 0;
  }
  for (int i = 0; i < 8; ++i) {
    input[i] = 0;
  }
  for (count = 8 - 1; count >= 0; count--) {
    if (b >= 1) {
      input[count] = b % 2;
      b = b / 2;
    } else
      break;
  }
  printf("\n");
  for (int i = 0; i < 8; ++i) {
    printf("%d", input[i]);
  }
  printf("\n");
  printf("%d", input[7 - a]);
  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>
cmpl   $0x0,-0x8(%rbp)
jl     1153 <main+0x33>
cmpl   $0x7,-0x8(%rbp)
jle    115f <main+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    128a <main+0x16a>
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jl     1186 <main+0x66>
cmpl   $0xc8,-0xc(%rbp)
jle    1192 <main+0x72>
movl   $0x0,-0x4(%rbp)
jmp    128a <main+0x16a>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    11bd <main+0x9d>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1199 <main+0x79>
movl   $0x7,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1216 <main+0xf6>
cmpl   $0x1,-0xc(%rbp)
jl     11fe <main+0xde>
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)
jmp    1203 <main+0xe3>
jmp    1216 <main+0xf6>
jmp    1208 <main+0xe8>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    11c4 <main+0xa4>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x8,-0x38(%rbp)
jge    1259 <main+0x139>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    122b <main+0x10b>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x7,%eax
sub    -0x8(%rbp),%eax
cltq
mov    -0x30(%rbp,%rax,4),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xebb(%rip),%rdi
lea    0x1c(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x7,0x1c(%rsp)
ja     1313 <main+0x1e3>
lea    0xe9f(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x18(%rsp),%ecx
cmp    $0xc8,%ecx
ja     1313 <main+0x1e3>
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
test   %ecx,%ecx
je     124d <main+0x11d>
mov    %ecx,%eax
and    $0x1,%eax
mov    %eax,0x3c(%rsp)
mov    %ecx,%eax
shr    %eax
cmp    $0x2,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x38(%rsp)
mov    %ecx,%eax
shr    $0x2,%eax
cmp    $0x4,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x34(%rsp)
mov    %ecx,%eax
shr    $0x3,%eax
cmp    $0x8,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x30(%rsp)
mov    %ecx,%eax
shr    $0x4,%eax
cmp    $0x10,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x2c(%rsp)
mov    %ecx,%eax
shr    $0x5,%eax
cmp    $0x20,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x28(%rsp)
mov    %ecx,%eax
shr    $0x6,%eax
cmp    $0x40,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x24(%rsp)
mov    %ecx,%eax
shr    $0x7,%eax
cmp    $0x80,%ecx
jb     1217 <main+0xe7>
and    $0x1,%eax
mov    %eax,0x20(%rsp)
shr    $0x8,%ecx
mov    %ecx,%eax
mov    %eax,0x18(%rsp)
mov    0x20(%rsp),%r12d
mov    0x24(%rsp),%r15d
mov    0x28(%rsp),%r14d
mov    0x2c(%rsp),%ebp
mov    0x30(%rsp),%r13d
mov    0x34(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0x38(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x3c(%rsp),%eax
mov    %eax,0x14(%rsp)
jmp    1273 <main+0x143>
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
xor    %r13d,%r13d
xor    %ebp,%ebp
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd7c(%rip),%rbx
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0x1c(%rsp),%rax
mov    $0x7,%ecx
sub    %rax,%rcx
mov    0x20(%rsp,%rcx,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 7
br i1 %13, label %14, label %15
14: ; preds = %11, %0
store i32 0, i32* %1
br label %76
15: ; preds = %11
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 200
br i1 %21, label %22, label %23
22: ; preds = %19, %15
store i32 0, i32* %1
br label %76
23: ; preds = %19
store i32 0, i32* %6
br label %24
24: ; preds = %31, %23
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 8
br i1 %26, label %27, label %34
27: ; preds = %24
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %29
store i32 0, i32* %30
br label %31
31: ; preds = %27
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %24
34: ; preds = %24
store i32 7, i32* %4
br label %35
35: ; preds = %51, %34
%36 = load i32, i32* %4
%37 = icmp sge i32 %36, 0
br i1 %37, label %38, label %54
38: ; preds = %35
%39 = load i32, i32* %3
%40 = icmp sge i32 %39, 1
br i1 %40, label %41, label %49
41: ; preds = %38
%42 = load i32, i32* %3
%43 = srem i32 %42, 2
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %45
store i32 %43, i32* %46
%47 = load i32, i32* %3
%48 = sdiv i32 %47, 2
store i32 %48, i32* %3
br label %50
49: ; preds = %38
br label %54
50: ; preds = %41
br label %51
51: ; preds = %50
%52 = load i32, i32* %4
%53 = add nsw i32 %52, -1
store i32 %53, i32* %4
br label %35
54: ; preds = %49, %35
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %7
br label %56
56: ; preds = %65, %54
%57 = load i32, i32* %7
%58 = icmp slt i32 %57, 8
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %59
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %56
68: ; preds = %56
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%70 = load i32, i32* %2
%71 = sub nsw i32 7, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %74)
store i32 0, i32* %1
br label %76
76: ; preds = %68, %22, %14
%77 = load i32, i32* %1
ret i32 %77
}

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 [8 x i32]* %3 to i8*
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp ugt i32 %8, 7
br i1 %9, label %98, label %10
10: ; preds = %0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = icmp ugt i32 %12, 200
br i1 %13, label %98, label %14
14: ; preds = %10
%15 = icmp eq i32 %12, 0
br i1 %15, label %73, label %16
16: ; preds = %14
%17 = and i32 %12, 1
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
store i32 %17, i32* %18
%19 = lshr i32 %12, 1
%20 = icmp ugt i32 %12, 1
br i1 %20, label %21, label %55
21: ; preds = %16
%22 = and i32 %19, 1
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
store i32 %22, i32* %23
%24 = lshr i32 %12, 2
%25 = icmp ugt i32 %12, 3
br i1 %25, label %26, label %55
26: ; preds = %21
%27 = and i32 %24, 1
%28 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
store i32 %27, i32* %28
%29 = lshr i32 %12, 3
%30 = icmp ugt i32 %12, 7
br i1 %30, label %31, label %55
31: ; preds = %26
%32 = and i32 %29, 1
%33 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
store i32 %32, i32* %33
%34 = lshr i32 %12, 4
%35 = icmp ugt i32 %12, 15
br i1 %35, label %36, label %55
36: ; preds = %31
%37 = and i32 %34, 1
%38 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
store i32 %37, i32* %38
%39 = lshr i32 %12, 5
%40 = icmp ugt i32 %12, 31
br i1 %40, label %41, label %55
41: ; preds = %36
%42 = and i32 %39, 1
%43 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
store i32 %42, i32* %43
%44 = lshr i32 %12, 6
%45 = icmp ugt i32 %12, 63
br i1 %45, label %46, label %55
46: ; preds = %41
%47 = and i32 %44, 1
%48 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
store i32 %47, i32* %48
%49 = lshr i32 %12, 7
%50 = icmp ugt i32 %12, 127
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = and i32 %49, 1
%53 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
store i32 %52, i32* %53
%54 = lshr i32 %12, 8
br label %55
55: ; preds = %51, %46, %41, %36, %31, %26, %21, %16
%56 = phi i32 [ %19, %16 ], [ %24, %21 ], [ %29, %26 ], [ %34, %31 ], [ %39, %36 ], [ %44, %41 ], [ %49, %46 ], [ %54, %51 ]
store i32 %56, i32* %2
%57 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%58 = load i32, i32* %57
%59 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
%60 = load i32, i32* %59
%61 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
%62 = load i32, i32* %61
%63 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
%64 = load i32, i32* %63
%65 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
%66 = load i32, i32* %65
%67 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
%68 = load i32, i32* %67
%69 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
%70 = load i32, i32* %69
%71 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
%72 = load i32, i32* %71
br label %73
73: ; preds = %55, %14
%74 = phi i32 [ %72, %55 ], [ 0, %14 ]
%75 = phi i32 [ %70, %55 ], [ 0, %14 ]
%76 = phi i32 [ %68, %55 ], [ 0, %14 ]
%77 = phi i32 [ %66, %55 ], [ 0, %14 ]
%78 = phi i32 [ %64, %55 ], [ 0, %14 ]
%79 = phi i32 [ %62, %55 ], [ 0, %14 ]
%80 = phi i32 [ %60, %55 ], [ 0, %14 ]
%81 = phi i32 [ %58, %55 ], [ 0, %14 ]
%82 = call i32 @putchar(i32 10)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %81)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %80)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %79)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %78)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %77)
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %76)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %75)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %74)
%91 = call i32 @putchar(i32 10)
%92 = load i32, i32* %1
%93 = sub nsw i32 7, %92
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %96)
br label %98
98: ; preds = %10, %0, %73
ret i32 0
}