user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<init_flag>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0xc8,%rsp
  movdqa D8(%rip),%xmm0
  mov    %edx,0x44(%rsp)
  mov    %esi,0x40(%rsp)
  mov    %ecx,0x4c(%rsp)
  mov    %r8,0x80(%rsp)
  mov    %r9d,0x68(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  mov    D47(%rip),%rax
  movl   $0x8,0xa8(%rsp)
  movaps %xmm0,0x90(%rsp)
  mov    %rax,0xa0(%rsp)
  xor    %eax,%eax
  call   <read_pgm@plt>
  mov    %eax,%edx
  lea    0x1(%rbx),%eax
  mov    %eax,0x88(%rsp)
  test   %ebx,%ebx
  jle    L487
  mov    0x44(%rsp),%eax
  test   %eax,%eax
  jle    L51
  mov    0x40(%rsp),%r10d
  test   %r10d,%r10d
  jle    L51
  add    $0x2,%eax
  movl   $0x0,0x70(%rsp)
  lea    (%rax,%rax,1),%ecx
  mov    %eax,0x8c(%rsp)
  mov    %ecx,0x74(%rsp)
  movslq %edx,%rcx
  mov    %rcx,0x50(%rsp)
  mov    %eax,0x6c(%rsp)
  xor    %eax,%eax
  nopl   0x0(%rax)
L196:
  movslq 0x6c(%rsp),%rcx
  add    $0x1,%rax
  movslq 0x70(%rsp),%rdx
  movl   $0x0,0x48(%rsp)
  mov    %rax,0x78(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x30(%rsp)
  lea    0x8(,%rcx,4),%rax
  sub    %rcx,%rdx
  mov    %rax,0x8(%rsp)
  movslq 0x74(%rsp),%rax
  sub    %rcx,%rax
  lea    -0x4(,%rdx,4),%rcx
  lea    -0x4(,%rax,4),%rax
  mov    %rcx,0x60(%rsp)
  mov    %rax,0x58(%rsp)
  mov    0x80(%rsp),%rax
  sub    0x50(%rsp),%rax
  mov    %rax,0x38(%rsp)
  nopl   0x0(%rax,%rax,1)
L253:
  mov    0x8(%rsp),%rax
  mov    $0x1,%r13d
  lea    -0x8(%rax),%rcx
  lea    -0x4(%rax),%r12
  mov    %rcx,0x10(%rsp)
  mov    0x60(%rsp),%rcx
  add    %rax,%rcx
  mov    %rcx,0x28(%rsp)
  mov    0x58(%rsp),%rcx
  add    %rax,%rcx
  mov    0x44(%rsp),%eax
  sub    0x48(%rsp),%eax
  cltq
  mov    %rcx,0x18(%rsp)
  shl    $0x3,%rax
  mov    %rax,0x20(%rsp)
  mov    0x50(%rsp),%rax
  lea    0x8(%rax),%r14
  jmp    L151
L430:
  mov    %ebx,%edi
  xor    %eax,%eax
  call   <getcelltype@plt>
  mov    %ebx,%edx
  sar    $0xc,%edx
  and    $0xf,%edx
  cmp    $0x8,%edx
  je     L320
L360:
  mov    (%rsp),%rcx
  mov    0x38(%rsp),%rax
  add    $0x1,%r13d
  mov    (%rax,%rcx,1),%rax
  mov    0x20(%rsp),%rcx
  mov    (%rax,%rcx,1),%rax
  mov    0x30(%rsp),%rcx
  mov    %ebx,(%rax,%rcx,1)
  cmp    %r13d,0x40(%rsp)
  jl     L492
L151:
  mov    (%r14),%rax
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %r14,%r15
  movslq (%rax,%r12,1),%rax
  mov    0x90(%rsp,%rax,4),%ebx
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %r14,(%rsp)
  add    $0x8,%r14
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r14),%rax
  mov    (%rax,%r12,1),%edi
  xor    %eax,%eax
  add    $0x1,%edi
  call   <min@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0x3,%esi
  imul   %eax,%ebp
  mov    -0x8(%r15),%rax
  mov    (%rax,%r12,1),%edi
  xor    %eax,%eax
  add    %ebx,%ebp
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <pow2@plt>
  mov    0x10(%rsp),%rcx
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r15),%rax
  mov    (%rax,%rcx,1),%edi
  xor    %eax,%eax
  add    %ebp,%ebx
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x6,%esi
  mov    $0x2,%edi
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <pow2@plt>
  mov    0x8(%rsp),%rdx
  mov    $0x3,%esi
  imul   %eax,%ebp
  mov    (%r15),%rax
  mov    (%rax,%rdx,1),%edi
  xor    %eax,%eax
  add    %ebx,%ebp
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x4,%esi
  mov    $0x2,%edi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r15),%rax
  add    %ebp,%ebx
  mov    0x28(%rsp),%rbp
  mov    (%rax,%rbp,1),%edi
  add    $0x1,%edi
  xor    %eax,%eax
  call   <min@plt>
  mov    0x18(%rsp),%rsi
  lea    (%rbx,%rax,4),%ebx
  mov    (%r15),%rax
  mov    (%rax,%rsi,1),%edi
  xor    %eax,%eax
  mov    $0x3,%esi
  add    $0x1,%edi
  call   <min@plt>
  add    %eax,%ebx
  mov    (%r15),%rax
  cmpl   $0x1,(%rax,%r12,1)
  jle    L430
  mov    -0x8(%r15),%rdi
  mov    (%r14),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsi,%r12,1),%esi
  add    (%rdi,%r12,1),%esi
  mov    (%rax,%rcx,1),%edi
  add    (%rax,%rdx,1),%edi
  xor    %eax,%eax
  call   <min@plt>
  test   %eax,%eax
  je     L11
  mov    (%r15),%rax
  mov    0x18(%rsp),%rsi
  mov    (%rax,%rsi,1),%edx
  add    (%rax,%rbp,1),%edx
  jne    L430
