user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<carmen_ipc_initialize_locked_with_name>:
  endbr64
  push   %r15
  push   %r14
  mov    %edi,%r14d
  mov    %rdx,%rdi
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  call   <carmen_ipc_connect_locked@plt>
  test   %eax,%eax
  js     L158
L126:
  cmp    $0x1,%r14d
  jle    L100
  lea    -0x1(%r14),%eax
  mov    %eax,0x4(%rsp)
  cmp    $0x2,%r14d
  je     L6
  cmp    %eax,%r14d
  mov    $0x1,%ebx
  lea    D17(%rip),%r12
  cmovle %r14d,%eax
  lea    D18(%rip),%r13
  lea    D0(%rip),%r15
  mov    %eax,(%rsp)
  mov    0x8(%rsp),%rax
  lea    0x10(%rax),%rbp
  jmp    L186
  nopl   (%rax)
L150:
  call   <carmen_set_input_blogfile@plt>
  nopl   (%rax)
L114:
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    (%rsp),%ebx
  jge    L185
L186:
  mov    -0x8(%rbp),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L32
L194:
  mov    -0x8(%rbp),%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L125
  mov    0x0(%rbp),%rdi
  cmpb   $0x2d,(%rdi)
  jne    L150
  mov    -0x8(%rbp),%rdi
  lea    D82(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L77
L250:
  mov    0x0(%rbp),%rdi
  cmpb   $0x2d,(%rdi)
  je     L77
  call   <carmen_set_output_blogfile@plt>
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    (%rsp),%ebx
  jl     L186
  nopw   0x0(%rax,%rax,1)
L185:
  cmp    %ebx,%r14d
  jg     L3
L100:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L125:
  mov    -0x8(%rbp),%rdi
  lea    D82(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L77
  cmp    %ebx,0x4(%rsp)
  jg     L250
  nopl   0x0(%rax,%rax,1)
L77:
  mov    -0x8(%rbp),%rdi
  mov    %r15,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L114
  call   <carmen_disable_handlers@plt>
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L32:
  call   <carmen_set_blogfile_fast@plt>
  jmp    L194
  nopw   0x0(%rax,%rax,1)
L6:
  mov    $0x1,%ebx
  lea    D17(%rip),%r12
  lea    D18(%rip),%r13
L3:
  mov    0x8(%rsp),%rcx
  movslq %ebx,%rax
  lea    D82(%rip),%r15
  lea    (%rcx,%rax,8),%rbp
  jmp    L256
  nopl   0x0(%rax,%rax,1)
L220:
  mov    0x0(%rbp),%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  mov    0x0(%rbp),%rdi
  mov    %r15,%rsi
  test   %rax,%rax
  jne    L5
  call   <strcmp@plt>
L240:
  mov    0x0(%rbp),%rdi
  lea    D0(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L73
L228:
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    %ebx,%r14d
  jle    L100
L256:
  mov    0x0(%rbp),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L220
  call   <carmen_set_blogfile_fast@plt>
  jmp    L220
  nopw   0x0(%rax,%rax,1)
L5:
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L240
  cmp    0x4(%rsp),%ebx
  jge    L240
  mov    0x8(%rbp),%rdi
  cmpb   $0x2d,(%rdi)
  je     L240
  call   <carmen_set_output_blogfile@plt>
  jmp    L228
L73:
  call   <carmen_disable_handlers@plt>
  jmp    L228
  nopw   0x0(%rax,%rax,1)
L158:
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L126
```

tool_calls: name: read_data
arguments: tag: D17
data_type: string
name: read_data
arguments: tag: D18
data_type: string
name: read_data
arguments: tag: D0
data_type: string
name: read_data
arguments: tag: D82
data_type: string

tool: D17: -fast

tool: D18: -input_log

tool: D0: -no_handlers

tool: D82: -output_log

assistant: ```c
void carmen_ipc_initialize_locked_with_name(int argc, char **argv, char *name) {
  int err, i;
  err = carmen_ipc_connect_locked(name);
  if (err < 0)
    exit(1);
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-fast") == 0)
      carmen_set_blogfile_fast();
    if (strcmp(argv[i], "-input_log") == 0 && i < argc - 1 && argv[i + 1][0] != '-')
      carmen_set_input_blogfile(argv[i + 1]);
    else if (strcmp(argv[i], "-output_log") == 0 && i < argc - 1 && argv[i + 1][0] != '-')
      carmen_set_output_blogfile(argv[i + 1]);
    else if (strcmp(argv[i], "-no_handlers") == 0)
      carmen_disable_handlers();
  }
}
```