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

```asm
<ad_update_variable>:
  endbr64
  push   %r15
  mov    %rsi,%r9
  mov    %rdi,%r8
  xor    %eax,%eax
  push   %r14
  lea    D35(%rip),%rcx
  mov    %rsi,%r14
  mov    $0x270,%edx
  push   %r13
  lea    D25(%rip),%r13
  push   %r12
  lea    D13(%rip),%r12
  mov    %r13,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12,%rdi
  push   %rbx
  sub    $0x18,%rsp
  call   <_make_log@plt>
  test   %r14,%r14
  je     L23
  testb  $0xdf,(%r14)
  jne    L84
L23:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L84:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x4(%rax),%rdi
  mov    %rax,%rbx
  call   <gmk_alloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L23
  mov    $0x2824,%edx
  mov    %rbp,%rsi
  lea    0x2(%rax),%rdi
  mov    %dx,(%rax)
  mov    %rbx,%rdx
  call   <memcpy@plt>
  movb   $0x29,0x2(%r15,%rbx,1)
  lea    0x3(%rbx),%rax
  mov    %r15,%rdi
  movb   $0x0,0x3(%r15,%rbx,1)
  mov    %rax,0x8(%rsp)
  call   <gmk_expand@plt>
  mov    %r15,%rdi
  mov    %rax,(%rsp)
  call   <gmk_free@plt>
  cmpq   $0x0,(%rsp)
  je     L23
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    (%rsp),%rdi
  mov    %r14,%rsi
  mov    %rax,%r15
  call   <strstr@plt>
  test   %rax,%rax
  je     L5
  movsbl (%rax,%r15,1),%edi
  test   %dil,%dil
  je     L58
  call   <isspace@plt>
  test   %rax,%rax
  jne    L58
  mov    (%rsp),%rdi
  call   <gmk_free@plt>
L5:
  mov    0x8(%rsp),%rax
  lea    0x1(%r15,%rax,2),%rdi
  call   <gmk_alloc@plt>
  test   %rax,%rax
  je     L23
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    %rax,(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%r8
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  lea    (%r8,%rbx,1),%rax
  movl   $0x28243d3a,(%rax)
  lea    0x4(%rax),%r15
  mov    %r15,%rdi
  add    %rbx,%r15
  call   <memcpy@plt>
  mov    $0x2029,%eax
  lea    0x2(%r15),%rdi
  mov    %r14,%rsi
  mov    %ax,(%r15)
  call   <strcpy@plt>
  mov    (%rsp),%r8
  mov    $0x2ac,%edx
  xor    %eax,%eax
  lea    D3(%rip),%rcx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <_make_log@plt>
  mov    (%rsp),%rdi
  xor    %esi,%esi
  call   <gmk_eval@plt>
  mov    (%rsp),%rdi
L67:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <gmk_free@plt>
  nopl   (%rax)
L58:
  mov    (%rsp),%rdi
  jmp    L67
```

tool_calls: name: read_data
arguments: data_label: D35
type: string
name: read_data
arguments: data_label: D25
type: string
name: read_data
arguments: data_label: D13
type: string
name: read_data
arguments: data_label: D3
type: string

tool: D35: Update %s with %s


tool: D25: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/heads/master/scripts/build/dlopen.c

tool: D13: info

tool: D3: RESULT ASKED TO EVAL - %s


assistant: ```c
void ad_update_variable(char const *name, char *value) {
  size_t name_len, value_len;
  char *old, *p, *expand;
  _make_log("info", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/heads/master/scripts/build/dlopen.c", 624,
            "Update %s with %s"
            "\n",
            name, value);
  if (!value || !*value || (*value == ' '))
    return;
  name_len = strlen(name);
  expand = gmk_alloc(name_len + 4);
  if (!expand)
    return;
  expand[0] = '$';
  expand[1] = '(';
  memcpy(expand + 2, name, name_len);
  expand[2 + name_len] = ')';
  expand[2 + name_len + 1] = '\0';
  old = gmk_expand(expand);
  gmk_free(expand);
  if (!old)
    return;
  value_len = strlen(value);
  p = strstr(old, value);
  if (p) {
    if (!p[value_len] || isspace((int)p[value_len])) {
      gmk_free(old);
      return;
    }
    gmk_free(old);
  }
  expand = gmk_alloc(name_len + 4 + name_len + 2 + value_len + 1);
  if (!expand)
    return;
  p = expand;
  memcpy(p, name, name_len);
  p += name_len;
  *p++ = ':';
  *p++ = '=';
  *p++ = '$';
  *p++ = '(';
  memcpy(p, name, name_len);
  p += name_len;
  *p++ = ')';
  *p++ = ' ';
  strcpy(p, value);
  _make_log("info", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/alandekok/freeradius-server/refs/heads/master/scripts/build/dlopen.c", 684,
            "RESULT ASKED TO EVAL - %s"
            "\n",
            expand);
  gmk_eval(expand, NULL);
  gmk_free(expand);
}
```