L11:
  lea    D53(%rip),%rdx
  lea    D41(%rip),%rsi
  mov    $0xf6,%edi
  xor    %eax,%eax
  call   <errhandler@plt>
  jmp    L430
  nopl   0x0(%rax)
L320:
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  sub    $0x5,%eax
  and    $0xfffffffa,%eax
  jne    L360
  lea    D53(%rip),%rdx
  lea    D41(%rip),%rsi
  mov    $0xfa,%edi
  xor    %eax,%eax
  call   <errhandler@plt>
  jmp    L360
  cs nopw 0x0(%rax,%rax,1)
L492:
  mov    0x48(%rsp),%eax
  addq   $0x4,0x8(%rsp)
  lea    0x1(%rax),%edx
  add    $0x2,%eax
  cmp    0x44(%rsp),%eax
  jg     L265
  mov    %edx,0x48(%rsp)
  jmp    L253
  nop
L265:
  mov    0x78(%rsp),%rax
  mov    0x8c(%rsp),%ecx
  add    %ecx,0x6c(%rsp)
  add    %ecx,0x70(%rsp)
  lea    0x1(%rax),%edx
  add    %ecx,0x74(%rsp)
  cmp    %edx,0x4c(%rsp)
  jge    L196
L51:
  movslq 0x44(%rsp),%rax
  mov    0x80(%rsp),%r14
  xor    %edx,%edx
  mov    0x108(%rsp),%r15d
  mov    0x110(%rsp),%r13d
  lea    0x8(,%rax,8),%r12
  movslq 0x40(%rsp),%rax
  lea    0x8(%r14,%rax,8),%rbp
  cs nopw 0x0(%rax,%rax,1)
