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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  lea    D39(%rip),%r13
  push   %r12
  mov    %r13,%rdi
  push   %rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jle    L176
  lea    0xc(%rsp),%r14
  lea    D8(%rip),%r12
  nopl   0x0(%rax)
L60:
  mov    %r14,%rsi
  mov    %r13,%rdi
  lea    0x10(%rsp),%rbp
  xor    %ebx,%ebx
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L168
  xchg   %ax,%ax
L157:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  cmp    %ebx,%eax
  jg     L157
  test   %eax,%eax
  jle    L168
  lea    -0x1(%rax),%edx
  cmp    $0x2,%edx
  jbe    L55
  movdqa 0x10(%rsp),%xmm1
  movdqa D27(%rip),%xmm2
  pxor   %xmm5,%xmm5
  mov    %eax,%edx
  shr    $0x2,%edx
  movdqa %xmm1,%xmm0
  pcmpgtd D27(%rip),%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  movdqa %xmm0,%xmm3
  movdqa %xmm1,%xmm0
  pcmpgtd %xmm5,%xmm0
  por    %xmm2,%xmm3
  pand   %xmm1,%xmm0
  cmp    $0x1,%edx
  je     L36
  movdqa 0x20(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x2,%edx
  je     L36
  movdqa 0x30(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x3,%edx
  je     L36
  movdqa 0x40(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x4,%edx
  je     L36
  movdqa 0x50(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x5,%edx
  je     L36
  movdqa 0x60(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x6,%edx
  je     L36
  movdqa 0x70(%rsp),%xmm2
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  movdqa %xmm2,%xmm4
  pand   %xmm1,%xmm4
  pandn  %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  por    %xmm4,%xmm3
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    $0x7,%edx
  je     L36
  movdqa 0x80(%rsp),%xmm1
  movdqa %xmm1,%xmm2
  pcmpgtd %xmm3,%xmm2
  pand   %xmm2,%xmm3
  pandn  %xmm1,%xmm2
  por    %xmm2,%xmm3
  movdqa %xmm1,%xmm2
  pcmpgtd %xmm0,%xmm2
  pand   %xmm2,%xmm1
  pandn  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  por    %xmm1,%xmm0
L36:
  movdqa %xmm0,%xmm2
  mov    %eax,%ecx
  psrldq $0x8,%xmm2
  and    $0xfffffffc,%ecx
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movdqa %xmm3,%xmm2
  psrldq $0x8,%xmm2
  movd   %xmm0,%esi
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm3,%xmm1
  pand   %xmm1,%xmm3
  pandn  %xmm2,%xmm1
  movdqa %xmm3,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movd   %xmm1,%edx
  test   $0x3,%al
  je     L87
L6:
  movslq %ecx,%rdi
  mov    0x10(%rsp,%rdi,4),%edi
  cmp    %edi,%edx
  cmovg  %edi,%edx
  cmp    %edi,%esi
  cmovl  %edi,%esi
  lea    0x1(%rcx),%edi
  cmp    %edi,%eax
  jle    L87
  movslq %edi,%rdi
  mov    0x10(%rsp,%rdi,4),%edi
  cmp    %edi,%edx
  cmovg  %edi,%edx
  cmp    %edi,%esi
  cmovl  %edi,%esi
  add    $0x2,%ecx
  cmp    %ecx,%eax
  jle    L87
  movslq %ecx,%rcx
  mov    0x10(%rsp,%rcx,4),%eax
  cmp    %eax,%edx
  cmovg  %eax,%edx
  cmp    %eax,%esi
  cmovl  %eax,%esi
L87:
  sub    %edx,%esi
  add    %esi,%esi
L121:
  mov    %r13,%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x8(%rsp)
  test   %eax,%eax
  jg     L60
L176:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  add    $0xa0,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L168:
  mov    $0xffffff38,%esi
  jmp    L121
L55:
  xor    %esi,%esi
  mov    $0x64,%edx
  xor    %ecx,%ecx
  jmp    L6
L43:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D39
type_infered: string
name: unpack_data
arguments: label: D8
type_infered: string
name: unpack_data
arguments: label: D27
type_infered: byte[16]

tool: D39: %d


tool: D8: %d

tool: {"D27": [0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00]}

assistant: ```c
int main() {
  int num_cases, num_items;
  int i, item[32];
  int min, max;
  scanf("%d\n", &num_cases);
  while (num_cases-- > 0) {
    scanf("%d\n", &num_items);
    for (i = 0; i < num_items; i++) {
      scanf("%d", &item[i]);
    }
    min = 100, max = 0;
    for (i = 0; i < num_items; i++) {
      if (min > item[i])
        min = item[i];
      if (max < item[i])
        max = item[i];
    }
    printf("%d\n", 2 * (max - min));
  }
  return 0;
}
```