user: Demonstrate the C code that generates the assembly output below:

```asm
<test_set_then_clear>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x64,%edi
  call   <cba_alloc@plt>
  mov    %rax,%rbp
  mov    $0x0,%ebx
L28:
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <cba_set@plt>
  test   %rax,%rax
  js     L82
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <cba_get@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  jne    L101
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <cba_clear@plt>
  test   %rax,%rax
  js     L123
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <cba_get@plt>
  test   %eax,%eax
  jne    L68
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  jne    L28
  lea    D15(%rip),%rdi
  call   <puts@plt>
  test   %rbp,%rbp
  je     L103
  mov    %rbp,%rdi
  call   <cba_free@plt>
  jmp    L103
L82:
  lea    D81(%rip),%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%r12d
  test   %rbp,%rbp
  je     L103
  mov    %rbp,%rdi
  call   <cba_free@plt>
L103:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L101:
  lea    D89(%rip),%rsi
  lea    D66(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%r12d
  test   %rbp,%rbp
  je     L103
  mov    %rbp,%rdi
  call   <cba_free@plt>
  jmp    L103
L123:
  lea    D53(%rip),%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%r12d
  test   %rbp,%rbp
  je     L103
  mov    %rbp,%rdi
  call   <cba_free@plt>
  jmp    L103
L68:
  lea    D61(%rip),%rsi
  lea    D66(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%r12d
  test   %rbp,%rbp
  je     L103
  mov    %rbp,%rdi
  call   <cba_free@plt>
  jmp    L103
```

tool_calls: name: read_data
arguments: tag: D15
type: string
name: read_data
arguments: tag: D81
type: string
name: read_data
arguments: tag: D5
type: string
name: read_data
arguments: tag: D89
type: string
name: read_data
arguments: tag: D66
type: string
name: read_data
arguments: tag: D53
type: string
name: read_data
arguments: tag: D61
type: string

tool: D15: PASSED

tool: D81: cba_set(ba, i) < 0

tool: D5: FAILED: %s


tool: D89: cba_get(ba, i) == 1

tool: D66: FAILED: !(%s)


tool: D53: cba_clear(ba, i) < 0

tool: D61: cba_get(ba, i) == 0

assistant: ```c
int test_set_then_clear(void) {
  struct bitarray *ba = NULL;
  {
    int i;
    ba = cba_alloc(100);
    for (i = 0; i < 100; i++) {
      do {
        if (cba_set(ba, i) < 0) {
          printf("FAILED: %s\n", "cba_set(ba, i) < 0");
          if (ba)
            cba_free(ba);
          return 0;
        }
      } while (0);
      do {
        if (!(cba_get(ba, i) == 1)) {
          printf("FAILED: !(%s)\n", "cba_get(ba, i) == 1");
          if (ba)
            cba_free(ba);
          return 0;
        }
      } while (0);
      do {
        if (cba_clear(ba, i) < 0) {
          printf("FAILED: %s\n", "cba_clear(ba, i) < 0");
          if (ba)
            cba_free(ba);
          return 0;
        }
      } while (0);
      do {
        if (!(cba_get(ba, i) == 0)) {
          printf("FAILED: !(%s)\n", "cba_get(ba, i) == 0");
          if (ba)
            cba_free(ba);
          return 0;
        }
      } while (0);
    }
  }
  printf("PASSED\n");
  if (ba)
    cba_free(ba);
  return 1;
}
```