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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <openJetduino@plt>
  cmp    $0xffffffff,%eax
  jne    L35
  mov    $0x1,%edi
  call   <exit@plt>
L35:
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x3a,%edi
  call   <servoAttach@plt>
  mov    $0x186a0,%edi
  call   <usleep@plt>
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%esi
  mov    $0x3a,%edi
  call   <servoWrite@plt>
  mov    $0x186a0,%edi
  call   <usleep@plt>
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x3a,%edi
  call   <servoRead@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xf4240,%edi
  call   <usleep@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xb4,%esi
  mov    $0x3a,%edi
  call   <servoWrite@plt>
  mov    $0x186a0,%edi
  call   <usleep@plt>
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x3a,%edi
  call   <servoRead@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xf4240,%edi
  call   <usleep@plt>
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L12
L8:
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D73(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L22
L17:
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  mov    $0x3a,%edi
  call   <servoWrite@plt>
  mov    $0x2710,%edi
  call   <usleep@plt>
  addl   $0x1,-0x8(%rbp)
L22:
  cmpl   $0xb3,-0x8(%rbp)
  jle    L17
  mov    $0xf4240,%edi
  call   <usleep@plt>
  addl   $0x1,-0xc(%rbp)
L12:
  cmpl   $0x4,-0xc(%rbp)
  jle    L8
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x3a,%edi
  call   <servoDetach@plt>
  mov    $0x0,%eax
  call   <closeJetduino@plt>
  mov    $0x1,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D57
type_guessed: string
name: extract_symbolic_data
arguments: label: D38
type_guessed: string
name: extract_symbolic_data
arguments: label: D75
type_guessed: string
name: extract_symbolic_data
arguments: label: D10
type_guessed: string
name: extract_symbolic_data
arguments: label: D7
type_guessed: string
name: extract_symbolic_data
arguments: label: D73
type_guessed: string
name: extract_symbolic_data
arguments: label: D85
type_guessed: string

tool: D57: Attaching to servo

tool: D38: Moving servo to angle 0.

tool: D75: Reading servo angle.

tool: D10: Angle: %d


tool: D7: Moving servo to angle 180.

tool: D73: Moving servo cycle %d


tool: D85: Detaching from servo

assistant: ```c
int main(void) {
  int adata;
  if (openJetduino() == -1)
    exit(1);
  printf("Attaching to servo\n");
  servoAttach(58);
  usleep(100000);
  printf("Moving servo to angle 0.\n");
  servoWrite(58, 0);
  usleep(100000);
  printf("Reading servo angle.\n");
  int cur_angle = servoRead(58);
  printf("Angle: %d\n", cur_angle);
  usleep(1000000);
  printf("Moving servo to angle 180.\n");
  servoWrite(58, 180);
  usleep(100000);
  printf("Reading servo angle.\n");
  cur_angle = servoRead(58);
  printf("Angle: %d\n", cur_angle);
  usleep(1000000);
  int num = 0, angle = 0;
  for (num = 0; num < 5; num++) {
    printf("Moving servo cycle %d\n", num);
    for (angle = 0; angle < 180; angle++) {
      servoWrite(58, angle);
      usleep(10000);
    }
    usleep(1000000);
  }
  printf("Detaching from servo\n");
  servoDetach(58);
  closeJetduino();
  return 1;
}
```