user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<init_flag>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %esi,0x24(%rsp)
  mov    %edx,%ebx
  mov    %edx,0x48(%rsp)
  mov    %ecx,%r15d
  mov    %ecx,0x50(%rsp)
  mov    %r8,0x60(%rsp)
  mov    %r9d,0x6c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x80(%rsp)
  movl   $0x2,0x84(%rsp)
  movl   $0x0,0x88(%rsp)
  movl   $0x3,0x8c(%rsp)
  movl   $0x4,0x90(%rsp)
  movl   $0x7,0x94(%rsp)
  movl   $0x8,0x98(%rsp)
  call   <read_pgm@plt>
  mov    %eax,0x68(%rsp)
  test   %r15d,%r15d
  jle    L254
  lea    0x2(%rbx),%eax
  mov    %eax,0x78(%rsp)
  lea    (%rbx,%rbx,1),%eax
  mov    %eax,0x7c(%rsp)
  movl   $0x0,0x54(%rsp)
  movq   $0x0,0x70(%rsp)
  jmp    L301
L103:
  lea    D2(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    $0xf6,%edi
  mov    $0x0,%eax
  call   <errhandler@plt>
L221:
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <getcelltype@plt>
  mov    %ebp,%edx
  sar    $0xc,%edx
  and    $0xf,%edx
  cmp    $0x8,%edx
  je     L45
L62:
  mov    0x38(%rsp),%rax
  mov    (%rsp),%rcx
  mov    (%rax,%rcx,1),%rax
  mov    0x30(%rsp),%rcx
  mov    (%rax,%rcx,1),%rax
  mov    0x40(%rsp),%rcx
  mov    %ebp,(%rax,%rcx,1)
  add    $0x1,%r15d
  cmp    %r15d,0x24(%rsp)
  jl     L262
L214:
  mov    %r13,%r12
  mov    0x0(%r13),%rax
  movslq (%rax,%r14,1),%rax
  mov    0x80(%rsp,%rax,4),%ebx
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebx
  mov    %r13,(%rsp)
  add    $0x8,%r13
  mov    0x0(%r13),%rax
  mov    (%rax,%r14,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebp
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebp
  add    %ebx,%ebp
  mov    -0x8(%r12),%rax
  mov    (%rax,%r14,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebx
  add    %ebp,%ebx
  mov    (%r12),%rax
  mov    0x8(%rsp),%rcx
  mov    (%rax,%rcx,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebp
  mov    $0x6,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebp
  add    %ebx,%ebp
  mov    (%r12),%rax
  mov    0x10(%rsp),%rdx
  mov    (%rax,%rdx,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  mov    %eax,%ebx
  mov    $0x4,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  imul   %eax,%ebx
  add    %ebp,%ebx
  mov    (%r12),%rax
  mov    0x18(%rsp),%rsi
  mov    (%rax,%rsi,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  lea    (%rbx,%rax,4),%ebp
  mov    (%r12),%rax
  mov    0x28(%rsp),%rbx
  mov    (%rax,%rbx,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  mov    $0x0,%eax
  call   <min@plt>
  add    %eax,%ebp
  mov    (%r12),%rax
  cmpl   $0x1,(%rax,%r14,1)
  jle    L221
  mov    -0x8(%r12),%rdx
  mov    0x0(%r13),%rcx
  mov    (%rcx,%r14,1),%esi
  add    (%rdx,%r14,1),%esi
  mov    0x8(%rsp),%rcx
  mov    (%rax,%rcx,1),%edi
  mov    0x10(%rsp),%rdx
  add    (%rax,%rdx,1),%edi
  mov    $0x0,%eax
  call   <min@plt>
  test   %eax,%eax
  je     L103
  mov    (%r12),%rax
  mov    (%rax,%rbx,1),%edx
  mov    0x18(%rsp),%rsi
  add    (%rax,%rsi,1),%edx
  jne    L221
  jmp    L103
L45:
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  sub    $0x5,%eax
  test   $0xfffffffa,%eax
  jne    L62
  lea    D2(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    $0xfa,%edi
  mov    $0x0,%eax
  call   <errhandler@plt>
  jmp    L62
L262:
  mov    0x4c(%rsp),%eax
  lea    0x1(%rax),%edx
  add    $0x2,%eax
  cmp    %eax,0x48(%rsp)
  jl     L261
  mov    %edx,0x4c(%rsp)
L385:
  cmpl   $0x0,0x24(%rsp)
  jle    L262
  mov    0x5c(%rsp),%r14d
  mov    0x4c(%rsp),%eax
  add    %eax,%r14d
  movslq %r14d,%r14
  shl    $0x2,%r14
  lea    -0x4(%r14),%rcx
  mov    %rcx,0x8(%rsp)
  lea    0x4(%r14),%rcx
  mov    %rcx,0x10(%rsp)
  mov    %eax,%ecx
  mov    0x54(%rsp),%eax
  lea    0x1(%rcx,%rax,1),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x18(%rsp)
  mov    0x58(%rsp),%eax
  lea    0x1(%rcx,%rax,1),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x28(%rsp)
  mov    0x48(%rsp),%eax
  sub    %ecx,%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x30(%rsp)
  movslq 0x68(%rsp),%rax
  lea    0x8(%rax),%r13
  mov    $0x1,%r15d
  mov    0x60(%rsp),%rcx
  sub    %rax,%rcx
  mov    %rcx,0x38(%rsp)
  jmp    L214
L261:
  addq   $0x1,0x70(%rsp)
  mov    0x70(%rsp),%rax
  mov    0x78(%rsp),%edx
  add    %edx,0x54(%rsp)
  add    $0x1,%eax
  cmp    %eax,0x50(%rsp)
  jl     L220
L301:
  cmpl   $0x0,0x48(%rsp)
  jle    L261
  mov    0x54(%rsp),%eax
  mov    0x7c(%rsp),%ecx
  lea    0x4(%rax,%rcx,1),%ecx
  mov    %ecx,0x58(%rsp)
  mov    0x70(%rsp),%rcx
  lea    0x4(,%rcx,4),%rcx
  mov    %rcx,0x40(%rsp)
  movl   $0x0,0x4c(%rsp)
  mov    0x78(%rsp),%ecx
  lea    0x1(%rax,%rcx,1),%eax
  mov    %eax,0x5c(%rsp)
  jmp    L385
L254:
  mov    0x50(%rsp),%r15d
  add    $0x1,%r15d
  js     L34
  jmp    L413
L497:
  mov    0x110(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ecx
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rdx
  mov    0x4(%rdx),%eax
  and    $0x3,%eax
  lea    -0x3(%rax,%rcx,1),%eax
  mov    %eax,(%rdx)
  jmp    L393
L316:
  mov    0x108(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ecx
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rdx
  mov    (%rdx,%r15,1),%eax
  and    $0xc,%eax
  lea    -0xc(%rax,%rcx,1),%eax
  mov    (%rsp),%rcx
  mov    %eax,(%rdx,%rcx,1)
L140:
  add    $0x1,%rbp
  lea    0x1(%rbp),%eax
  cmp    %eax,0x48(%rsp)
  jl     L127
L36:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%r14d
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    %r12,%r13
  lea    0x1(%rbp),%rbx
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rax
  xor    %edx,%r14d
  and    0x4(%rax),%r14d
  jne    L497
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rax
  mov    0x4(%rax),%r14d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %r14d,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rcx)
L393:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%r14d
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rax
  xor    %edx,%r14d
  and    (%rax,%r15,1),%r14d
  jne    L316
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rax
  mov    (%rax,%r15,1),%r14d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %r14d,%eax
  add    0x8(%rsp),%eax
  mov    (%rsp),%rdx
  mov    %eax,(%rcx,%rdx,1)
  jmp    L140
L127:
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%eax
  add    $0x8,%r12
  cmp    %eax,0x24(%rsp)
  jl     L333
L409:
  mov    $0x0,%ebp
  cmpl   $0x0,0x48(%rsp)
  jg     L36
  jmp    L127
L87:
  mov    0x6c(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%r13d
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %r13d,%eax
  mov    %eax,0x8(%rsp)
  mov    0x8(%r14),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%rbp,4),%r13d
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    (%r14),%rdx
  mov    (%rdx,%rbx,1),%rdx
  lea    (%rax,%rax,2),%eax
  and    %r13d,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rdx,%rbp,4)
  jmp    L310
L482:
  mov    0xf0(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%r13d
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %r13d,%eax
  mov    %eax,0x8(%rsp)
  mov    (%r15),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%rbp,4),%r13d
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    (%rsp),%rcx
  mov    (%rcx),%rdx
  mov    (%rdx,%rbx,1),%rdx
  lea    (%rax,%rax,2),%eax
  and    %r13d,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rdx,%rbp,4)
L454:
  add    $0x1,%r12
  lea    0x1(%r12),%eax
  cmp    0x50(%rsp),%eax
  jg     L462
L401:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%r13d
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  lea    0x1(%r12),%rbp
  mov    0x8(%r14),%rax
  mov    (%rax,%rbx,1),%rax
  xor    %edx,%r13d
  and    0x4(%rax,%r12,4),%r13d
  jne    L87
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    0x8(%r14),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%rbp,4),%r13d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%r14),%rax
  mov    (%rax,%rbx,1),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %r13d,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rcx,%rbp,4)
L310:
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%r13d
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%r15),%rax
  mov    (%rax,%rbx,1),%rax
  xor    %edx,%r13d
  and    (%rax,%rbp,4),%r13d
  jne    L482
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    (%r15),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%rbp,4),%r13d
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%rsp),%rcx
  mov    (%rcx),%rax
  mov    (%rax,%rbx,1),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %r13d,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rcx,%rbp,4)
  jmp    L454
