user: What would the C source look like for the assembly code provided here:

```asm
<init_flag>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x48,%rsp
  mov    %ecx,0xc(%rsp)
  mov    %r9d,0x38(%rsp)
  call   <read_pgm@plt>
  movl   $0x1,0x18(%rsp)
  mov    %rax,0x28(%rsp)
  lea    0x1(%rbp),%eax
  mov    %eax,0x3c(%rsp)
  lea    0x1(%r15),%eax
  movq   $0x4,0x20(%rsp)
  mov    %eax,0x30(%rsp)
  test   %ebp,%ebp
  jle    L116
  mov    %r15d,%r13d
  mov    %rbx,%r15
  xchg   %ax,%ax
L115:
  mov    $0x1,%ebx
  test   %r13d,%r13d
  jle    L411
  xchg   %ax,%ax
L306:
  test   %r14d,%r14d
  jle    L267
  mov    0x30(%rsp),%eax
  mov    $0x1,%ebp
  sub    %ebx,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x10(%rsp)
  mov    %r15,%rax
  mov    %ebx,%r15d
  mov    %r14d,%ebx
  mov    %rax,%r14
  nopw   0x0(%rax,%rax,1)
L335:
  mov    0x10(%rsp),%rdx
  mov    (%r14,%rbp,8),%rax
  sub    $0x8,%rsp
  mov    %ebx,%r8d
  mov    0x28(%rsp),%r12
  mov    %ebp,%esi
  mov    %r13d,%r9d
  add    $0x1,%rbp
  add    (%rax,%rdx,1),%r12
  mov    0x14(%rsp),%eax
  mov    %r15d,%edx
  push   %rax
  mov    0x28(%rsp),%ecx
  mov    0x38(%rsp),%rdi
  call   <createflag@plt>
  mov    %eax,(%r12)
  pop    %rdi
  pop    %r8
  cmp    %ebp,%ebx
  jge    L335
  mov    %r14,%rax
  mov    %ebx,%r14d
  mov    %r15d,%ebx
  mov    %rax,%r15
L267:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jge    L306
L411:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  addq   $0x4,0x20(%rsp)
  cmp    %eax,0xc(%rsp)
  jge    L115
  mov    %r15,%rbx
  mov    %r13d,%r15d
L163:
  movslq %r15d,%rax
  mov    %r14d,0x20(%rsp)
  xor    %edx,%edx
  lea    0x8(,%rax,8),%r13
  mov    %r15d,0x28(%rsp)
  movslq %r14d,%rax
  mov    0x90(%rsp),%r15d
  mov    0x88(%rsp),%r14d
  mov    %r13,0x10(%rsp)
  lea    0x8(%rbx,%rax,8),%r12
  mov    %rbx,%r13
  mov    %rdx,%rbx
  nopl   0x0(%rax)
L144:
  mov    0x0(%r13),%rax
  lea    0x0(,%rbx,4),%rbp
  mov    %r14d,%edi
  add    $0x1,%rbx
  mov    (%rax),%rsi
  add    %rbp,%rsi
  mov    %rsi,0x18(%rsp)
  call   <getwallbit@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    %r15d,%edi
  mov    %eax,(%rsi)
  mov    0x0(%r13),%rax
  mov    (%rax,%rcx,1),%rsi
  add    %rbp,%rsi
  mov    %rsi,0x18(%rsp)
  call   <getwallbit@plt>
  mov    0x18(%rsp),%rsi
  mov    %r14d,%edi
  mov    %eax,(%rsi)
  mov    (%r12),%rax
  mov    (%rax),%rsi
  add    %rbp,%rsi
  mov    %rsi,0x18(%rsp)
  call   <getwallbit@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    %r15d,%edi
  mov    %eax,(%rsi)
  mov    (%r12),%rax
  add    (%rax,%rcx,1),%rbp
  call   <getwallbit@plt>
  mov    %eax,0x0(%rbp)
  cmp    %ebx,0x3c(%rsp)
  jge    L144
  mov    0x20(%rsp),%r14d
  mov    0x28(%rsp),%r15d
  mov    %r13,%rbx
L395:
  cmp    $0xffffffff,%r15d
  jl     L388
  movslq 0x3c(%rsp),%rax
  mov    %r14d,0x20(%rsp)
  xor    %ebp,%ebp
  mov    %r15d,0x18(%rsp)
  mov    %rbx,%r15
  lea    0x0(,%rax,4),%r13
  movslq %r14d,%rax
  mov    0x98(%rsp),%r14d
  lea    0x8(%rbx,%rax,8),%r12
  mov    0xa0(%rsp),%ebx
L286:
  mov    (%r15),%rax
  mov    %ebx,%edi
  mov    (%rax,%rbp,8),%rcx
  mov    %rcx,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rcx
  mov    %r14d,%edi
  mov    %eax,(%rcx)
  mov    (%r15),%rax
  mov    (%rax,%rbp,8),%rcx
  add    %r13,%rcx
  mov    %rcx,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rcx
  mov    %ebx,%edi
  mov    %eax,(%rcx)
  mov    (%r12),%rax
  mov    (%rax,%rbp,8),%rcx
  mov    %rcx,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rcx
  mov    %r14d,%edi
  mov    %eax,(%rcx)
  mov    (%r12),%rax
  mov    (%rax,%rbp,8),%rcx
  add    $0x1,%rbp
  add    %r13,%rcx
  mov    %rcx,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rcx
  mov    %eax,(%rcx)
  lea    -0x1(%rbp),%eax
  cmp    0x18(%rsp),%eax
  jle    L286
  mov    %r15,%rbx
  mov    0x20(%rsp),%r14d
  mov    0x18(%rsp),%r15d
L388:
  cmp    $0xffffffff,%r14d
  jl     L392
  xor    %r13d,%r13d
  movslq 0x3c(%rsp),%rbp
  movslq %r15d,%rax
  mov    %r14d,0x18(%rsp)
  mov    %r15d,0x20(%rsp)
  mov    %rbx,%r14
  mov    %r13,%r15
  mov    0x88(%rsp),%ebx
  mov    0x90(%rsp),%r13d
  lea    0x8(,%rax,8),%r12
  shl    $0x2,%rbp
  nopl   0x0(%rax)
L122:
  mov    (%r14,%r15,8),%rax
  mov    %ebx,%edi
  mov    (%rax),%rsi
  mov    %rsi,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rsi
  mov    %r13d,%edi
  mov    %eax,(%rsi)
  mov    (%r14,%r15,8),%rax
  mov    (%rax,%r12,1),%rsi
  mov    %rsi,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rsi
  mov    %ebx,%edi
  mov    %eax,(%rsi)
  mov    (%r14,%r15,8),%rax
  mov    (%rax),%rsi
  add    %rbp,%rsi
  mov    %rsi,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rsi
  mov    %r13d,%edi
  mov    %eax,(%rsi)
  mov    (%r14,%r15,8),%rax
  add    $0x1,%r15
  mov    (%rax,%r12,1),%rsi
  add    %rbp,%rsi
  mov    %rsi,0x10(%rsp)
  call   <getwallbit@plt>
  mov    0x10(%rsp),%rsi
  mov    %eax,(%rsi)
  lea    -0x1(%r15),%eax
  cmp    %eax,0x18(%rsp)
  jge    L122
  mov    %r14,%rbx
  mov    0x20(%rsp),%r15d
  mov    0x18(%rsp),%r14d
L392:
  test   %r14d,%r14d
  jle    L45
  movslq 0xc(%rsp),%rax
  movl   $0x1,0x18(%rsp)
  mov    %rbx,0x30(%rsp)
  lea    0x0(,%rax,4),%rbp
  lea    0x8(%rbx),%rax
  mov    %r14d,0x20(%rsp)
  mov    %rax,0x28(%rsp)
  lea    0x4(%rbp),%rcx
  mov    %r15d,0x10(%rsp)
  mov    %rcx,%r14
  mov    %rax,%r15
  nopl   (%rax)
L30:
  mov    0x10(%rsp),%ecx
  xor    %ebx,%ebx
  mov    %r15,%r13
  test   %ecx,%ecx
  jg     L151
  jmp    L405
  cs nopw 0x0(%rax,%rax,1)
L126:
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rax
  mov    0x4(%rax),%r15d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx)
L376:
  mov    $0xc,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbx,8),%rax
  and    (%rax,%rbp,1),%r12d
  jne    L157
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rax
  mov    (%rax,%rbp,1),%r15d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx,%r14,1)
  lea    0x1(%rbx),%eax
  cmp    0x10(%rsp),%eax
  jg     L172
L151:
  mov    $0xc,%esi
  mov    $0x2,%edi
  add    $0x1,%rbx
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbx,8),%rax
  and    0x4(%rax),%r12d
  je     L126
  mov    0xa0(%rsp),%edi
  call   <getwallbit@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    0x4(%rcx),%eax
  and    $0x3,%eax
  lea    -0x3(%rax,%r8,1),%eax
  mov    %eax,(%rcx)
  jmp    L376
L157:
  mov    0x98(%rsp),%edi
  call   <getwallbit@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    (%rcx,%rbp,1),%eax
  and    $0xc,%eax
  lea    -0xc(%rax,%r8,1),%eax
  mov    %eax,(%rcx,%r14,1)
  lea    0x1(%rbx),%eax
  cmp    0x10(%rsp),%eax
  jle    L151
L172:
  mov    %r13,%r15
L405:
  addl   $0x1,0x18(%rsp)
  add    $0x8,%r15
  mov    0x18(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  jge    L30
  mov    0x10(%rsp),%r15d
  mov    0x20(%rsp),%r14d
  mov    0x30(%rsp),%rbx
  test   %r15d,%r15d
  jle    L250
L19:
  movslq %r14d,%rax
  mov    %r15d,0x20(%rsp)
  xor    %edx,%edx
  shl    $0x3,%rax
  mov    %r14d,0x28(%rsp)
  lea    (%rbx,%rax,1),%rcx
  lea    0x8(%rbx,%rax,1),%rax
  mov    %rax,0x10(%rsp)
  mov    %rcx,%r14
  nopl   0x0(%rax)
L118:
  lea    0x1(%rdx),%rax
  mov    0xc(%rsp),%edx
  xor    %r15d,%r15d
  mov    %rax,0x18(%rsp)
  lea    0x0(,%rax,8),%r12
  test   %edx,%edx
  jg     L254
  jmp    L269
  nopl   (%rax)
L243:
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  mov    0x8(%rbx),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbp,4),%r15d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%rbx),%rax
  mov    (%rax,%r12,1),%rdx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  add    %r13d,%eax
  mov    %eax,(%rdx,%rbp,4)
L381:
  mov    $0xc,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  xor    %r8d,%r13d
  mov    (%rax,%r12,1),%rax
  and    (%rax,%rbp,4),%r13d
  jne    L410
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  mov    (%r14),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbp,4),%r15d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x10(%rsp),%rax
  mov    (%rax),%rax
  mov    (%rax,%r12,1),%rdx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  mov    %rbp,%r15
  add    %r13d,%eax
  mov    %eax,(%rdx,%rbp,4)
  lea    0x1(%rbp),%eax
  cmp    %eax,0xc(%rsp)
  jl     L269
L254:
  mov    $0xc,%esi
  mov    $0x2,%edi
  lea    0x1(%r15),%rbp
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x8(%rbx),%rax
  xor    %r8d,%r13d
  mov    (%rax,%r12,1),%rax
  and    0x4(%rax,%r15,4),%r13d
  je     L243
  mov    0x38(%rsp),%edi
  call   <getwallbit@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  call   <pow2@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %eax,%r13d
  mov    0x8(%rbx),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbp,4),%r15d
  call   <pow2@plt>
  mov    (%rbx),%rdx
  lea    (%rax,%rax,2),%eax
  mov    (%rdx,%r12,1),%rdx
  and    %r15d,%eax
  add    %r13d,%eax
  mov    %eax,(%rdx,%rbp,4)
  jmp    L381
  xchg   %ax,%ax
L410:
  mov    0x80(%rsp),%edi
  call   <getwallbit@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    %eax,%r13d
  call   <pow2@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %eax,%r13d
  mov    (%r14),%rax
  mov    (%rax,%r12,1),%rax
  mov    (%rax,%rbp,4),%r15d
  call   <pow2@plt>
  mov    0x10(%rsp),%rcx
  lea    (%rax,%rax,2),%eax
  mov    (%rcx),%rdx
  and    %r15d,%eax
  mov    %rbp,%r15
  add    %r13d,%eax
  mov    (%rdx,%r12,1),%rdx
  mov    %eax,(%rdx,%rbp,4)
  lea    0x1(%rbp),%eax
  cmp    %eax,0xc(%rsp)
  jge    L254
L269:
  mov    0x18(%rsp),%rdx
  lea    0x1(%rdx),%eax
  cmp    0x20(%rsp),%eax
  jle    L118
  mov    0x28(%rsp),%r14d
  lea    0x8(%rbx),%rax
  mov    0x20(%rsp),%r15d
  mov    %rax,0x28(%rsp)
  test   %r14d,%r14d
  jle    L323
L250:
  movslq %r15d,%rbp
  mov    0x28(%rsp),%r13
  mov    %r14d,0x18(%rsp)
  movl   $0x1,0x10(%rsp)
  shl    $0x3,%rbp
  lea    0x8(%rbp),%r15
  mov    %r13,%r14
  nopw   0x0(%rax,%rax,1)
L341:
  mov    0xc(%rsp),%eax
  xor    %r13d,%r13d
  test   %eax,%eax
  jg     L91
  jmp    L212
  nopl   0x0(%rax)
L203:
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r14),%rax
  mov    0x8(%rax),%rax
  mov    (%rax,%rbx,4),%r13d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  mov    (%rax),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r13d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx,%rbx,4)
L89:
  mov    $0xc,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbp,1),%rax
  and    (%rax,%rbx,4),%r12d
  jne    L26
  xor    %edi,%edi
  call   <getwallbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r14),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r13d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  mov    (%rax,%r15,1),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r13d,%eax
  mov    %rbx,%r13
  add    %r12d,%eax
  mov    %eax,(%rcx,%rbx,4)
  lea    0x1(%rbx),%eax
  cmp    %eax,0xc(%rsp)
  jl     L212
L91:
  mov    $0xc,%esi
  mov    $0x2,%edi
  lea    0x1(%r13),%rbx
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  xor    %r8d,%r12d
  mov    0x8(%rax),%rax
  and    0x4(%rax,%r13,4),%r12d
  je     L203
  mov    0x88(%rsp),%edi
  call   <getwallbit@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  mov    (%rax),%rcx
  mov    0x8(%rax),%rax
  mov    (%rax,%rbx,4),%eax
  and    $0xc0,%eax
  lea    -0xc0(%rax,%r8,1),%eax
  mov    %eax,(%rcx,%rbx,4)
  jmp    L89
  nopl   (%rax)
L26:
  mov    0x90(%rsp),%edi
  mov    %rbx,%r13
  call   <getwallbit@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  mov    (%rax,%r15,1),%rcx
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%eax
  and    $0x30,%eax
  lea    -0x30(%rax,%r8,1),%eax
  mov    %eax,(%rcx,%rbx,4)
  lea    0x1(%rbx),%eax
  cmp    %eax,0xc(%rsp)
  jge    L91
L212:
  addl   $0x1,0x10(%rsp)
  add    $0x8,%r14
  mov    0x10(%rsp),%eax
  cmp    %eax,0x18(%rsp)
  jge    L341
L323:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  mov    0x3c(%rsp),%esi
  test   %esi,%esi
  js     L395
  jmp    L163
  nop
L45:
  test   %r15d,%r15d
  jg     L19
  jmp    L323
```

