user: Converte this assembly snippet into its equivalent C code:

```asm
<UI_Update>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <trap_Cvar_VariableValue@plt>
  mov    %eax,%ebp
  lea    D692(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L142
  lea    D954(%rip),%rdi
  call   <UI_Cvar_VariableString@plt>
  mov    %eax,%esi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
L315:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L142:
  lea    D390(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L316
  lea    D129(%rip),%rdi
  call   <trap_Cvar_VariableValue@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  comiss D469(%rip),%xmm0
  jae    L73
  comiss D318(%rip),%xmm0
  jb     L8
  lea    D164(%rip),%rsi
  lea    D695(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  lea    D221(%rip),%rsi
  lea    D478(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L73:
  lea    D326(%rip),%rsi
  lea    D695(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  lea    D437(%rip),%rsi
  lea    D478(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L8:
  lea    D164(%rip),%rsi
  lea    D695(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  lea    D437(%rip),%rsi
  lea    D478(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L316:
  lea    D504(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L244
  lea    D7(%rip),%rdi
  call   <UI_Cvar_VariableString@plt>
  mov    %eax,%esi
  lea    D954(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L244:
  lea    D425(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L134
  cmp    $0x10,%ebp
  je     L43
  cmp    $0x20,%ebp
  je     L348
  test   %ebp,%ebp
  jne    L315
  mov    $0x0,%esi
  lea    D51(%rip),%rdi
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D590(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L43:
  mov    $0x10,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D590(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L348:
  mov    $0x18,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L134:
  lea    D9(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L327
  cmp    $0x1,%ebp
  je     L164
  cmp    $0x2,%ebp
  je     L270
  test   %ebp,%ebp
  jne    L315
  mov    $0x4,%esi
  lea    D217(%rip),%rdi
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L164:
  mov    $0xc,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L270:
  mov    $0x14,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L327:
  lea    D312(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L243
  cmp    $0x2,%ebp
  je     L212
  jg     L84
  test   %ebp,%ebp
  je     L54
  cmp    $0x1,%ebp
  jne    L315
  mov    $0x1,%esi
  lea    D837(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0xc,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D315(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D425(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x18,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x3,%esi
  lea    D935(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D605(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D861(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D72(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x9c4,%esi
  lea    D750(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  lea    D852(%rip),%rsi
  lea    D614(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  mov    $0x0,%esi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L84:
  cmp    $0x3,%ebp
  jne    L315
  mov    $0x1,%esi
  lea    D837(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x14,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D315(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x2,%esi
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x10,%esi
  lea    D425(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x10,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x3,%esi
  lea    D935(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x2,%esi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x10,%esi
  lea    D605(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D750(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D861(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D72(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  lea    D894(%rip),%rsi
  lea    D614(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L54:
  mov    $0x1,%esi
  lea    D837(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x4,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D315(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x20,%esi
  lea    D425(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x18,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x4,%esi
  lea    D935(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x20,%esi
  lea    D605(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D861(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D72(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x9c4,%esi
  lea    D750(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  lea    D852(%rip),%rsi
  lea    D614(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L212:
  mov    $0x1,%esi
  lea    D837(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x8,%esi
  lea    D217(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D315(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D425(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x3,%esi
  lea    D935(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D605(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x1,%esi
  lea    D861(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D72(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  mov    $0x0,%esi
  lea    D750(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_SetValue@plt>
  lea    D894(%rip),%rsi
  lea    D614(%rip),%rdi
  mov    $0x0,%eax
  call   <trap_Cvar_Set@plt>
  jmp    L315
L243:
  lea    D787(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <Q_stricmp@plt>
  test   %eax,%eax
  jne    L315
  test   %ebp,%ebp
  jne    L274
  movsd  D182(%rip),%xmm0
  lea    D384(%rip),%rdi
  mov    $0x1,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
L274:
  movsd  D12(%rip),%xmm0
  lea    D384(%rip),%rdi
  mov    $0x1,%eax
  call   <trap_Cvar_SetValue@plt>
  jmp    L315
```

