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

```asm
<set_dims>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  mov    $0x3,%edx
  lea    D112(%rip),%rsi
  push   %rbx
  mov    %rdi,%rbx
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L99
  mov    D21(%rip),%rax
  movl   $0x2,0x8(%rbx)
  mov    %rax,(%rbx)
  xor    %eax,%eax
L42:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L99:
  mov    $0x3,%edx
  lea    D84(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L37
  mov    D72(%rip),%rax
  movl   $0x1,0x8(%rbx)
  mov    %rax,(%rbx)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L37:
  mov    $0x3,%edx
  lea    D110(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L16
  mov    D80(%rip),%rax
  movl   $0x2,0x8(%rbx)
  mov    %rax,(%rbx)
  xor    %eax,%eax
  jmp    L42
  xchg   %ax,%ax
L16:
  mov    $0x3,%edx
  lea    D117(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L109
  mov    D76(%rip),%rax
  movl   $0x1,0x8(%rbx)
  mov    %rax,(%rbx)
  xor    %eax,%eax
  jmp    L42
  nopl   0x0(%rax)
L109:
  mov    $0x3,%edx
  lea    D81(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L47
  mov    D106(%rip),%rax
  movl   $0x0,0x8(%rbx)
  mov    %rax,(%rbx)
  xor    %eax,%eax
  jmp    L42
L47:
  mov    $0x3,%edx
  lea    D53(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L32
  mov    D13(%rip),%rax
  movl   $0x0,0x8(%rbx)
  mov    %rax,(%rbx)
  xor    %eax,%eax
  jmp    L42
L32:
  lea    D18(%rip),%rdi
  call   <write_log_comment_disp@plt>
  mov    $0x1,%eax
  jmp    L42
```

tool_calls: name: retrieve_data
arguments: tag: D112
type_guessed: string
name: retrieve_data
arguments: tag: D21
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D84
type_guessed: string
name: retrieve_data
arguments: tag: D72
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D110
type_guessed: string
name: retrieve_data
arguments: tag: D80
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D117
type_guessed: string
name: retrieve_data
arguments: tag: D76
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D81
type_guessed: string
name: retrieve_data
arguments: tag: D106
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D53
type_guessed: string
name: retrieve_data
arguments: tag: D13
type_guessed: byte[8]
name: retrieve_data
arguments: tag: D18
type_guessed: string

tool: D112: xyz

tool: {"D21": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: D84: xzy

tool: {"D72": [0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

tool: D110: yxz

tool: {"D80": [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D117: yzx

tool: {"D76": [0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D81: zxy

tool: {"D106": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

tool: D53: zyx

tool: {"D13": [0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: D18: Axis order must be a permutation of xyz.


assistant: ```c
int set_dims(int dim[3], const char *axis_order) {
  if (0 == strncmp(axis_order, "xyz", 3)) {
    dim[0] = 0;
    dim[1] = 1;
    dim[2] = 2;
  } else if (0 == strncmp(axis_order, "xzy", 3)) {
    dim[0] = 0;
    dim[2] = 1;
    dim[1] = 2;
  } else if (0 == strncmp(axis_order, "yxz", 3)) {
    dim[1] = 0;
    dim[0] = 1;
    dim[2] = 2;
  } else if (0 == strncmp(axis_order, "yzx", 3)) {
    dim[1] = 0;
    dim[2] = 1;
    dim[0] = 2;
  } else if (0 == strncmp(axis_order, "zxy", 3)) {
    dim[2] = 0;
    dim[0] = 1;
    dim[1] = 2;
  } else if (0 == strncmp(axis_order, "zyx", 3)) {
    dim[2] = 0;
    dim[1] = 1;
    dim[0] = 2;
  } else {
    write_log_comment_disp("Axis order must be a permutation of xyz.\n");
    return 1;
  }
  return 0;
}
```