L462:
  addq   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%rax
  add    $0x1,%eax
  cmp    0x48(%rsp),%eax
  jg     L24
L80:
  mov    0x10(%rsp),%rax
  lea    0x8(,%rax,8),%rbx
  mov    $0x0,%r12d
  cmpl   $0x0,0x50(%rsp)
  jg     L401
  jmp    L462
L24:
  cmpl   $0x0,0x24(%rsp)
  jle    L12
L181:
  movslq 0x48(%rsp),%r14
  shl    $0x3,%r14
  lea    0x8(%r14),%rax
  mov    %rax,(%rsp)
  mov    0x60(%rsp),%r12
  add    $0x8,%r12
  movl   $0x1,0x10(%rsp)
  jmp    L328
L522:
  mov    0xf8(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ecx
  mov    (%r12),%rax
  mov    (%rax),%rdx
  mov    0x8(%rax),%rax
  mov    (%rax,%r13,4),%eax
  and    $0xc0,%eax
  lea    -0xc0(%rax,%rcx,1),%eax
  mov    %eax,(%rdx,%r13,4)
  jmp    L339
L252:
  mov    0x100(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,%ecx
  mov    (%r15),%rax
  mov    (%rsp),%rdx
  mov    (%rax,%rdx,1),%rdx
  mov    (%rax,%r14,1),%rax
  mov    (%rax,%r13,4),%eax
  and    $0x30,%eax
  lea    -0x30(%rax,%rcx,1),%eax
  mov    %eax,(%rdx,%r13,4)
L138:
  add    $0x1,%rbp
  lea    0x1(%rbp),%eax
  cmp    0x50(%rsp),%eax
  jg     L64
L415:
  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    %eax,%edx
  mov    %r12,%r15
  lea    0x1(%rbp),%r13
  mov    (%r12),%rax
  mov    0x8(%rax),%rax
  xor    %edx,%ebx
  and    0x4(%rax,%rbp,4),%ebx
  jne    L522
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    (%r12),%rax
  mov    0x8(%rax),%rax
  mov    (%rax,%r13,4),%ebx
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%r12),%rax
  mov    (%rax),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %ebx,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rcx,%r13,4)