tool_calls: name: parse_data
arguments: data_label: D692
type_guessed: string
name: parse_data
arguments: data_label: D954
type_guessed: string
name: parse_data
arguments: data_label: D7
type_guessed: string
name: parse_data
arguments: data_label: D390
type_guessed: string
name: parse_data
arguments: data_label: D129
type_guessed: string
name: parse_data
arguments: data_label: D469
type_guessed: byte[4]
name: parse_data
arguments: data_label: D318
type_guessed: byte[4]
name: parse_data
arguments: data_label: D164
type_guessed: string
name: parse_data
arguments: data_label: D695
type_guessed: string
name: parse_data
arguments: data_label: D221
type_guessed: string
name: parse_data
arguments: data_label: D478
type_guessed: string
name: parse_data
arguments: data_label: D326
type_guessed: string
name: parse_data
arguments: data_label: D437
type_guessed: string
name: parse_data
arguments: data_label: D504
type_guessed: string
name: parse_data
arguments: data_label: D425
type_guessed: string
name: parse_data
arguments: data_label: D51
type_guessed: string
name: parse_data
arguments: data_label: D590
type_guessed: string
name: parse_data
arguments: data_label: D9
type_guessed: string
name: parse_data
arguments: data_label: D217
type_guessed: string
name: parse_data
arguments: data_label: D312
type_guessed: string
name: parse_data
arguments: data_label: D837
type_guessed: string
name: parse_data
arguments: data_label: D315
type_guessed: string
name: parse_data
arguments: data_label: D11
type_guessed: string
name: parse_data
arguments: data_label: D935
type_guessed: string
name: parse_data
arguments: data_label: D605
type_guessed: string
name: parse_data
arguments: data_label: D861
type_guessed: string
name: parse_data
arguments: data_label: D72
type_guessed: string
name: parse_data
arguments: data_label: D750
type_guessed: string
name: parse_data
arguments: data_label: D852
type_guessed: string
name: parse_data
arguments: data_label: D614
type_guessed: string
name: parse_data
arguments: data_label: D23
type_guessed: string
name: parse_data
arguments: data_label: D894
type_guessed: string
name: parse_data
arguments: data_label: D787
type_guessed: string
name: parse_data
arguments: data_label: D182
type_guessed: byte[8]
name: parse_data
arguments: data_label: D384
type_guessed: string
name: parse_data
arguments: data_label: D12
type_guessed: byte[8]

tool: D692: ui_SetName

tool: D954: ui_Name

tool: D7: name

tool: D390: ui_setRate

tool: D129: rate

tool: {"D469": [0x00,0x40,0x9c,0x45]}

tool: {"D318": [0x00,0x00,0x7a,0x45]}

tool: D164: 15

tool: D695: cl_maxpackets

tool: D221: 2

tool: D478: cl_packetdup

tool: D326: 30

tool: D437: 1

tool: D504: ui_GetName

tool: D425: r_colorbits

tool: D51: r_depthbits

tool: D590: r_stencilbits

tool: D9: r_lodbias

tool: D217: r_subdivisions

tool: D312: ui_glCustom

tool: D837: r_fullScreen

tool: D315: r_vertexlight

tool: D11: r_picmip

tool: D935: r_mode

tool: D605: r_texturebits

tool: D861: r_fastSky

tool: D72: r_inGameVideo

tool: D750: cg_brassTime

tool: D852: GL_LINEAR_MIPMAP_LINEAR

tool: D614: r_texturemode

tool: D23: cg_shadows

tool: D894: GL_LINEAR_MIPMAP_NEAREST

tool: D787: ui_mousePitch

tool: {"D182": [0x00,0x00,0x00,0x00,0x2b,0x87,0x96,0x3f]}

tool: D384: m_pitch

tool: {"D12": [0x00,0x00,0x00,0x00,0x2b,0x87,0x96,0xbf]}