L193:
  mov    (%r14),%rax
  lea    0x0(,%rdx,4),%rbx
  mov    %r15d,%edi
  mov    %rdx,0x8(%rsp)
  mov    (%rax),%rcx
  xor    %eax,%eax
  add    %rbx,%rcx
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r13d,%edi
  mov    %eax,(%rcx)
  mov    (%r14),%rax
  mov    (%rax,%r12,1),%rcx
  xor    %eax,%eax
  add    %rbx,%rcx
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r15d,%edi
  mov    %eax,(%rcx)
  mov    0x0(%rbp),%rax
  mov    (%rax),%rcx
  xor    %eax,%eax
  add    %rbx,%rcx
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r13d,%edi
  mov    %eax,(%rcx)
  mov    0x0(%rbp),%rax
  add    (%rax,%r12,1),%rbx
  xor    %eax,%eax
  call   <getbit@plt>
  mov    0x8(%rsp),%rdx
  mov    %eax,(%rbx)
  add    $0x1,%rdx
  cmp    %edx,0x88(%rsp)
  jge    L193
L393:
  cmpl   $0xffffffff,0x44(%rsp)
  jl     L176
  movslq 0x88(%rsp),%rbp
  movslq 0x40(%rsp),%rax
  xor    %ebx,%ebx
  mov    0x80(%rsp),%r13
  mov    0x118(%rsp),%r14d
  mov    0x120(%rsp),%r15d
  shl    $0x2,%rbp
  lea    0x8(%r13,%rax,8),%r12
  nopl   0x0(%rax,%rax,1)
L370:
  mov    0x0(%r13),%rax
  mov    %r15d,%edi
  mov    (%rax,%rbx,8),%rdx
  xor    %eax,%eax
  mov    %rdx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rdx
  mov    %r14d,%edi
  mov    %eax,(%rdx)
  mov    0x0(%r13),%rax
  mov    (%rax,%rbx,8),%rdx
  xor    %eax,%eax
  add    %rbp,%rdx
  mov    %rdx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rdx
  mov    %r15d,%edi
  mov    %eax,(%rdx)
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rdx
  xor    %eax,%eax
  mov    %rdx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rdx
  mov    %r14d,%edi
  mov    %eax,(%rdx)
  mov    (%r12),%rax
  mov    (%rax,%rbx,8),%rdx
  xor    %eax,%eax
  add    $0x1,%rbx
  add    %rbp,%rdx
  mov    %rdx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rdx
  mov    %eax,(%rdx)
  lea    -0x1(%rbx),%eax
  cmp    %eax,0x44(%rsp)
  jge    L370
L176:
  cmpl   $0xffffffff,0x40(%rsp)
  jl     L202
  movslq 0x44(%rsp),%rax
  movslq 0x88(%rsp),%rbx
  xor    %r12d,%r12d
  mov    0x80(%rsp),%r13
  mov    0x108(%rsp),%r14d
  mov    0x110(%rsp),%r15d
  lea    0x8(,%rax,8),%rbp
  shl    $0x2,%rbx
  cs nopw 0x0(%rax,%rax,1)
L163:
  mov    0x0(%r13,%r12,8),%rax
  mov    %r14d,%edi
  mov    (%rax),%rcx
  xor    %eax,%eax
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r15d,%edi
  mov    %eax,(%rcx)
  mov    0x0(%r13,%r12,8),%rax
  mov    (%rax,%rbp,1),%rcx
  xor    %eax,%eax
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r14d,%edi
  mov    %eax,(%rcx)
  mov    0x0(%r13,%r12,8),%rax
  mov    (%rax),%rcx
  xor    %eax,%eax
  add    %rbx,%rcx
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %r15d,%edi
  mov    %eax,(%rcx)
  mov    0x0(%r13,%r12,8),%rax
  add    $0x1,%r12
  mov    (%rax,%rbp,1),%rcx
  xor    %eax,%eax
  add    %rbx,%rcx
  mov    %rcx,(%rsp)
  call   <getbit@plt>
  mov    (%rsp),%rcx
  mov    %eax,(%rcx)
  lea    -0x1(%r12),%eax
  cmp    0x40(%rsp),%eax
  jle    L163