L339:
  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    %eax,%edx
  mov    (%r15),%rax
  mov    (%rax,%r14,1),%rax
  xor    %edx,%ebx
  and    (%rax,%r13,4),%ebx
  jne    L252
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,0x8(%rsp)
  mov    (%r15),%rax
  mov    (%rax,%r14,1),%rax
  mov    (%rax,%r13,4),%ebx
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <pow2@plt>
  mov    %eax,%edx
  mov    (%r15),%rax
  mov    (%rsp),%rcx
  mov    (%rax,%rcx,1),%rcx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  and    %ebx,%eax
  add    0x8(%rsp),%eax
  mov    %eax,(%rcx,%r13,4)
  jmp    L138
L64:
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%eax
  add    $0x8,%r12
  cmp    %eax,0x24(%rsp)
  jl     L12
L328:
  mov    $0x0,%ebp
  cmpl   $0x0,0x50(%rsp)
  jg     L415
  jmp    L64
L333:
  cmpl   $0x0,0x48(%rsp)
  jle    L181
L487:
  movslq 0x24(%rsp),%rax
  shl    $0x3,%rax
  mov    0x60(%rsp),%rcx
  lea    (%rcx,%rax,1),%r14
  lea    0x8(%rcx,%rax,1),%rax
  mov    %rax,(%rsp)
  movq   $0x0,0x10(%rsp)
  mov    %r14,%r15
  mov    %rcx,%r14
  jmp    L80
