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

```asm
<rewrite_i386_reg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x28,%al
  jne    L233
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <skipParens@plt>
  jmp    L416
L233:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D385(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L334
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D165(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L334:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D482(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L262
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D455(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L262:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D192(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L425
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D421(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L425:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D77(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L79
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D349(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L79:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D331(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L230
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D424(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L230:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D488(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L316
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D268(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L316:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D66(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L354
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D402(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L354:
  mov    -0x8(%rbp),%rax
  mov    $0x3,%edx
  lea    D418(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L373
  mov    -0x8(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D468(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L373:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D223(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L103
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D336(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L103:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D81(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L408
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D220(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L408:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D10(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L481
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D140(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L481:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D431(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L205
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D36(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L205:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D464(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L460
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D371(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L460:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L336
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D473(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L336:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D292(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L144
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D207(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L144:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D288(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L81
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D457(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L81:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D389(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L248
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L248:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D253(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L343
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D471(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L343:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D117(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L442
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D134(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L442:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D260(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L432
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D327(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L432:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D209(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L474
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D112(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L474:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D419(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L138
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D376(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L138:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D438(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L94
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L94:
  mov    -0x8(%rbp),%rax
  mov    $0x2,%edx
  lea    D136(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L332
  mov    -0x8(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <delete@plt>
  mov    -0x8(%rbp),%rax
  lea    D351(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <insert@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L369
L332:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D386(%rip),%rax
  mov    %rax,%rdi
  call   <error@plt>
L369:
  mov    -0x8(%rbp),%rax
L416:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D385
datatype: string
name: parse_data
arguments: label: D165
datatype: string
name: parse_data
arguments: label: D482
datatype: string
name: parse_data
arguments: label: D455
datatype: string
name: parse_data
arguments: label: D192
datatype: string
name: parse_data
arguments: label: D421
datatype: string
name: parse_data
arguments: label: D77
datatype: string
name: parse_data
arguments: label: D349
datatype: string
name: parse_data
arguments: label: D331
datatype: string
name: parse_data
arguments: label: D424
datatype: string
name: parse_data
arguments: label: D488
datatype: string
name: parse_data
arguments: label: D268
datatype: string
name: parse_data
arguments: label: D66
datatype: string
name: parse_data
arguments: label: D402
datatype: string
name: parse_data
arguments: label: D418
datatype: string
name: parse_data
arguments: label: D468
datatype: string
name: parse_data
arguments: label: D223
datatype: string
name: parse_data
arguments: label: D336
datatype: string
name: parse_data
arguments: label: D81
datatype: string
name: parse_data
arguments: label: D220
datatype: string
name: parse_data
arguments: label: D10
datatype: string
name: parse_data
arguments: label: D140
datatype: string
name: parse_data
arguments: label: D431
datatype: string
name: parse_data
arguments: label: D36
datatype: string
name: parse_data
arguments: label: D464
datatype: string
name: parse_data
arguments: label: D371
datatype: string
name: parse_data
arguments: label: D2
datatype: string
name: parse_data
arguments: label: D473
datatype: string
name: parse_data
arguments: label: D292
datatype: string
name: parse_data
arguments: label: D207
datatype: string
name: parse_data
arguments: label: D288
datatype: string
name: parse_data
arguments: label: D457
datatype: string
name: parse_data
arguments: label: D389
datatype: string
name: parse_data
arguments: label: D11
datatype: string
name: parse_data
arguments: label: D253
datatype: string
name: parse_data
arguments: label: D471
datatype: string
name: parse_data
arguments: label: D117
datatype: string
name: parse_data
arguments: label: D134
datatype: string
name: parse_data
arguments: label: D260
datatype: string
name: parse_data
arguments: label: D327
datatype: string
name: parse_data
arguments: label: D209
datatype: string
name: parse_data
arguments: label: D112
datatype: string
name: parse_data
arguments: label: D419
datatype: string
name: parse_data
arguments: label: D376
datatype: string
name: parse_data
arguments: label: D438
datatype: string
name: parse_data
arguments: label: D19
datatype: string
name: parse_data
arguments: label: D136
datatype: string
name: parse_data
arguments: label: D351
datatype: string
name: parse_data
arguments: label: D386
datatype: string

tool: D385: eax

tool: D165: _EAX

tool: D482: ecx

tool: D455: _ECX

tool: D192: edx

tool: D421: _EDX

tool: D77: ebx

tool: D349: _EBX

tool: D331: esp

tool: D424: _ESP

tool: D488: ebp

tool: D268: _EBP

tool: D66: esi

tool: D402: _ESI

tool: D418: edi

tool: D468: _EDI

tool: D223: al

tool: D336: _AL

tool: D81: cl

tool: D220: _CL

tool: D10: dl

tool: D140: _DL

tool: D431: bl

tool: D36: _BL

tool: D464: ah

tool: D371: _AH

tool: D2: ch

tool: D473: _CH

tool: D292: dh

tool: D207: _DH

tool: D288: bh

tool: D457: _BH

tool: D389: ax

tool: D11: _AX

tool: D253: cx

tool: D471: _CX

tool: D117: dx

tool: D134: _DX

tool: D260: bx

tool: D327: _BX

tool: D209: sp

tool: D112: _SP

tool: D419: bp

tool: D376: _BP

tool: D438: si

tool: D19: _SI

tool: D136: di

tool: D351: _DI

tool: D386: unknown register name: %s

assistant: ```c
char *rewrite_i386_reg(char *arg) {
  if (*arg == '(')
    return skipParens(arg);
  if (!strncmp(arg, "eax", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_EAX");
  } else if (!strncmp(arg, "ecx", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_ECX");
  } else if (!strncmp(arg, "edx", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_EDX");
  } else if (!strncmp(arg, "ebx", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_EBX");
  } else if (!strncmp(arg, "esp", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_ESP");
  } else if (!strncmp(arg, "ebp", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_EBP");
  } else if (!strncmp(arg, "esi", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_ESI");
  } else if (!strncmp(arg, "edi", 3)) {
    delete (arg, 3);
    arg = insert(arg, "_EDI");
  } else if (!strncmp(arg, "al", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_AL");
  } else if (!strncmp(arg, "cl", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_CL");
  } else if (!strncmp(arg, "dl", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_DL");
  } else if (!strncmp(arg, "bl", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_BL");
  } else if (!strncmp(arg, "ah", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_AH");
  } else if (!strncmp(arg, "ch", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_CH");
  } else if (!strncmp(arg, "dh", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_DH");
  } else if (!strncmp(arg, "bh", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_BH");
  } else if (!strncmp(arg, "ax", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_AX");
  } else if (!strncmp(arg, "cx", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_CX");
  } else if (!strncmp(arg, "dx", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_DX");
  } else if (!strncmp(arg, "bx", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_BX");
  } else if (!strncmp(arg, "sp", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_SP");
  } else if (!strncmp(arg, "bp", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_BP");
  } else if (!strncmp(arg, "si", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_SI");
  } else if (!strncmp(arg, "di", 2)) {
    delete (arg, 2);
    arg = insert(arg, "_DI");
  } else
    error("unknown register name: %s", arg);
  return arg;
}
```