L202:
  mov    0x40(%rsp),%r8d
  test   %r8d,%r8d
  jle    L365
  movslq 0x4c(%rsp),%rbp
  mov    0x44(%rsp),%edi
  shl    $0x2,%rbp
  lea    0x4(%rbp),%r14
  test   %edi,%edi
  jle    L384
  mov    0x80(%rsp),%rax
  movl   $0x1,(%rsp)
  lea    0x8(%rax),%r15
  mov    %r15,%r13
  nopl   0x0(%rax,%rax,1)
L105:
  xor    %ebx,%ebx
  mov    %r13,%r15
  jmp    L189
  nopw   0x0(%rax,%rax,1)
L457:
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rax
  mov    0x4(%rax),%r13d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r13d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx)
L378:
  mov    $0xc,%esi
  mov    $0x2,%edi
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbx,8),%rax
  and    (%rax,%rbp,1),%r12d
  jne    L472
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rax
  mov    (%rax,%rbp,1),%r13d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r13d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx,%r14,1)
  lea    0x1(%rbx),%eax
  cmp    %eax,0x44(%rsp)
  jl     L150
L189:
  mov    $0xc,%esi
  mov    $0x2,%edi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbx,8),%rax
  and    0x4(%rax),%r12d
  je     L457
  mov    0x120(%rsp),%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax,%rbx,8),%rcx
  mov    0x4(%rcx),%eax
  and    $0x3,%eax
  lea    -0x3(%rax,%r8,1),%eax
  mov    %eax,(%rcx)
  jmp    L378
  nopl   0x0(%rax,%rax,1)
L472:
  mov    0x118(%rsp),%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    %eax,%r8d
  mov    (%r15),%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    %eax,0x44(%rsp)
  jge    L189
L150:
  mov    %r15,%r13
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  add    $0x8,%r13
  cmp    %eax,0x40(%rsp)
  jge    L105
L332:
  movslq 0x40(%rsp),%rax
  mov    0x80(%rsp),%rcx
  shl    $0x3,%rax
  lea    (%rcx,%rax,1),%r13
  lea    0x8(%rcx,%rax,1),%r14
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L204
  mov    %r14,(%rsp)
  mov    0x80(%rsp),%r14
  xor    %edx,%edx
L306:
  lea    0x1(%rdx),%rax
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    0x0(,%rax,8),%rbp
  jmp    L32
  nopl   0x0(%rax)
L40:
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    0x8(%r14),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r15d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r14),%rax
  mov    (%rax,%rbp,1),%rdx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  add    %r12d,%eax
  mov    %eax,(%rdx,%rbx,4)
L380:
  mov    $0xc,%esi
  mov    $0x2,%edi
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x0(%r13),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbp,1),%rax
  and    (%rax,%rbx,4),%r12d
  jne    L514
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r15d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%rsp),%rax
  mov    (%rax),%rax
  mov    (%rax,%rbp,1),%rdx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r15d,%eax
  mov    %rbx,%r15
  add    %r12d,%eax
  mov    %eax,(%rdx,%rbx,4)
  lea    0x1(%rbx),%eax
  cmp    %eax,0x4c(%rsp)
  jl     L152
L32:
  mov    $0xc,%esi
  mov    $0x2,%edi
  lea    0x1(%r15),%rbx
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    0x8(%r14),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbp,1),%rax
  and    0x4(%rax,%r15,4),%r12d
  je     L40
  mov    0x68(%rsp),%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %eax,%r12d
  mov    0x8(%r14),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r15d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    (%r14),%rdx
  lea    (%rax,%rax,2),%eax
  mov    (%rdx,%rbp,1),%rdx
  and    %r15d,%eax
  add    %r12d,%eax
  mov    %eax,(%rdx,%rbx,4)
  jmp    L380
  nopl   (%rax)
