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

```asm
<main>:
  endbr64
  push   %r15
  lea    D34(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x4e8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x4d8(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L274
  lea    0x1b0(%rsp),%rax
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  mov    %rax,0x8(%rsp)
  lea    0x340(%rsp),%rbp
  lea    0x20(%rsp),%rbx
  lea    D53(%rip),%r13
  nopl   0x0(%rax)
L211:
  mov    0x8(%rsp),%r14
  lea    0x0(%rbp,%r12,1),%rcx
  lea    (%rbx,%r12,1),%rsi
  xor    %eax,%eax
  mov    %r13,%rdi
  add    $0x1,%r15d
  lea    (%r12,%r14,1),%rdx
  add    $0x4,%r12
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  cmp    %r15d,%eax
  jg     L211
  test   %eax,%eax
  jle    L274
  xor    %r15d,%r15d
  lea    D45(%rip),%r12
  nop
L237:
  mov    0x0(%rbp,%r15,4),%r13d
  mov    (%rbx,%r15,4),%edi
  cmp    %edi,%r13d
  jle    L50
  mov    (%r14),%esi
  cmp    %esi,%r13d
  jg     L234
  test   %r13d,%r13d
  je     L312
  cmp    %esi,%r13d
  je     L26
L111:
  call   <gcd@plt>
  mov    %eax,%r8d
  mov    %r13d,%eax
  cltd
  idiv   %r8d
  test   %edx,%edx
  jne    L234
  mov    0x0(%rbp,%r15,4),%edx
  test   %edx,%edx
  je     L316
  xor    %ecx,%ecx
  xor    %eax,%eax
  xor    %esi,%esi
  jmp    L253
  nopl   0x0(%rax)
L103:
  mov    (%rbx,%r15,4),%eax
L192:
  cmp    %edx,%ecx
  je     L204
L196:
  cmp    %edx,%eax
  je     L204
L253:
  add    $0x1,%esi
  test   %eax,%eax
  je     L103
  mov    (%r14),%edi
  cmp    %ecx,%edi
  je     L241
  add    %ecx,%eax
  cmp    %eax,%edi
  cmovg  %eax,%edi
  mov    %edi,%ecx
  sub    %edi,%eax
  cmp    %edx,%ecx
  jne    L196
  nopl   (%rax)
L204:
  xor    %eax,%eax
  xor    %ecx,%ecx
  xor    %edi,%edi
  jmp    L134
  nopl   0x0(%rax,%rax,1)
L271:
  mov    (%r14),%eax
L59:
  cmp    %edx,%ecx
  je     L88
L109:
  cmp    %edx,%eax
  je     L88
L134:
  add    $0x1,%edi
  test   %eax,%eax
  je     L271
  mov    (%rbx,%r15,4),%r8d
  cmp    %ecx,%r8d
  je     L37
  add    %ecx,%eax
  mov    %r8d,%ecx
  cmp    %eax,%r8d
  cmovg  %eax,%ecx
  sub    %ecx,%eax
  cmp    %edx,%ecx
  jne    L109
L88:
  cmp    %edi,%esi
  cmovg  %edi,%esi
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  add    $0x4,%r14
  call   <printf@plt>
  cmp    %r15d,0x1c(%rsp)
  jg     L237
L274:
  mov    0x4d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L60
  add    $0x4e8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L50:
  test   %r13d,%r13d
  je     L312
  cmp    %edi,%r13d
  je     L26
  mov    (%r14),%esi
  cmp    %esi,%r13d
  jne    L111
L26:
  mov    %r12,%rdi
  call   <puts@plt>
L106:
  add    $0x1,%r15
  add    $0x4,%r14
  cmp    %r15d,0x1c(%rsp)
  jg     L237
  jmp    L274
  nopl   0x0(%rax,%rax,1)
L241:
  xor    %ecx,%ecx
  jmp    L192
  nopw   0x0(%rax,%rax,1)
L234:
  lea    D47(%rip),%rdi
  call   <puts@plt>
  jmp    L106
  xchg   %ax,%ax
L37:
  xor    %ecx,%ecx
  jmp    L59
  nopw   0x0(%rax,%rax,1)
L312:
  lea    D20(%rip),%rdi
  call   <puts@plt>
  jmp    L106
L316:
  xor    %esi,%esi
  xor    %edi,%edi
  jmp    L88
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D34
data_type: string
name: extract_symbolic_data
arguments: data_label: D53
data_type: string
name: extract_symbolic_data
arguments: data_label: D45
data_type: string
name: extract_symbolic_data
arguments: data_label: D18
data_type: string
name: extract_symbolic_data
arguments: data_label: D47
data_type: string
name: extract_symbolic_data
arguments: data_label: D20
data_type: string

tool: D34: %d

tool: D53: %d %d %d

tool: D45: 1

tool: D18: %d


tool: D47: -1

tool: D20: 0

assistant: ```c
int main(void) {
  int t, i, min, max, steps, moves, moves1, ca, cb, sum;
  int a[100], b[100], c[100];
  scanf("%d", &t);
  for (i = 0; i < t; i++)
    scanf("%d %d %d", &a[i], &b[i], &c[i]);
  for (i = 0; i < t; i++) {
    if (c[i] > a[i] && c[i] > b[i]) {
      printf("-1\n");
      continue;
    } else if (c[i] == 0) {
      printf("0\n");
      continue;
    } else if (c[i] == a[i] || c[i] == b[i]) {
      printf("1\n");
      continue;
    } else if (c[i] % gcd(a[i], b[i]) != 0) {
      printf("-1\n");
      continue;
    } else {
      moves = 0;
      moves1 = 0;
      ca = 0;
      cb = 0;
      while (ca != c[i] && cb != c[i]) {
        if (ca == 0) {
          ca = a[i];
          moves++;
        } else if (cb == b[i]) {
          cb = 0;
          moves++;
        } else {
          sum = ca + cb;
          cb = (((sum) < (b[i])) ? (sum) : (b[i]));
          ca = sum - cb;
          moves++;
        }
      }
      ca = 0;
      cb = 0;
      while (ca != c[i] && cb != c[i]) {
        if (cb == 0) {
          cb = b[i];
          moves1++;
        } else if (ca == a[i]) {
          ca = 0;
          moves1++;
        } else {
          sum = ca + cb;
          ca = (((sum) < (a[i])) ? (sum) : (a[i]));
          cb = sum - ca;
          moves1++;
        }
      }
      printf("%d\n", (((moves) < (moves1)) ? (moves) : (moves1)));
    }
  }
  return (0);
}
```