assistant: ```c
void UI_Update(const char *name) {
  int val = trap_Cvar_VariableValue(name);
  if (Q_stricmp(name, "ui_SetName") == 0) {
    trap_Cvar_Set("name", UI_Cvar_VariableString("ui_Name"));
  } else if (Q_stricmp(name, "ui_setRate") == 0) {
    float rate = trap_Cvar_VariableValue("rate");
    if (rate >= 5000) {
      trap_Cvar_Set("cl_maxpackets", "30");
      trap_Cvar_Set("cl_packetdup", "1");
    } else if (rate >= 4000) {
      trap_Cvar_Set("cl_maxpackets", "15");
      trap_Cvar_Set("cl_packetdup", "2");
    } else {
      trap_Cvar_Set("cl_maxpackets", "15");
      trap_Cvar_Set("cl_packetdup", "1");
    }
  } else if (Q_stricmp(name, "ui_GetName") == 0) {
    trap_Cvar_Set("ui_Name", UI_Cvar_VariableString("name"));
  } else if (Q_stricmp(name, "r_colorbits") == 0) {
    switch (val) {
    case 0:
      trap_Cvar_SetValue("r_depthbits", 0);
      trap_Cvar_SetValue("r_stencilbits", 0);
      break;
    case 16:
      trap_Cvar_SetValue("r_depthbits", 16);
      trap_Cvar_SetValue("r_stencilbits", 0);
      break;
    case 32:
      trap_Cvar_SetValue("r_depthbits", 24);
      break;
    }
  } else if (Q_stricmp(name, "r_lodbias") == 0) {
    switch (val) {
    case 0:
      trap_Cvar_SetValue("r_subdivisions", 4);
      break;
    case 1:
      trap_Cvar_SetValue("r_subdivisions", 12);
      break;
    case 2:
      trap_Cvar_SetValue("r_subdivisions", 20);
      break;
    }
  } else if (Q_stricmp(name, "ui_glCustom") == 0) {
    switch (val) {
    case 0:
      trap_Cvar_SetValue("r_fullScreen", 1);
      trap_Cvar_SetValue("r_subdivisions", 4);
      trap_Cvar_SetValue("r_vertexlight", 0);
      trap_Cvar_SetValue("r_lodbias", 0);
      trap_Cvar_SetValue("r_colorbits", 32);
      trap_Cvar_SetValue("r_depthbits", 24);
      trap_Cvar_SetValue("r_picmip", 0);
      trap_Cvar_SetValue("r_mode", 4);
      trap_Cvar_SetValue("r_texturebits", 32);
      trap_Cvar_SetValue("r_fastSky", 0);
      trap_Cvar_SetValue("r_inGameVideo", 1);
      trap_Cvar_SetValue("cg_shadows", 1);
      trap_Cvar_SetValue("cg_brassTime", 2500);
      trap_Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR");
      break;
    case 1:
      trap_Cvar_SetValue("r_fullScreen", 1);
      trap_Cvar_SetValue("r_subdivisions", 12);
      trap_Cvar_SetValue("r_vertexlight", 0);
      trap_Cvar_SetValue("r_lodbias", 0);
      trap_Cvar_SetValue("r_colorbits", 0);
      trap_Cvar_SetValue("r_depthbits", 24);
      trap_Cvar_SetValue("r_picmip", 0);
      trap_Cvar_SetValue("r_mode", 3);
      trap_Cvar_SetValue("r_texturebits", 0);
      trap_Cvar_SetValue("r_fastSky", 0);
      trap_Cvar_SetValue("r_inGameVideo", 1);
      trap_Cvar_SetValue("cg_brassTime", 2500);
      trap_Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR");
      trap_Cvar_SetValue("cg_shadows", 0);
      break;
    case 2:
      trap_Cvar_SetValue("r_fullScreen", 1);
      trap_Cvar_SetValue("r_subdivisions", 8);
      trap_Cvar_SetValue("r_vertexlight", 0);
      trap_Cvar_SetValue("r_lodbias", 1);
      trap_Cvar_SetValue("r_colorbits", 0);
      trap_Cvar_SetValue("r_depthbits", 0);
      trap_Cvar_SetValue("r_picmip", 1);
      trap_Cvar_SetValue("r_mode", 3);
      trap_Cvar_SetValue("r_texturebits", 0);
      trap_Cvar_SetValue("cg_shadows", 0);
      trap_Cvar_SetValue("r_fastSky", 1);
      trap_Cvar_SetValue("r_inGameVideo", 0);
      trap_Cvar_SetValue("cg_brassTime", 0);
      trap_Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_NEAREST");
      break;
    case 3:
      trap_Cvar_SetValue("r_fullScreen", 1);
      trap_Cvar_SetValue("r_subdivisions", 20);
      trap_Cvar_SetValue("r_vertexlight", 1);
      trap_Cvar_SetValue("r_lodbias", 2);
      trap_Cvar_SetValue("r_colorbits", 16);
      trap_Cvar_SetValue("r_depthbits", 16);
      trap_Cvar_SetValue("r_mode", 3);
      trap_Cvar_SetValue("r_picmip", 2);
      trap_Cvar_SetValue("r_texturebits", 16);
      trap_Cvar_SetValue("cg_shadows", 0);
      trap_Cvar_SetValue("cg_brassTime", 0);
      trap_Cvar_SetValue("r_fastSky", 1);
      trap_Cvar_SetValue("r_inGameVideo", 0);
      trap_Cvar_Set("r_texturemode", "GL_LINEAR_MIPMAP_NEAREST");
      break;
    }
  } else if (Q_stricmp(name, "ui_mousePitch") == 0) {
    if (val == 0) {
      trap_Cvar_SetValue("m_pitch", 0.022f);
    } else {
      trap_Cvar_SetValue("m_pitch", -0.022f);
    }
  }
}
```