user: Please show me the C implementation that matches the assembly code listed below:

```asm
<init_flag>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  mov    %ecx,-0x84(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9d,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x40(%rbp)
  movl   $0x2,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x3,-0x34(%rbp)
  movl   $0x4,-0x30(%rbp)
  movl   $0x7,-0x2c(%rbp)
  movl   $0x8,-0x28(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <read_pgm@plt>
  cltq
  mov    %rax,-0x48(%rbp)
  movl   $0x1,-0x5c(%rbp)
  jmp    L7
L1:
  movl   $0x1,-0x58(%rbp)
  jmp    L199
L40:
  movl   $0x1,-0x54(%rbp)
  jmp    L23
L431:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  mov    -0x40(%rbp,%rax,4),%ebx
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebx
  mov    %ebx,%r12d
  mov    -0x54(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %ebx,%eax
  add    %eax,%r12d
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %ebx,%eax
  add    %eax,%r12d
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0x6,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %ebx,%eax
  add    %eax,%r12d
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0x4,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %ebx,%eax
  lea    (%r12,%rax,1),%ebx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x5c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  shl    $0x2,%eax
  add    %eax,%ebx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  add    %ebx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jle    L90
  mov    -0x54(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x58(%rbp),%eax
  add    %ecx,%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x54(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%esi
  mov    -0x58(%rbp),%eax
  add    %esi,%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %eax,%edx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%esi
  mov    -0x58(%rbp),%eax
  add    %esi,%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%rsi
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%edi
  mov    -0x58(%rbp),%eax
  add    %edi,%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  add    %ecx,%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <min@plt>
  test   %eax,%eax
  je     L89
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x5c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rsi
  mov    -0x5c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x80(%rbp),%eax
  add    $0x2,%eax
  imul   %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  add    %ecx,%eax
  test   %eax,%eax
  jne    L90
L89:
  lea    D31(%rip),%rax
  mov    %rax,%rdx
  lea    D26(%rip),%rax
  mov    %rax,%rsi
  mov    $0xf6,%edi
  mov    $0x0,%eax
  call   <errhandler@plt>
L90:
  mov    -0x50(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getcelltype@plt>
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x50(%rbp),%eax
  sar    $0xc,%eax
  and    $0xf,%eax
  cmp    $0x8,%eax
  jne    L21
  cmpl   $0x5,-0x4c(%rbp)
  je     L448
  cmpl   $0x6,-0x4c(%rbp)
  je     L448
  cmpl   $0x9,-0x4c(%rbp)
  je     L448
  cmpl   $0xa,-0x4c(%rbp)
  jne    L21
L448:
  lea    D31(%rip),%rax
  mov    %rax,%rdx
  lea    D26(%rip),%rax
  mov    %rax,%rsi
  mov    $0xfa,%edi
  mov    $0x0,%eax
  call   <errhandler@plt>
L21:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  add    $0x1,%eax
  sub    -0x58(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x50(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x54(%rbp)
L23:
  mov    -0x7c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jge    L431
  addl   $0x1,-0x58(%rbp)
L199:
  mov    -0x80(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jge    L40
  addl   $0x1,-0x5c(%rbp)
L7:
  mov    -0x84(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jge    L1
  movl   $0x0,-0x5c(%rbp)
  jmp    L227
L274:
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x20(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x20(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x5c(%rbp)
L227:
  mov    -0x84(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x5c(%rbp)
  jle    L274
  movl   $0x0,-0x60(%rbp)
  jmp    L362
L31:
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rbx
  mov    0x30(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x28(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rbx
  mov    0x30(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x28(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x60(%rbp)
L362:
  mov    -0x80(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x60(%rbp)
  jle    L31
  movl   $0x0,-0x64(%rbp)
  jmp    L130
L167:
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rbx
  mov    0x18(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rbx
  mov    0x20(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x18(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    0x20(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x64(%rbp)
L130:
  mov    -0x7c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x64(%rbp)
  jle    L167
  movl   $0x1,-0x64(%rbp)
  jmp    L131
L210:
  movl   $0x1,-0x60(%rbp)
  jmp    L166
L75:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %ebx,%ecx
  xor    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L375
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L357
L375:
  mov    0x30(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  lea    -0x3(%rax),%esi
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  and    $0x3,%eax
  mov    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    (%rsi,%rcx,1),%edx
  mov    %edx,(%rax)
L357:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  xor    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L112
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L298
L112:
  mov    0x28(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  lea    -0xc(%rax),%esi
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xc,%eax
  mov    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rsi,%rcx,1),%edx
  mov    %edx,(%rax)
L298:
  addl   $0x1,-0x60(%rbp)
L166:
  mov    -0x60(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jle    L75
  addl   $0x1,-0x64(%rbp)
L131:
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jle    L210
  movl   $0x1,-0x60(%rbp)
  jmp    L404
L394:
  movl   $0x1,-0x5c(%rbp)
  jmp    L366
L364:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  xor    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L260
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L359
L260:
  mov    -0x88(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ecx
  lea    0x0(,%rax,4),%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  lea    (%rbx,%rax,1),%r12d
  mov    -0x90(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%ebx
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  and    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%r12,%rcx,1),%edx
  mov    %edx,(%rax)
L359:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  xor    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L107
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L272
L107:
  mov    0x10(%rbp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ecx
  lea    0x0(,%rax,4),%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  lea    (%rbx,%rax,1),%r12d
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%ebx
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  and    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x7c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%r12,%rcx,1),%edx
  mov    %edx,(%rax)
L272:
  addl   $0x1,-0x5c(%rbp)
L366:
  mov    -0x5c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jle    L364
  addl   $0x1,-0x60(%rbp)
L404:
  mov    -0x60(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jle    L394
  movl   $0x1,-0x64(%rbp)
  jmp    L335
L196:
  movl   $0x1,-0x5c(%rbp)
  jmp    L264
L165:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %ebx,%ecx
  xor    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L389
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L334
L389:
  mov    0x18(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  lea    -0xc0(%rax),%esi
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xc0,%eax
  mov    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rsi,%rcx,1),%edx
  mov    %edx,(%rax)
L334:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%ebx
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  xor    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  test   %eax,%eax
  jne    L258
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ebx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%r12d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  mov    %r12d,%ecx
  and    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rbx,%rcx,1),%edx
  mov    %edx,(%rax)
  jmp    L226
L258:
  mov    0x20(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  lea    -0x30(%rax),%esi
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0x30,%eax
  mov    %eax,%ecx
  mov    -0x64(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x80(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    (%rsi,%rcx,1),%edx
  mov    %edx,(%rax)
L226:
  addl   $0x1,-0x5c(%rbp)
L264:
  mov    -0x5c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jle    L165
  addl   $0x1,-0x64(%rbp)
L335:
  mov    -0x64(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jle    L196
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L354
  call   <__stack_chk_fail@plt>
L354:
  sub    $0xffffffffffffff80,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D31
type: string
name: parse_data
arguments: data_label: D26
type: string

tool: D31: Invalid geometry! Forbidden boundary cell found.


tool: D26: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProjectBackup/init.c

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 temp, temp2;
  int tarr[] = {1, 2, 0, 3, 4, 7, 8};
  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++) {
        temp = tarr[Pic[i][j + k * (jmax + 2)]] * pow2(2, 12) + min(Pic[i + 1][j + k * (jmax + 2)] + 1, 3) * pow2(2, 10) + min(Pic[i - 1][j + k * (jmax + 2)] + 1, 3) * pow2(2, 8) + min(Pic[i][j + k * (jmax + 2) - 1] + 1, 3) * pow2(2, 6) + min(Pic[i][j + k * (jmax + 2) + 1] + 1, 3) * pow2(2, 4) + min(Pic[i][j + (k - 1) * (jmax + 2)] + 1, 3) * 4 + min(Pic[i][j + (k + 1) * (jmax + 2)] + 1, 3);
        if (Pic[i][j + k * (jmax + 2)] > 1 && (min(Pic[i][j + k * (jmax + 2) + 1] + Pic[i][j + k * (jmax + 2) - 1], Pic[i - 1][j + k * (jmax + 2)] + Pic[i + 1][j + k * (jmax + 2)]) == 0 || !(Pic[i][j + (k - 1) * (jmax + 2)] + Pic[i][j + (k + 1) * (jmax + 2)]))) {
          errhandler(246, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProjectBackup/init.c", "Invalid geometry! Forbidden boundary cell found.\n");
        }
        temp2 = getcelltype(temp) % 16;
        if ((((temp >> 12) & 15) == 8) && (temp2 == 5 || temp2 == 6 || temp2 == 9 || temp2 == 10)) {
          errhandler(250, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProjectBackup/init.c", "Invalid geometry! Forbidden boundary cell found.\n");
        }
        Flag[i][jmax + 1 - j][k] = temp;
      }
    }
  }
  for (k = 0; k < kmax + 2; k++) {
    Flag[0][0][k] = getbit(wf);
    Flag[0][jmax + 1][k] = getbit(wh);
    Flag[imax + 1][0][k] = getbit(wf);
    Flag[imax + 1][jmax + 1][k] = getbit(wh);
  }
  for (j = 0; j < jmax + 2; j++) {
    Flag[0][j][0] = getbit(wb);
    Flag[0][j][kmax + 1] = getbit(wt);
    Flag[imax + 1][j][0] = getbit(wb);
    Flag[imax + 1][j][kmax + 1] = getbit(wt);
  }
  for (i = 0; i < imax + 2; i++) {
    Flag[i][0][0] = getbit(wf);
    Flag[i][jmax + 1][0] = getbit(wh);
    Flag[i][0][kmax + 1] = getbit(wf);
    Flag[i][jmax + 1][kmax + 1] = getbit(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] = getbit(0) + (Flag[i][j][1] & (pow2(2, 12) * 15));
      } else {
        Flag[i][j][0] = (getbit(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] = getbit(0) + (Flag[i][j][kmax] & (pow2(2, 12) * 15));
      } else {
        Flag[i][j][kmax + 1] = (getbit(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] = getbit(0) + (Flag[1][j][k] & (pow2(2, 12) * 15));
      } else {
        Flag[0][j][k] = (getbit(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] = getbit(0) + (Flag[imax][j][k] & (pow2(2, 12) * 15));
      } else {
        Flag[imax + 1][j][k] = (getbit(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] = getbit(0) + (Flag[i][1][k] & (pow2(2, 12) * 15));
      } else {
        Flag[i][0][k] = (getbit(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] = getbit(0) + (Flag[i][jmax][k] & (pow2(2, 12) * 15));
      } else {
        Flag[i][jmax + 1][k] = (getbit(wh) - 16 * 3) + (Flag[i][jmax][k] & (16 * 3));
      }
    }
  }
}
```