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

```asm
<run_zone_trigger>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  mov    $0x3,%edi
  push   %r14
  mov    %rsi,%r14
  lea    D42(%rip),%rsi
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x238,%rsp
  mov    %ecx,0x4(%rsp)
  lea    0x120(%rsp),%rbp
  mov    0x278(%rsp),%r12
  mov    %r8d,0x8(%rsp)
  mov    %r9d,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  call   <logmsg@plt>
  mov    $0xff,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D57(%rip),%rcx
  lea    D22(%rip),%rdx
  call   <snprintf@plt>
  test   %rax,%rax
  js     L112
  mov    %rbp,%rdi
  xor    %ebx,%ebx
  call   <strdup@plt>
  mov    %rax,0x10(%rsp)
  test   %rax,%rax
  setne  %bl
L112:
  mov    %r12,%rcx
  lea    D62(%rip),%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    $0xff,%esi
  movslq %ebx,%r12
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L10
L205:
  xor    %eax,%eax
  mov    %r15d,%ecx
  lea    D31(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L89
L16:
  xor    %eax,%eax
  mov    %r14,%rcx
  lea    D81(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L201
L194:
  xor    %eax,%eax
  mov    %r13d,%ecx
  lea    D79(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L6
L132:
  mov    0x8(%rsp),%ecx
  xor    %eax,%eax
  lea    D48(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L130
L183:
  mov    0xc(%rsp),%ecx
  xor    %eax,%eax
  lea    D54(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L123
L198:
  mov    0x4(%rsp),%ecx
  xor    %eax,%eax
  lea    D101(%rip),%rdx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L189
L62:
  mov    0x270(%rsp),%ecx
  xor    %eax,%eax
  mov    $0xff,%esi
  mov    %rbp,%rdi
  lea    D29(%rip),%rdx
  call   <snprintf@plt>
  test   %rax,%rax
  jns    L125
L228:
  movq   $0x0,0x10(%rsp,%r12,8)
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rdi
  call   <run_trigger_program@plt>
  mov    0x10(%rsp),%rdi
  test   %rdi,%rdi
  je     L246
  nopl   0x0(%rax,%rax,1)
L136:
  call   <free@plt>
  mov    0x8(%rbx),%rdi
  add    $0x8,%rbx
  test   %rdi,%rdi
  jne    L136
L246:
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0x238,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L10:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L205
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L205
  nopl   0x0(%rax)
L125:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L228
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L228
  nopl   0x0(%rax)
L189:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L62
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L62
  nopl   0x0(%rax)
L123:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L198
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L198
  nopl   0x0(%rax)
L130:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L183
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L183
  nopl   0x0(%rax)
L6:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L132
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L132
  nopl   0x0(%rax)
L201:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L194
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L194
  nopl   0x0(%rax)
L89:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,0x10(%rsp,%r12,8)
  test   %rax,%rax
  je     L16
  add    $0x1,%ebx
  movslq %ebx,%r12
  jmp    L16
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D42
data_type: string
name: parse_data
arguments: tag: D57
data_type: string
name: parse_data
arguments: tag: D22
data_type: string
name: parse_data
arguments: tag: D62
data_type: string
name: parse_data
arguments: tag: D31
data_type: string
name: parse_data
arguments: tag: D81
data_type: string
name: parse_data
arguments: tag: D79
data_type: string
name: parse_data
arguments: tag: D48
data_type: string
name: parse_data
arguments: tag: D54
data_type: string
name: parse_data
arguments: tag: D101
data_type: string
name: parse_data
arguments: tag: D29
data_type: string

tool: D42: run_zone_trigger() called

tool: D57: zone

tool: D22: ALARM_EVENT_TYPE=%s

tool: D62: ALARM_EVENT_STATUS=%s

tool: D31: ALARM_EVENT_ZONE=%d

tool: D81: ALARM_EVENT_ZONE_NAME=%s

tool: D79: ALARM_EVENT_ZONE_FAULT=%d

tool: D48: ALARM_EVENT_ZONE_TROUBLE=%d

tool: D54: ALARM_EVENT_ZONE_TAMPER=%d

tool: D101: ALARM_EVENT_ZONE_BYPASS=%d

tool: D29: ALARM_EVENT_ZONE_ARMED=%d

assistant: ```c
void run_zone_trigger(int zonenum, const char *zonename, int fault, int bypass, int trouble, int tamper, int armed, const char *zonestatus) {
  char *env[32 + 1];
  int envc = 0;
  char tmp[255], **e;
  logmsg(3, "run_zone_trigger() called");
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_TYPE=%s", "zone") >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_STATUS=%s", zonestatus) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE=%d", zonenum) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_NAME=%s", zonename) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_FAULT=%d", fault) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_TROUBLE=%d", trouble) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_TAMPER=%d", tamper) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_BYPASS=%d", bypass) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  if (envc < 32 && snprintf(tmp, sizeof(tmp), "ALARM_EVENT_ZONE_ARMED=%d", armed) >= 0) {
    if ((env[envc] = strdup(tmp)) != NULL)
      envc++;
  };
  env[envc] = NULL;
  run_trigger_program((const char **)env);
  e = env;
  while (*e) {
    free(*e);
    e++;
  }
}
```