assistant: ```c
void init_flag(char *problem, int imax, int jmax, int kmax, int ***Flag, int wl, int wr, int wf, int wh, int wt, int wb) {
  int i, j, k;
  int **Pic = read_pgm(problem);
  for (k = 1; k < kmax + 1; k++) {
    for (int j = 1; j < jmax + 1; j++) {
      for (int i = 1; i < imax + 1; i++) {
        Flag[i][jmax + 1 - j][k] = createflag(Pic, i, j, k, imax, jmax, kmax);
      }
    }
  }
  for (k = 0; k < kmax + 2; k++) {
    Flag[0][0][k] = getwallbit(wf);
    Flag[0][jmax + 1][k] = getwallbit(wh);
    Flag[imax + 1][0][k] = getwallbit(wf);
    Flag[imax + 1][jmax + 1][k] = getwallbit(wh);
  }
  for (j = 0; j < jmax + 2; j++) {
    Flag[0][j][0] = getwallbit(wb);
    Flag[0][j][kmax + 1] = getwallbit(wt);
    Flag[imax + 1][j][0] = getwallbit(wb);
    Flag[imax + 1][j][kmax + 1] = getwallbit(wt);
  }
  for (i = 0; i < imax + 2; i++) {
    Flag[i][0][0] = getwallbit(wf);
    Flag[i][jmax + 1][0] = getwallbit(wh);
    Flag[i][0][kmax + 1] = getwallbit(wf);
    Flag[i][jmax + 1][kmax + 1] = getwallbit(wh);
  }
  for (i = 1; i <= imax; i++) {
    for (j = 1; j <= jmax; j++) {
      if ((Flag[i][j][1] & pow2(2, 12)) == (Flag[i][j][1] & pow2(2, 13))) {
        Flag[i][j][0] = getwallbit(0) + (Flag[i][j][1] & (pow2(2, 12) * 15));
      } else {
        Flag[i][j][0] = (getwallbit(wb) - 3) + (Flag[i][j][1] & 3);
      }
      if ((Flag[i][j][kmax] & pow2(2, 12)) == (Flag[i][j][kmax] & pow2(2, 13))) {
        Flag[i][j][kmax + 1] = getwallbit(0) + (Flag[i][j][kmax] & (pow2(2, 12) * 15));
      } else {
        Flag[i][j][kmax + 1] = (getwallbit(wt) - 12) + (Flag[i][j][kmax] & 12);
      }
    }
  }
  for (j = 1; j <= jmax; j++) {
    for (k = 1; k <= kmax; k++) {
      if ((Flag[1][j][k] & pow2(2, 12)) == (Flag[1][j][k] & pow2(2, 13))) {
        Flag[0][j][k] = getwallbit(0) + (Flag[1][j][k] & (pow2(2, 12) * 15));
      } else {
        Flag[0][j][k] = (getwallbit(wl) - 3 * pow2(2, 10)) + (Flag[1][j][k] & (3 * pow2(2, 10)));
      }
      if ((Flag[imax][j][k] & pow2(2, 12)) == (Flag[imax][j][k] & pow2(2, 13))) {
        Flag[imax + 1][j][k] = getwallbit(0) + (Flag[imax][j][k] & (pow2(2, 12) * 15));
      } else {
        Flag[imax + 1][j][k] = (getwallbit(wr) - 3 * pow2(2, 8)) + (Flag[imax][j][k] & (3 * pow2(2, 8)));
      }
    }
  }
  for (i = 1; i <= imax; i++) {
    for (k = 1; k <= kmax; k++) {
      if ((Flag[i][1][k] & pow2(2, 12)) == (Flag[i][1][k] & pow2(2, 13))) {
        Flag[i][0][k] = getwallbit(0) + (Flag[i][1][k] & (pow2(2, 12) * 15));
      } else {
        Flag[i][0][k] = (getwallbit(wf) - 64 * 3) + (Flag[i][1][k] & (64 * 3));
      }
      if ((Flag[i][jmax][k] & pow2(2, 12)) == (Flag[i][jmax][k] & pow2(2, 13))) {
        Flag[i][jmax + 1][k] = getwallbit(0) + (Flag[i][jmax][k] & (pow2(2, 12) * 15));
      } else {
        Flag[i][jmax + 1][k] = (getwallbit(wh) - 16 * 3) + (Flag[i][jmax][k] & (16 * 3));
      }
    }
  }
}
```