user: 请将以下的汇编代码转换成C语言代码:

```asm
<createflag>:
  endbr64
  push   %r15
  movslq %esi,%rsi
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  lea    0x0(,%rsi,8),%rbp
  mov    $0xc,%esi
  push   %rbx
  lea    (%rdi,%rbp,1),%r15
  mov    $0x2,%edi
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  movabs $0x200000001,%rax
  movl   $0x8,0x38(%rsp)
  mov    %rax,0x20(%rsp)
  movabs $0x300000000,%rax
  mov    %rax,0x28(%rsp)
  movabs $0x700000004,%rax
  mov    %rax,0x30(%rsp)
  lea    0x2(%r9),%eax
  imul   %eax,%ecx
  mov    %eax,0x10(%rsp)
  mov    (%r15),%rax
  add    %ecx,%edx
  mov    %ecx,0x14(%rsp)
  movslq %edx,%r14
  movslq (%rax,%r14,4),%rax
  lea    0x0(,%r14,4),%rcx
  mov    %rcx,(%rsp)
  mov    0x20(%rsp,%rax,4),%ebx
  call   <pow2@plt>
  lea    0x8(%r13,%rbp,1),%r9
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r9),%rax
  mov    %r9,0x18(%rsp)
  mov    (%rax,%r14,4),%edi
  mov    %ebx,0x8(%rsp)
  add    $0x1,%edi
  call   <min@plt>
  mov    $0xa,%esi
  mov    $0x2,%edi
  mov    %eax,%ebx
  call   <pow2@plt>
  lea    -0x8(%r13,%rbp,1),%r8
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r8),%rax
  add    0x8(%rsp),%ebx
  mov    %r8,0x8(%rsp)
  mov    (%rax,%r14,4),%edi
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x8,%esi
  mov    $0x2,%edi
  mov    %eax,%ebp
  call   <pow2@plt>
  mov    (%rsp),%r13
  mov    $0x3,%esi
  imul   %eax,%ebp
  mov    (%r15),%rax
  mov    -0x4(%rax,%r13,1),%edi
  add    %ebp,%ebx
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x6,%esi
  mov    $0x2,%edi
  mov    %eax,%ebp
  call   <pow2@plt>
  mov    $0x3,%esi
  mov    %r13,(%rsp)
  imul   %eax,%ebp
  mov    (%r15),%rax
  mov    0x4(%rax,%r13,1),%edi
  add    %ebx,%ebp
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x4,%esi
  mov    $0x2,%edi
  mov    %eax,%ebx
  call   <pow2@plt>
  mov    0x14(%rsp),%r10d
  sub    0x10(%rsp),%r10d
  mov    $0x3,%esi
  imul   %eax,%ebx
  mov    (%r15),%rax
  mov    %r10d,%r13d
  add    %ebp,%ebx
  lea    (%r10,%r12,1),%ebp
  movslq %ebp,%rbp
  mov    (%rax,%rbp,4),%edi
  add    $0x1,%edi
  call   <min@plt>
  mov    $0x3,%esi
  lea    (%rbx,%rax,4),%ebx
  mov    0x10(%rsp),%eax
  lea    0x0(%r13,%rax,2),%eax
  add    %eax,%r12d
  mov    (%r15),%rax
  movslq %r12d,%r12
  mov    (%rax,%r12,4),%edi
  add    $0x1,%edi
  call   <min@plt>
  lea    (%rbx,%rax,1),%r13d
  mov    (%r15),%rax
  cmpl   $0x1,(%rax,%r14,4)
  jg     L8
L62:
  mov    %r13d,%edi
  call   <getboundarytype@plt>
  mov    %r13d,%edx
  sar    $0xc,%edx
  and    $0xf,%edx
  cmp    $0x8,%edx
  je     L20
L67:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  add    $0x58,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L8:
  mov    0x8(%rsp),%r8
  mov    0x18(%rsp),%r9
  mov    (%rsp),%rcx
  mov    (%r8),%rdi
  mov    (%r9),%rsi
  mov    (%rsi,%r14,4),%esi
  add    (%rdi,%r14,4),%esi
  mov    -0x4(%rax,%rcx,1),%edi
  add    0x4(%rax,%rcx,1),%edi
  call   <min@plt>
  test   %eax,%eax
  je     L10
  mov    (%r15),%rax
  mov    (%rax,%r12,4),%edx
  add    (%rax,%rbp,4),%edx
  jne    L62
L10:
  lea    D18(%rip),%rdx
  lea    D8(%rip),%rsi
  mov    $0x13,%edi
  call   <errhandler@plt>
  jmp    L62
  cs nopw 0x0(%rax,%rax,1)
L20:
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  sub    $0x5,%eax
  and    $0xfffffffa,%eax
  jne    L67
  lea    D18(%rip),%rdx
  lea    D8(%rip),%rsi
  mov    $0x17,%edi
  call   <errhandler@plt>
  jmp    L67
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D18
type_infered: string
name: extract_symbolic_data
arguments: data_label: D8
type_infered: string

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


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

assistant: ```c
int createflag(int **Pic, int i, int j, int k, int imax, int jmax, int kmax) {
  int temp, temp2;
  const int tarr[] = {1, 2, 0, 3, 4, 7, 8};
  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(19, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProject/helper.c", "Invalid geometry! Forbidden boundary cell found.\n");
  }
  temp2 = getboundarytype(temp) % 16;
  if ((((temp >> 12) & 15) == 8) && (temp2 == 5 || temp2 == 6 || temp2 == 9 || temp2 == 10)) {
    errhandler(23, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProject/helper.c", "Invalid geometry! Forbidden boundary cell found.\n");
  }
  return temp;
}
```