// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/include/ef.gy/polytope.h
// Function: efgy::geometry::generators::mask::cube<4ul>::faces()
static std::set<face> faces(void) {
    static std::set<face> faces{{vector({false, false}), vector({false, true}),
                                 vector({true, true}), vector({true, false})}};
    if (faces.size() == size()) {
      return faces;
    }

    for (std::size_t i = 2; i < depth; i++) {
      std::set<face> newFaces;

      for (auto fa : faces) {
        auto x = fa;

        for (std::size_t j = 0; j < 4; j++) {
          const auto &la = fa[j];
          const auto &lb = fa[((j + 1) % 4)];

          const auto &ma = la < lb ? la : lb;
          const auto &mb = la < lb ? lb : la;

          face n{{ma, mb, mb, ma}};

          n[2][i] = true;
          n[3][i] = true;

          // this should have the smallest element first, because
          //  - n[2] must be >= to n[1] because we set an extra bit
          //  - n[3] must be >= to n[0] because we set an extra bit
          //  - n[0] is <= n[1]
          newFaces.insert(n);
        }

        x[0][i] = true;
        x[1][i] = true;
        x[2][i] = true;
        x[3][i] = true;

        // since we moved this face in the new direction, we reverse the winding
        // direction in order to reverse the normal.
        std::reverse(x.begin(), x.end());

        // this makes sure that the smallest vertex (via min_element) is first.
        // std::rotate(x.begin(), std::min_element(x.begin(), x.end()),
        // x.end());

        newFaces.insert(x);
      }

      faces.insert(newFaces.begin(), newFaces.end());
    }

    return faces;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movb 0xe5c1(%rip), %al       # 0x20918
testb %al, %al
je 0x124d0
cmpq $0x18, 0xe5a9(%rip)     # 0x20910
jne 0x1238f
leaq 0xe578(%rip), %rsi      # 0x208e8
movq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x12972
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
popq %r12
movb $0x1, %bl
cmpq $0x4, %r12
je 0x12369
andl $0x0, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
andq $0x0, 0x48(%rsp)
movq 0xe53e(%rip), %rcx      # 0x20900
leaq 0xe527(%rip), %rax      # 0x208f0
cmpq %rax, %rcx
je 0x124a8
movups 0x20(%rcx), %xmm0
movaps %xmm0, 0x50(%rsp)
movq %rcx, 0x70(%rsp)
movups 0x20(%rcx), %xmm0
movaps %xmm0, (%rsp)
leaq 0x50(%rsp), %r15
pushq $0x1
popq %r13
cmpq $0x5, %r13
je 0x12466
movl %r13d, %eax
andl $0x3, %eax
leaq (%rsp,%rax,4), %r14
addq $0x50, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x125c0
movl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
callq 0x125c0
movq %r15, %rcx
testb %bpl, %bpl
jne 0x12428
movq %r14, %rcx
testb %al, %al
jne 0x1242f
movq %r15, %r14
movl (%rcx), %eax
movl %eax, 0x10(%rsp)
movl (%r14), %ecx
movl %ecx, 0x14(%rsp)
movl %ecx, 0x18(%rsp)
movl %eax, 0x1c(%rsp)
movb %bl, 0x18(%rsp,%r12)
movb %bl, 0x1c(%rsp,%r12)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x12aee
incq %r13
addq $0x4, %r15
jmp 0x123f1
movb %bl, (%rsp,%r12)
movb %bl, 0x4(%rsp,%r12)
movb %bl, 0x8(%rsp,%r12)
movb %bl, 0xc(%rsp,%r12)
movq %rsp, %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x12b24
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x12aee
movq 0x70(%rsp), %rdi
callq 0x4300
movq %rax, %rcx
jmp 0x123c2
movq 0x38(%rsp), %rsi
leaq 0xe434(%rip), %rdi      # 0x208e8
leaq 0x28(%rsp), %rdx
callq 0x12b6e
leaq 0x20(%rsp), %rdi
callq 0x1261e
incq %r12
jmp 0x12395
leaq 0xe441(%rip), %rdi      # 0x20918
callq 0x4440
testl %eax, %eax
je 0x1235f
movabsq $0x10100000100, %rax    # imm = 0x10100000100
leaq 0x20(%rsp), %rsi
movq %rax, 0x4(%rsi)
andl $0x0, (%rsi)
movl $0x1, 0xc(%rsi)
leaq 0xe3e0(%rip), %rdi      # 0x208e8
pushq $0x1
popq %rdx
leaq 0x50(%rsp), %rcx
movq %rsp, %r8
callq 0x12578
leaq 0x53(%rip), %rdi        # 0x12572
leaq 0xe3c2(%rip), %rsi      # 0x208e8
leaq 0xdd1b(%rip), %rdx      # 0x20248
callq 0x4230
leaq 0xe3df(%rip), %rdi      # 0x20918
callq 0x41b0
jmp 0x1235f
movq %rax, %rbx
leaq 0xe3cb(%rip), %rdi      # 0x20918
callq 0x41a0
jmp 0x12569
jmp 0x1255c
jmp 0x1255c
jmp 0x1255c
jmp 0x1255c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1261e
movq %rbx, %rdi
callq 0x4420
nop