user: Please show me the C implementation that matches the assembly code listed below:

```asm
<test_reductions_minmax>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  mov    %rsp,%rax
  cmp    %rax,%rsp
  je     L416
L265:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L265
L416:
  sub    $0xfa0,%rsp
  orq    $0x0,0xf98(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
L239:
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    $0x3e8,%rax
  jne    L239
  movss  D67(%rip),%xmm1
  mov    %r12,%r13
  lea    0xfa0(%r12),%rbx
  mov    %r12,%rax
  movaps %xmm1,%xmm2
  nopl   0x0(%rax,%rax,1)
L65:
  minss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L65
  mov    %r12,%rax
  movaps %xmm1,%xmm0
  nopl   0x0(%rax,%rax,1)
L185:
  minss  (%rax),%xmm0
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L185
  ucomiss %xmm0,%xmm2
  jp     L341
  jne    L341
L292:
  movss  D130(%rip),%xmm0
  mov    %r12,%rax
  movaps %xmm0,%xmm3
  nopw   0x0(%rax,%rax,1)
L344:
  maxss  (%rax),%xmm3
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L344
  mov    %r12,%rax
  movaps %xmm0,%xmm2
  nopl   0x0(%rax,%rax,1)
L317:
  maxss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L317
  ucomiss %xmm2,%xmm3
  jp     L278
  jne    L278
L163:
  mov    %r12,%rax
  movaps %xmm1,%xmm3
  nopw   0x0(%rax,%rax,1)
L121:
  minss  (%rax),%xmm3
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L121
  mov    %r12,%rax
  movaps %xmm1,%xmm2
  nopl   0x0(%rax,%rax,1)
L276:
  minss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L276
  ucomiss %xmm2,%xmm3
  jp     L358
  jne    L358
L114:
  mov    %r12,%rax
  movaps %xmm0,%xmm3
  nopw   0x0(%rax,%rax,1)
L339:
  maxss  (%rax),%xmm3
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L339
  mov    %r12,%rax
  movaps %xmm0,%xmm2
  nopl   0x0(%rax,%rax,1)
L39:
  maxss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L39
  ucomiss %xmm2,%xmm3
  jp     L193
  jne    L193
L34:
  mov    %r12,%rax
  movaps %xmm1,%xmm3
  nopw   0x0(%rax,%rax,1)
L273:
  minss  (%rax),%xmm3
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L273
  mov    %r12,%rax
  movaps %xmm1,%xmm2
  nopl   0x0(%rax,%rax,1)
L199:
  minss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L199
  ucomiss %xmm2,%xmm3
  jp     L116
  jne    L116
L59:
  mov    %r12,%rax
  movaps %xmm0,%xmm3
  nopw   0x0(%rax,%rax,1)
L355:
  maxss  (%rax),%xmm3
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L355
  mov    %r12,%rax
  movaps %xmm0,%xmm2
  nopl   0x0(%rax,%rax,1)
L398:
  maxss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L398
  ucomiss %xmm2,%xmm3
  jp     L41
  jne    L41
L434:
  mov    %r12,%rax
  movaps %xmm1,%xmm2
  nopw   0x0(%rax,%rax,1)
L326:
  minss  (%rax),%xmm2
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L326
  mov    %r12,%rax
L18:
  minss  (%rax),%xmm1
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L18
  ucomiss %xmm1,%xmm2
  jp     L335
  jne    L335
L176:
  mov    %r12,%rax
  movaps %xmm0,%xmm1
  nopw   0x0(%rax,%rax,1)
L402:
  maxss  (%rax),%xmm1
  add    $0x4,%rax
  cmp    %rbx,%rax
  jne    L402
  nopl   (%rax)
L257:
  maxss  0x0(%r13),%xmm0
  add    $0x4,%r13
  cmp    %rbx,%r13
  jne    L257
  ucomiss %xmm0,%xmm1
  jp     L251
  jne    L251
L282:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L381
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L335:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  jmp    L176
L251:
  xor    %eax,%eax
  call   <abort@plt>
  jmp    L282
L41:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  movss  D67(%rip),%xmm1
  jmp    L434
L116:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  movss  D67(%rip),%xmm1
  jmp    L59
L193:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  movss  D67(%rip),%xmm1
  jmp    L34
L358:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  movss  D67(%rip),%xmm1
  jmp    L114
L278:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D130(%rip),%xmm0
  movss  D67(%rip),%xmm1
  jmp    L163
L341:
  xor    %eax,%eax
  call   <abort@plt>
  movss  D67(%rip),%xmm1
  jmp    L292
L381:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D67
data_type: byte[4]
name: read_data
arguments: data_tag: D130
data_type: byte[4]

tool: {"D67": [0x00,0x40,0x7a,0x44]}

tool: {"D130": [0x00,0x00,0x80,0xbf]}

assistant: ```c
void test_reductions_minmax(void) {
  const int n = 1000;
  int i;
  float array[n];
  for (i = 0; i < n; i++)
    array[i] = i;
  {
    float res, vres;
    res = (n + 1);
#pragma acc parallel num_gangs(ng) copy(res)

#pragma acc loop gang reduction(min : res)
    for (i = 0; i < n; i++)
      res = (((res) < ((array[i]))) ? (res) : ((array[i])));
    vres = (n + 1);
    for (i = 0; i < n; i++)
      vres = (((vres) < ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (-1);
#pragma acc parallel num_gangs(ng) copy(res)

#pragma acc loop gang reduction(max : res)
    for (i = 0; i < n; i++)
      res = (((res) > ((array[i]))) ? (res) : ((array[i])));
    vres = (-1);
    for (i = 0; i < n; i++)
      vres = (((vres) > ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (n + 1);
#pragma acc parallel num_workers(nw) copy(res)

#pragma acc loop worker reduction(min : res)
    for (i = 0; i < n; i++)
      res = (((res) < ((array[i]))) ? (res) : ((array[i])));
    vres = (n + 1);
    for (i = 0; i < n; i++)
      vres = (((vres) < ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (-1);
#pragma acc parallel num_workers(nw) copy(res)

#pragma acc loop worker reduction(max : res)
    for (i = 0; i < n; i++)
      res = (((res) > ((array[i]))) ? (res) : ((array[i])));
    vres = (-1);
    for (i = 0; i < n; i++)
      vres = (((vres) > ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (n + 1);
#pragma acc parallel vector_length(vl) copy(res)

#pragma acc loop vector reduction(min : res)
    for (i = 0; i < n; i++)
      res = (((res) < ((array[i]))) ? (res) : ((array[i])));
    vres = (n + 1);
    for (i = 0; i < n; i++)
      vres = (((vres) < ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (-1);
#pragma acc parallel vector_length(vl) copy(res)

#pragma acc loop vector reduction(max : res)
    for (i = 0; i < n; i++)
      res = (((res) > ((array[i]))) ? (res) : ((array[i])));
    vres = (-1);
    for (i = 0; i < n; i++)
      vres = (((vres) > ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (n + 1);
#pragma acc parallel num_gangs(ng) num_workers(nw) vector_length(vl) copy(res)

#pragma acc loop gang worker vector reduction(min : res)
    for (i = 0; i < n; i++)
      res = (((res) < ((array[i]))) ? (res) : ((array[i])));
    vres = (n + 1);
    for (i = 0; i < n; i++)
      vres = (((vres) < ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
  {
    float res, vres;
    res = (-1);
#pragma acc parallel num_gangs(ng) num_workers(nw) vector_length(vl) copy(res)

#pragma acc loop gang worker vector reduction(max : res)
    for (i = 0; i < n; i++)
      res = (((res) > ((array[i]))) ? (res) : ((array[i])));
    vres = (-1);
    for (i = 0; i < n; i++)
      vres = (((vres) > ((array[i]))) ? (vres) : ((array[i])));
    if (res != vres)
      abort();
  };
}
```