L514:
  mov    0x100(%rsp),%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  lea    0x0(,%rax,4),%edx
  sub    %edx,%eax
  add    %eax,%r12d
  mov    0x0(%r13),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r15d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    (%rsp),%rcx
  lea    (%rax,%rax,2),%eax
  mov    (%rcx),%rdx
  and    %r15d,%eax
  mov    %rbx,%r15
  add    %r12d,%eax
  mov    (%rdx,%rbp,1),%rdx
  mov    %eax,(%rdx,%rbx,4)
  lea    0x1(%rbx),%eax
  cmp    %eax,0x4c(%rsp)
  jge    L32
L152:
  mov    0x8(%rsp),%rdx
  lea    0x1(%rdx),%eax
  cmp    %eax,0x44(%rsp)
  jge    L306
  movslq 0x44(%rsp),%rbp
  mov    0x40(%rsp),%ecx
  shl    $0x3,%rbp
  lea    0x8(%rbp),%r13
  test   %ecx,%ecx
  jle    L204
L454:
  mov    0x80(%rsp),%r14
  movl   $0x1,(%rsp)
  add    $0x8,%r14
  mov    %r14,%r15
  nopl   0x0(%rax,%rax,1)
L38:
  xor    %r14d,%r14d
  jmp    L199
L313:
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r15),%rax
  mov    0x8(%rax),%rax
  mov    (%rax,%rbx,4),%r14d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r14d,%eax
  add    %r12d,%eax
  mov    %eax,(%rcx,%rbx,4)
L397:
  mov    $0xc,%esi
  mov    $0x2,%edi
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  xor    %r8d,%r12d
  mov    (%rax,%rbp,1),%rax
  and    (%rax,%rbx,4),%r12d
  jne    L357
  xor    %edi,%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    $0xc,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  mov    (%r15),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,4),%r14d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax,%r13,1),%rcx
  mov    %r8d,%eax
  shl    $0x4,%eax
  sub    %r8d,%eax
  and    %r14d,%eax
  mov    %rbx,%r14
  add    %r12d,%eax
  mov    %eax,(%rcx,%rbx,4)
  lea    0x1(%rbx),%eax
  cmp    %eax,0x4c(%rsp)
  jl     L417
L199:
  mov    $0xc,%esi
  mov    $0x2,%edi
  lea    0x1(%r14),%rbx
  xor    %eax,%eax
  call   <pow2@plt>
  mov    $0xd,%esi
  mov    $0x2,%edi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <pow2@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  xor    %r8d,%r12d
  mov    0x8(%rax),%rax
  and    0x4(%rax,%r14,4),%r12d
  je     L313
  mov    0x108(%rsp),%edi
  xor    %eax,%eax
  call   <getbit@plt>
  mov    %eax,%r8d
  mov    (%r15),%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    L397
  nopw   0x0(%rax,%rax,1)
L357:
  mov    0x110(%rsp),%edi
  xor    %eax,%eax
  mov    %rbx,%r14
  call   <getbit@plt>
  mov    %eax,%r8d
  mov    (%r15),%rax
  mov    (%rax,%r13,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,0x4c(%rsp)
  jge    L199
L417:
  addl   $0x1,(%rsp)
  add    $0x8,%r15
  mov    (%rsp),%eax
  cmp    %eax,0x40(%rsp)
  jge    L38
L204:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L467
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L487:
  mov    0x88(%rsp),%r9d
  test   %r9d,%r9d
  js     L393
  jmp    L51
  nopw   0x0(%rax,%rax,1)
L365:
  mov    0x44(%rsp),%esi
  test   %esi,%esi
  jg     L332
  jmp    L204
L384:
  movslq 0x44(%rsp),%rbp
  mov    0x4c(%rsp),%edx
  shl    $0x3,%rbp
  lea    0x8(%rbp),%r13
  test   %edx,%edx
  jg     L454
  jmp    L204
L467:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D8
type: byte[16]
name: parse_data
arguments: tag: D47
type: byte[8]
name: parse_data
arguments: tag: D53
type: string
name: parse_data
arguments: tag: D41
type: string

tool: {"D8": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D47": [0x04,0x00,0x00,0x00,0x07,0x00,0x00,0x00]}

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


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