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

```asm
<gen_rgb24_stripe>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x20(%rsp)
  movl   $0x0,0x80(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  test   %edi,%edi
  jle    L31
  mov    %esi,%r14d
  test   %esi,%esi
  jle    L31
  mov    %edi,%eax
  mov    %edi,%ebx
  imul   %esi,%eax
  lea    (%rax,%rax,2),%eax
  mov    %eax,0xc(%rsp)
L33:
  mov    0xc(%rsp),%edi
  call   <malloc@plt>
  mov    %r14d,%ecx
  mov    %ebx,%edx
  lea    D0(%rip),%rsi
  mov    %rax,%r15
  lea    0x20(%rsp),%rax
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  call   <sprintf@plt>
  mov    0x10(%rsp),%rdi
  lea    D59(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r8
  test   %rax,%rax
  je     L0
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  mov    $0xffffffff,%ecx
L49:
  lea    (%r10,%r10,2),%eax
  xor    %edx,%edx
  cltq
  add    %r15,%rax
  nopl   0x0(%rax,%rax,1)
L71:
  test   $0x1,%dl
  mov    %ecx,%r9d
  mov    %ecx,%edi
  mov    %ecx,%esi
  cmovne %ebp,%r9d
  cmovne %r12d,%edi
  cmovne %r13d,%esi
  add    $0x1,%edx
  add    $0x3,%rax
  mov    %r9b,-0x3(%rax)
  mov    %dil,-0x2(%rax)
  mov    %sil,-0x1(%rax)
  cmp    %edx,%ebx
  jne    L71
  add    $0x1,%r11d
  add    %ebx,%r10d
  cmp    %r11d,%r14d
  jne    L49
  mov    0xc(%rsp),%esi
  mov    %r8,%rcx
  mov    $0x1,%edx
  mov    %r15,%rdi
  mov    %r8,0x18(%rsp)
  call   <fwrite@plt>
  mov    0x18(%rsp),%rdi
  call   <fclose@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rsi
  lea    D13(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
L50:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L21
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L31:
  lea    D54(%rip),%rdi
  mov    $0x1e0,%r14d
  mov    $0x280,%ebx
  call   <puts@plt>
  lea    D16(%rip),%rdi
  call   <puts@plt>
  movl   $0xe1000,0xc(%rsp)
  jmp    L33
L21:
  call   <__stack_chk_fail@plt>
L0:
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L50
```

tool_calls: name: unpack_data
arguments: tag: D0
type: string
name: unpack_data
arguments: tag: D59
type: string
name: unpack_data
arguments: tag: D13
type: string
name: unpack_data
arguments: tag: D54
type: string
name: unpack_data
arguments: tag: D16
type: string
name: unpack_data
arguments: tag: D55
type: string

tool: D0: rgbstripe_%dx%d_rgb24.rgb

tool: D59: wb+

tool: D13: Finish generate %s!


tool: D54: Error: Width, Height cannot be 0 or negative number!

tool: D16: Default Param is used.

tool: D55: Error: Cannot create file!

assistant: ```c
int gen_rgb24_stripe(int width, int height, unsigned char r, unsigned char g, unsigned char b) {
  unsigned char *data = NULL;
  char filename[100] = {0};
  FILE *fp = NULL;
  int i = 0, j = 0;
  if (width <= 0 || height <= 0) {
    printf("Error: Width, Height cannot be 0 or negative number!\n");
    printf("Default Param is used.\n");
    width = 640;
    height = 480;
  }
  data = (unsigned char *)malloc(width * height * 3);
  sprintf(filename, "rgbstripe_%dx%d_rgb24.rgb", width, height);
  if ((fp = fopen(filename, "wb+")) == NULL) {
    printf("Error: Cannot create file!");
    return -1;
  }
  for (j = 0; j < height; j++) {
    for (i = 0; i < width; i++) {
      if (i % 2 != 0) {
        data[(j * width + i) * 3 + 0] = r;
        data[(j * width + i) * 3 + 1] = g;
        data[(j * width + i) * 3 + 2] = b;
      } else {
        data[(j * width + i) * 3 + 0] = 255;
        data[(j * width + i) * 3 + 1] = 255;
        data[(j * width + i) * 3 + 2] = 255;
      }
    }
  }
  fwrite(data, width * height * 3, 1, fp);
  fclose(fp);
  free(data);
  printf("Finish generate %s!\n", filename);
  return 0;
}
```