#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*/ putchar(int);
int /*<<< orphan*/ scanf(char *, size_t *, size_t *);
int main() {
  size_t n, f;
  int b = 0;
  scanf("%zu %zu", &n, &f);
  for (size_t i = 0; !(i >> n); ++i) {
    if (!(f & 1 << i))
      continue;
    if (b)
      printf(" | ");
    b = 1;
    printf(i & 1 ? "x0" : "~x0");
    for (size_t j = 1; j < n; ++j)
      if (i & 1 << j)
        printf("&x%zu", j);
      else
        printf("&~x%zu", j);
  }
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1183 <main+0x53>
jmp    1279 <main+0x149>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jne    11a9 <main+0x79>
jmp    1268 <main+0x138>
cmpl   $0x0,-0x1c(%rbp)
je     11c1 <main+0x91>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x28(%rbp),%rcx
and    $0x1,%rcx
lea    0xe35(%rip),%rdi
lea    0xe2f(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1263 <main+0x133>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     123b <main+0x10b>
mov    -0x30(%rbp),%rsi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124d <main+0x11d>
mov    -0x30(%rbp),%rsi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1252 <main+0x122>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11f5 <main+0xc5>
jmp    1268 <main+0x138>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1162 <main+0x32>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <scanf@plt>
lea    0xeb2(%rip),%r13
lea    0xeb4(%rip),%rbp
lea    0xea7(%rip),%r14
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    1198 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rcx
add    $0x1,%r15
mov    %r15,%rax
shr    %cl,%rax
test   %rax,%rax
jne    122a <main+0xfa>
mov    $0x1,%eax
mov    %r15d,%ecx
shl    %cl,%eax
cltq
test   %rax,0x10(%rsp)
je     1180 <main+0x50>
test   %r12d,%r12d
je     11be <main+0x8e>
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%r15b
mov    %r13,%rdi
lea    0xe40(%rip),%rax
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rcx
mov    $0x1,%r12d
cmp    $0x2,%rcx
jb     1185 <main+0x55>
mov    $0x1,%ebx
jmp    120c <main+0xdc>
nop
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
mov    0x8(%rsp),%rcx
cmp    %rcx,%rbx
jae    1185 <main+0x55>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
mov    $0x1,%r12d
cltq
mov    %rbp,%rdi
test   %rax,%r15
je     11f0 <main+0xc0>
mov    %r14,%rdi
jmp    11f0 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%zu %zu\00"
@.str.1 = [4 x i8] c" | \00"
@.str.2 = [3 x i8] c"x0\00"
@.str.3 = [4 x i8] c"~x0\00"
@.str.4 = [6 x i8] c"&x%zu\00"
@.str.5 = [7 x i8] c"&~x%zu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
store i64 0, i64* %5
br label %8
8: ; preds = %58, %0
%9 = load i64, i64* %5
%10 = load i64, i64* %2
%11 = lshr i64 %9, %10
%12 = icmp ne i64 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %61
14: ; preds = %8
%15 = load i64, i64* %3
%16 = load i64, i64* %5
%17 = trunc i64 %16 to i32
%18 = shl i32 1, %17
%19 = sext i32 %18 to i64
%20 = and i64 %15, %19
%21 = icmp ne i64 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %14
br label %58
23: ; preds = %14
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
store i32 1, i32* %4
%29 = load i64, i64* %5
%30 = and i64 %29, 1
%31 = icmp ne i64 %30, 0
%32 = zext i1 %31 to i64
%33 = select i1 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%34 = call i32 (i8*, ...) @printf(i8* %33)
store i64 1, i64* %6
br label %35
35: ; preds = %54, %28
%36 = load i64, i64* %6
%37 = load i64, i64* %2
%38 = icmp ult i64 %36, %37
br i1 %38, label %39, label %57
39: ; preds = %35
%40 = load i64, i64* %5
%41 = load i64, i64* %6
%42 = trunc i64 %41 to i32
%43 = shl i32 1, %42
%44 = sext i32 %43 to i64
%45 = and i64 %40, %44
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %39
%48 = load i64, i64* %6
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 %48)
br label %53
50: ; preds = %39
%51 = load i64, i64* %6
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %51)
br label %53
53: ; preds = %50, %47
br label %54
54: ; preds = %53
%55 = load i64, i64* %6
%56 = add i64 %55, 1
store i64 %56, i64* %6
br label %35
57: ; preds = %35
br label %58
58: ; preds = %57, %22
%59 = load i64, i64* %5
%60 = add i64 %59, 1
store i64 %60, i64* %5
br label %8
61: ; preds = %8
%62 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%zu %zu\00"
@.str.1 = [4 x i8] c" | \00"
@.str.2 = [3 x i8] c"x0\00"
@.str.3 = [4 x i8] c"~x0\00"
@.str.4 = [6 x i8] c"&x%zu\00"
@.str.5 = [7 x i8] c"&~x%zu\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
br label %8
6: ; preds = %42
%7 = call i32 @putchar(i32 10)
ret i32 0
8: ; preds = %0, %42
%9 = phi i64 [ 0, %0 ], [ %45, %42 ]
%10 = phi i32 [ 0, %0 ], [ %44, %42 ]
%11 = load i64, i64* %2
%12 = trunc i64 %9 to i32
%13 = shl nuw i32 1, %12
%14 = sext i32 %13 to i64
%15 = and i64 %11, %14
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = load i64, i64* %1
br label %42
19: ; preds = %8
%20 = icmp eq i32 %10, 0
br i1 %20, label %23, label %21
21: ; preds = %19
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = and i64 %9, 1
%25 = icmp eq i64 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %26)
%28 = load i64, i64* %1
%29 = icmp ugt i64 %28, 1
br i1 %29, label %30, label %42
30: ; preds = %23, %30
%31 = phi i64 [ %39, %30 ], [ 1, %23 ]
%32 = trunc i64 %31 to i32
%33 = shl nuw i32 1, %32
%34 = sext i32 %33 to i64
%35 = and i64 %9, %34
%36 = icmp eq i64 %35, 0
%37 = select i1 %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %37, i64 %31)
%39 = add nuw i64 %31, 1
%40 = load i64, i64* %1
%41 = icmp ult i64 %39, %40
br i1 %41, label %30, label %42
42: ; preds = %30, %17, %23
%43 = phi i64 [ %18, %17 ], [ %28, %23 ], [ %40, %30 ]
%44 = phi i32 [ %10, %17 ], [ 1, %23 ], [ 1, %30 ]
%45 = add i64 %9, 1
%46 = lshr i64 %45, %43
%47 = icmp eq i64 %46, 0
br i1 %47, label %8, label %6
}