user: 请从给定的汇编指令推导出C源代码：

```asm
<createflag>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x20(%rsp)
  movl   $0x2,0x24(%rsp)
  movl   $0x0,0x28(%rsp)
  movl   $0x3,0x2c(%rsp)
  movl   $0x4,0x30(%rsp)
  movl   $0x7,0x34(%rsp)
  movl   $0x8,0x38(%rsp)
  movslq %esi,%rsi
  lea    0x0(,%rsi,8),%rbp
  mov    %rdi,0x8(%rsp)
  lea    (%rdi,%rbp,1),%r12
  lea    0x2(%r9),%r13d
  imul   %r13d,%ecx
  mov    %ecx,0x18(%rsp)
  mov    %ecx,%ebx
  mov    %edx,(%rsp)
  add    %edx,%ebx
  movslq %ebx,%rbx
  lea    0x0(,%rbx,4),%r14
  mov    (%r12),%rax
  movslq (%rax,%rbx,4),%rax
  mov    0x20(%rsp,%rax,4),%r15d
  mov    $0xc,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  imul   %eax,%r15d
  mov    %r15d,0x10(%rsp)
  mov    0x8(%rsp),%rdi
  lea    0x8(%rdi,%rbp,1),%r15
  mov    (%r15),%rax
  mov    (%rax,%rbx,4),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    %eax,0x1c(%rsp)
  mov    $0xa,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  imul   0x1c(%rsp),%eax
  add    0x10(%rsp),%eax
  mov    %eax,0x10(%rsp)
  mov    0x8(%rsp),%rdi
  lea    -0x8(%rdi,%rbp,1),%rbp
  mov    0x0(%rbp),%rax
  mov    (%rax,%rbx,4),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    %eax,0x8(%rsp)
  mov    $0x8,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  imul   0x8(%rsp),%eax
  mov    %eax,%ecx
  add    0x10(%rsp),%ecx
  mov    %ecx,0x8(%rsp)
  mov    (%r12),%rax
  mov    -0x4(%rax,%r14,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    %eax,0x10(%rsp)
  mov    $0x6,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  imul   0x10(%rsp),%eax
  add    0x8(%rsp),%eax
  mov    %eax,0x8(%rsp)
  mov    (%r12),%rax
  mov    0x4(%rax,%r14,1),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    %eax,0x10(%rsp)
  mov    $0x4,%esi
  mov    $0x2,%edi
  call   <pow2@plt>
  imul   0x10(%rsp),%eax
  mov    %eax,%ecx
  add    0x8(%rsp),%ecx
  mov    %ecx,0x8(%rsp)
  mov    0x18(%rsp),%eax
  sub    %r13d,%eax
  mov    %eax,0x18(%rsp)
  add    (%rsp),%eax
  movslq %eax,%rsi
  mov    (%r12),%rax
  mov    %rsi,0x10(%rsp)
  mov    (%rax,%rsi,4),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    0x8(%rsp),%ecx
  lea    (%rcx,%rax,4),%ecx
  mov    %ecx,0x8(%rsp)
  mov    0x18(%rsp),%eax
  lea    (%rax,%r13,2),%eax
  add    (%rsp),%eax
  cltq
  mov    %rax,%rdx
  mov    (%r12),%rax
  mov    %rdx,(%rsp)
  mov    (%rax,%rdx,4),%edi
  add    $0x1,%edi
  mov    $0x3,%esi
  call   <min@plt>
  mov    0x8(%rsp),%ecx
  lea    (%rcx,%rax,1),%r13d
  mov    (%r12),%rax
  cmpl   $0x1,(%rax,%rbx,4)
  jg     L53
L26:
  mov    %r13d,%edi
  call   <getboundarytype@plt>
  mov    %r13d,%edx
  sar    $0xc,%edx
  and    $0xf,%edx
  cmp    $0x8,%edx
  je     L57
L34:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  mov    %r13d,%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  mov    0x0(%rbp),%rdx
  mov    (%r15),%rcx
  mov    (%rcx,%rbx,4),%esi
  add    (%rdx,%rbx,4),%esi
  mov    -0x4(%rax,%r14,1),%edi
  add    0x4(%rax,%r14,1),%edi
  call   <min@plt>
  test   %eax,%eax
  je     L55
  mov    (%r12),%rax
  mov    (%rsp),%rdx
  mov    (%rax,%rdx,4),%edx
  mov    0x10(%rsp),%rsi
  add    (%rax,%rsi,4),%edx
  jne    L26
L55:
  lea    D20(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    $0x13,%edi
  call   <errhandler@plt>
  jmp    L26
L57:
  cltd
  shr    $0x1c,%edx
  add    %edx,%eax
  and    $0xf,%eax
  sub    %edx,%eax
  sub    $0x5,%eax
  test   $0xfffffffa,%eax
  jne    L34
  lea    D20(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    $0x17,%edi
  call   <errhandler@plt>
  jmp    L34
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D20
type_guessed: string
name: disassemble_data
arguments: label: D22
type_guessed: string

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