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

```asm
<__glTexImage1D_size>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L152
  mov    $0x0,%eax
  jmp    L141
L152:
  mov    -0x14(%rbp),%eax
  sub    $0x90,%eax
  cmp    $0x10,%eax
  ja     L37
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D39(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D39(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0x1,-0x8(%rbp)
  jmp    L86
  movl   $0x1,-0x8(%rbp)
  jmp    L86
  movl   $0x2,-0x8(%rbp)
  jmp    L86
  movl   $0x3,-0x8(%rbp)
  jmp    L86
  movl   $0x4,-0x8(%rbp)
  jmp    L86
L37:
  mov    $0x0,%eax
  jmp    L141
L86:
  mov    -0x18(%rbp),%eax
  add    $0xffffff80,%eax
  cmp    $0x1c,%eax
  ja     L29
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D0(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D0(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  cmpl   $0x99,-0x14(%rbp)
  jne    L4
  mov    -0x1c(%rbp),%eax
  add    $0x7,%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  jmp    L141
L4:
  mov    $0x0,%eax
  jmp    L141
  movl   $0x1,-0x4(%rbp)
  jmp    L144
  movl   $0x1,-0x4(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L144
  movl   $0x2,-0x4(%rbp)
  jmp    L144
  movl   $0x2,-0x4(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L144
  movl   $0x4,-0x4(%rbp)
  jmp    L144
  movl   $0x4,-0x4(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L144
L29:
  mov    $0x0,%eax
  jmp    L141
L144:
  mov    -0x8(%rbp),%eax
  imul   -0x4(%rbp),%eax
  imul   -0x1c(%rbp),%eax
L141:
  pop    %rbp
  ret
```

assistant: ```c
GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w) {
  GLint elements, esize;
  if (w < 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 (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);
}
```