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

```asm
<convert_units>:
  endbr64
  test   %rdi,%rdi
  je     L108
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  test   %rsi,%rsi
  je     L77
  mov    %rdx,%r12
  test   %rdx,%rdx
  je     L6
  mov    %rdi,%r13
  mov    %rdx,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  xor    %r8d,%r8d
  test   %rax,%rax
  jne    L91
L165:
  pop    %rbp
  mov    %r8d,%eax
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L91:
  lea    D89(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L136
  lea    D80(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L42
  lea    D88(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  movsd  D33(%rip),%xmm0
  test   %rax,%rax
  je     L13
  lea    D101(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  movsd  D112(%rip),%xmm0
  test   %rax,%rax
  je     L13
  lea    D146(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  movsd  D50(%rip),%xmm0
  test   %rax,%rax
  je     L13
  lea    D131(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L55
  lea    D155(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L158
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L93
  lea    D4(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  movsd  D96(%rip),%xmm0
  test   %rax,%rax
  je     L82
  lea    D135(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  movsd  D161(%rip),%xmm0
  test   %rax,%rax
  je     L82
  lea    D137(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    $0x1,%r8d
  test   %rax,%rax
  jne    L165
  movsd  D153(%rip),%xmm0
L82:
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%r13)
L93:
  pop    %rbp
  mov    %r12,%rsi
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  jmp    1080 <convert_units_from_THz@plt>
  xchg   %ax,%ax
L42:
  movsd  D96(%rip),%xmm0
L13:
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%r13)
L136:
  pop    %rbp
  mov    %r12,%rsi
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  jmp    1090 <convert_units_from_um@plt>
  nopl   0x0(%rax)
L158:
  movsd  D140(%rip),%xmm0
  mulsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%r13)
L55:
  pop    %rbp
  mov    %r12,%rsi
  mov    %r13,%rdi
  pop    %r12
  pop    %r13
  jmp    10b0 <convert_units_from_eV@plt>
L6:
  mov    $0xfffffffd,%r8d
  jmp    L165
L77:
  mov    $0xfffffffe,%r8d
  jmp    L165
L108:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D89
type_infered: string
name: retrieve_data
arguments: tag: D80
type_infered: string
name: retrieve_data
arguments: tag: D88
type_infered: string
name: retrieve_data
arguments: tag: D33
type_infered: f64
name: retrieve_data
arguments: tag: D101
type_infered: string
name: retrieve_data
arguments: tag: D112
type_infered: f64
name: retrieve_data
arguments: tag: D146
type_infered: string
name: retrieve_data
arguments: tag: D50
type_infered: f64
name: retrieve_data
arguments: tag: D131
type_infered: string
name: retrieve_data
arguments: tag: D155
type_infered: string
name: retrieve_data
arguments: tag: D39
type_infered: string
name: retrieve_data
arguments: tag: D4
type_infered: string
name: retrieve_data
arguments: tag: D96
type_infered: byte[8]
name: retrieve_data
arguments: tag: D135
type_infered: string
name: retrieve_data
arguments: tag: D161
type_infered: byte[8]
name: retrieve_data
arguments: tag: D137
type_infered: string
name: retrieve_data
arguments: tag: D153
type_infered: byte[8]
name: retrieve_data
arguments: tag: D140
type_infered: f64

tool: D89: um

tool: D80: nm

tool: D88: m

tool: D33: 1000000

tool: D101: cm

tool: D112: 10000

tool: D146: mm

tool: D50: 1000

tool: D131: eV

tool: D155: J

tool: D39: THz

tool: D4: GHz

tool: {"D96": [0xfc,0xa9,0xf1,0xd2,0x4d,0x62,0x50,0x3f]}

tool: D135: Hz

tool: {"D161": [0x11,0xea,0x2d,0x81,0x99,0x97,0x71,0x3d]}

tool: D137: rad/s

tool: {"D153": [0x6d,0x8b,0x6b,0x40,0x29,0x66,0x46,0x3d]}

tool: D140: 6.241506363094027e+18

assistant: ```c
int convert_units(double *value, const char *from_units, const char *to_units) {
  if (NULL == value) {
    return -1;
  }
  if (NULL == from_units) {
    return -2;
  }
  if (NULL == to_units) {
    return -3;
  }
  if (0 == strcmp(from_units, to_units)) {
    return 0;
  } else if (0 == strcmp(from_units, "um")) {
    return convert_units_from_um(value, to_units);
  } else if (0 == strcmp(from_units, "nm")) {
    *value *= 1e-3;
    return convert_units_from_um(value, to_units);
  } else if (0 == strcmp(from_units, "m")) {
    *value *= 1e6;
    return convert_units_from_um(value, to_units);
  } else if (0 == strcmp(from_units, "cm")) {
    *value *= 1e4;
    return convert_units_from_um(value, to_units);
  } else if (0 == strcmp(from_units, "mm")) {
    *value *= 1e3;
    return convert_units_from_um(value, to_units);
  } else if (0 == strcmp(from_units, "eV")) {
    return convert_units_from_eV(value, to_units);
  } else if (0 == strcmp(from_units, "J")) {
    *value *= 6.241506363094027e18;
    return convert_units_from_eV(value, to_units);
  } else if (0 == strcmp(from_units, "THz")) {
    return convert_units_from_THz(value, to_units);
  } else if (0 == strcmp(from_units, "GHz")) {
    *value *= 1e-3;
    return convert_units_from_THz(value, to_units);
  } else if (0 == strcmp(from_units, "Hz")) {
    *value *= 1e-12;
    return convert_units_from_THz(value, to_units);
  } else if (0 == strcmp(from_units, "rad/s")) {
    *value *= 1.5915494309189535e-13;
    return convert_units_from_THz(value, to_units);
  } else {
    return 1;
  }
}
```