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

```asm
<__glTexImage3D_size>:
  endbr64
  mov    %ecx,%r9d
  or     %r8d,%ecx
  xor    %eax,%eax
  or     %edx,%ecx
  jns    L220
L131:
  ret
  nopl   0x0(%rax)
L220:
  cmp    $0x93,%edi
  je     L23
  jle    L107
  lea    -0x94(%rdi),%ecx
  cmp    $0xc,%ecx
  ja     L211
  mov    $0x1,%r10d
  shl    %cl,%r10
  test   $0x8ab,%r10d
  jne    L108
  test   $0x1200,%r10d
  jne    L221
  cmp    $0xa,%ecx
  jne    L131
  mov    $0x6,%ecx
  mov    $0xc,%r10d
  mov    $0x3,%r11d
  jmp    L247
  nopl   0x0(%rax)
L107:
  cmp    $0x91,%edi
  je     L181
  cmp    $0x92,%edi
  je     L92
  cmp    $0x90,%edi
  jne    L104
  mov    $0x8,%ecx
  mov    $0x10,%r10d
  mov    $0x4,%r11d
L91:
  lea    -0x80(%rsi),%eax
  cmp    $0x1a,%eax
  ja     L121
  lea    D1(%rip),%rsi
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  xchg   %ax,%ax
L221:
  mov    $0x8,%ecx
  mov    $0x10,%r10d
  mov    $0x4,%r11d
L247:
  add    $0xffffff80,%esi
  cmp    $0x1c,%esi
  ja     L121
  push   %rbx
  lea    D14(%rip),%rbx
  movslq (%rbx,%rsi,4),%rax
  add    %rbx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L121:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L108:
  mov    $0x2,%ecx
  mov    $0x4,%r10d
  mov    $0x1,%r11d
  jmp    L247
  nopl   0x0(%rax,%rax,1)
L181:
  mov    $0x6,%ecx
  mov    $0xc,%r10d
  mov    $0x3,%r11d
  jmp    L91
  nopl   0x0(%rax,%rax,1)
L104:
  ret
  nopl   0x0(%rax)
L92:
  mov    $0x2,%ecx
  mov    $0x4,%r10d
  mov    $0x1,%r11d
  jmp    L91
  cs nopw 0x0(%rax,%rax,1)
L23:
  mov    $0x4,%ecx
  mov    $0x8,%r10d
  mov    $0x2,%r11d
  jmp    L91
  add    %edx,%edx
L177:
  mov    %r9d,%eax
  imul   %edx,%eax
  imul   %r8d,%eax
  ret
  shl    $0x2,%edx
  jmp    L177
  imul   %r10d,%edx
  jmp    L177
  imul   %r11d,%edx
  jmp    L177
  imul   %ecx,%edx
  jmp    L177
  nopl   0x0(%rax)
L211:
  ret
  imul   %r10d,%edx
L115:
  mov    %r9d,%eax
  imul   %edx,%eax
  imul   %r8d,%eax
L141:
  pop    %rbx
  ret
  shl    $0x2,%edx
  jmp    L115
  imul   %ecx,%edx
  jmp    L115
  add    %edx,%edx
  jmp    L115
  imul   %r11d,%edx
  jmp    L115
  xor    %eax,%eax
  cmp    $0x99,%edi
  jne    L141
  lea    0x7(%rdx),%eax
  pop    %rbx
  sar    $0x3,%eax
  imul   %r9d,%eax
  imul   %r8d,%eax
  ret
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d) {
  GLint elements, esize;
  if (w < 0)
    return 0;
  if (h < 0)
    return 0;
  if (d < 0)
    return 0;
  switch (format) {
  case GL_COLOR_INDEX:
    elements = 1;
    break;
  case GL_RED:
  case GL_GREEN:
  case GL_BLUE:
  case GL_ALPHA:
  case GL_LUMINANCE:
  case GL_INTENSITY:
    elements = 1;
    break;
  case GL_LUMINANCE_ALPHA:
    elements = 2;
    break;
  case GL_RGB:
  case GL_BGR:
    elements = 3;
    break;
  case GL_RGBA:
  case GL_BGRA:
  case GL_ABGR_EXT:
    elements = 4;
    break;
  default:
    return 0;
  }
  switch (type) {
  case GL_BITMAP:
    if (format == GL_COLOR_INDEX) {
      return (d * (h * ((w + 7) / 8)));
    } else {
      return 0;
    }
  case GL_BYTE:
  case GL_UNSIGNED_BYTE:
    esize = 1;
    break;
  case GL_UNSIGNED_BYTE_3_3_2:
  case GL_UNSIGNED_BYTE_2_3_3_REV:
    esize = 1;
    elements = 1;
    break;
  case GL_SHORT:
  case GL_UNSIGNED_SHORT:
    esize = 2;
    break;
  case GL_UNSIGNED_SHORT_5_6_5:
  case GL_UNSIGNED_SHORT_5_6_5_REV:
  case GL_UNSIGNED_SHORT_4_4_4_4:
  case GL_UNSIGNED_SHORT_4_4_4_4_REV:
  case GL_UNSIGNED_SHORT_5_5_5_1:
  case GL_UNSIGNED_SHORT_1_5_5_5_REV:
    esize = 2;
    elements = 1;
    break;
  case GL_INT:
  case GL_UNSIGNED_INT:
  case GL_FLOAT:
    esize = 4;
    break;
  case GL_UNSIGNED_INT_8_8_8_8:
  case GL_UNSIGNED_INT_8_8_8_8_REV:
  case GL_UNSIGNED_INT_10_10_10_2:
  case GL_UNSIGNED_INT_2_10_10_10_REV:
    esize = 4;
    elements = 1;
    break;
  default:
    return 0;
  }
  return (elements * esize * w * h * d);
}
```