L21:
  cmpl   $0x0,0x48(%rsp)
  jg     L487
L12:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L185
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L220:
  mov    0x50(%rsp),%eax
  lea    0x1(%rax),%r15d
L413:
  movslq 0x48(%rsp),%rax
  lea    0x8(,%rax,8),%r14
  movslq 0x24(%rsp),%rax
  mov    0x60(%rsp),%r13
  lea    0x8(%r13,%rax,8),%r12
  mov    $0x0,%ebp
  mov    %r15d,(%rsp)
L298:
  lea    0x0(,%rbp,4),%rbx
  mov    0x0(%r13),%rax
  mov    %rbx,%r15
  add    (%rax),%r15
  mov    0xf8(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%r13),%rax
  mov    %rbx,%r15
  add    (%rax,%r14,1),%r15
  mov    0x100(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    (%r12),%rax
  mov    %rbx,%r15
  add    (%rax),%r15
  mov    0xf8(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    (%r12),%rax
  add    (%rax,%r14,1),%rbx
  mov    0x100(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%rbx)
  add    $0x1,%rbp
  cmp    %ebp,(%rsp)
  jge    L298
L34:
  cmpl   $0xffffffff,0x48(%rsp)
  jl     L85
  movslq 0x50(%rsp),%rax
  lea    0x4(,%rax,4),%r12
  movslq 0x24(%rsp),%rax
  mov    0x60(%rsp),%r13
  lea    0x8(%r13,%rax,8),%rbp
  mov    $0x0,%ebx
  mov    0x110(%rsp),%r14d
L528:
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%r15
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%r13),%rax
  mov    %r12,%r15
  add    (%rax,%rbx,8),%r15
  mov    0x108(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%rbp),%rax
  mov    (%rax,%rbx,8),%r15
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%rbp),%rax
  mov    %r12,%r15
  add    (%rax,%rbx,8),%r15
  mov    0x108(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  add    $0x1,%rbx
  lea    -0x1(%rbx),%eax
  cmp    %eax,0x48(%rsp)
  jge    L528
L85:
  cmpl   $0xffffffff,0x24(%rsp)
  jl     L509
  movslq 0x48(%rsp),%rax
  lea    0x8(,%rax,8),%r12
  movslq 0x50(%rsp),%rax
  lea    0x4(,%rax,4),%rbp
  mov    $0x0,%ebx
  mov    0x60(%rsp),%r13
  mov    0x100(%rsp),%r14d
L537:
  mov    0x0(%r13,%rbx,8),%rax
  mov    (%rax),%r15
  mov    0xf8(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%r13,%rbx,8),%rax
  mov    (%rax,%r12,1),%r15
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%r13,%rbx,8),%rax
  mov    %rbp,%r15
  add    (%rax),%r15
  mov    0xf8(%rsp),%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  mov    0x0(%r13,%rbx,8),%rax
  mov    %rbp,%r15
  add    (%rax,%r12,1),%r15
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <getbit@plt>
  mov    %eax,(%r15)
  add    $0x1,%rbx
  lea    -0x1(%rbx),%eax
  cmp    %eax,0x24(%rsp)
  jge    L537
L509:
  cmpl   $0x0,0x24(%rsp)
  jle    L21
  movslq 0x50(%rsp),%rax
  lea    0x0(,%rax,4),%r15
  lea    0x4(%r15),%rax
  mov    %rax,(%rsp)
  mov    0x60(%rsp),%rax
  lea    0x8(%rax),%r12
  movl   $0x1,0x10(%rsp)
  jmp    L409
L185:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D2
datatype: string
name: read_data
arguments: tag: D22
datatype: string

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


tool: D22: /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));
      }
    }
  }
}
```