user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<image_rgb48be_from_rgb96f>:
  endbr64
  mov    %edi,%eax
  push   %r15
  imul   %esi,%eax
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  lea    (%rax,%rax,2),%edi
  push   %rbx
  add    %edi,%edi
  movslq %edi,%rdi
  sub    $0x28,%rsp
  call   <malloc@plt>
  mov    %rax,%r14
  test   %r12d,%r12d
  jle    L30
  lea    -0x1(%rbp),%eax
  lea    0x0(%rbp,%rbp,2),%r15d
  xor    %ebx,%ebx
  xor    %r10d,%r10d
  mov    %rax,0x10(%rsp)
  lea    0x6(%r14),%rax
  add    %r15d,%r15d
  xor    %r11d,%r11d
  mov    %rax,0x18(%rsp)
  movss  D3(%rip),%xmm0
  nopl   0x0(%rax)
L5:
  test   %ebp,%ebp
  jle    L27
  lea    (%r10,%r10,2),%eax
  mov    0x18(%rsp),%rdi
  movslq %r10d,%rdx
  mov    %ebx,0xc(%rsp)
  cltq
  add    0x10(%rsp),%rdx
  lea    0x0(%r13,%rax,4),%rsi
  lea    (%rdx,%rdx,2),%rdx
  movslq %ebx,%rax
  add    %r14,%rax
  lea    (%rdi,%rdx,2),%r9
  nopw   0x0(%rax,%rax,1)
L17:
  movss  0x4(%rsi),%xmm1
  xor    %r8d,%r8d
  mulss  %xmm0,%xmm1
  cvttss2si %xmm1,%ecx
  movss  0x8(%rsi),%xmm1
  mulss  %xmm0,%xmm1
  cvttss2si %xmm1,%edi
  movss  (%rsi),%xmm1
  mulss  %xmm0,%xmm1
  mov    %edi,0x8(%rsp)
  cvttss2si %xmm1,%ebx
  test   %ebx,%ebx
  cmovs  %r8d,%ebx
  mov    $0xffff,%r8d
  cmp    %r8d,%ebx
  cmovg  %r8d,%ebx
  xor    %edi,%edi
  test   %ecx,%ecx
  cmovs  %edi,%ecx
  mov    $0xffff,%edi
  mov    %bh,(%rax)
  cmp    %edi,%ecx
  mov    %bl,0x1(%rax)
  cmovg  %edi,%ecx
  mov    0x8(%rsp),%edi
  mov    %ch,0x2(%rax)
  mov    %edi,%edx
  mov    %cl,0x3(%rax)
  xor    %ecx,%ecx
  test   %edi,%edi
  cmovs  %ecx,%edx
  mov    $0xffff,%ecx
  cmp    %ecx,%edx
  cmovg  %ecx,%edx
  add    $0x6,%rax
  add    $0xc,%rsi
  mov    %dh,-0x2(%rax)
  mov    %dl,-0x1(%rax)
  cmp    %rax,%r9
  jne    L17
  mov    0xc(%rsp),%ebx
L27:
  add    $0x1,%r11d
  add    %ebp,%r10d
  add    %r15d,%ebx
  cmp    %r11d,%r12d
  jne    L5
L30:
  add    $0x28,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D3
type_infered: byte[4]

tool: {"D3": [0x00,0xff,0x7f,0x47]}

assistant: ```c
unsigned char *image_rgb48be_from_rgb96f(signed int xres, signed int yres, float *fimg) {
  signed int x;
  signed int y;
  signed int R;
  signed int G;
  signed int B;
  unsigned char *img;
  void *return_value_malloc$1;
  return_value_malloc$1 = malloc((unsigned long int)(xres * yres * 6));
  img = (unsigned char *)return_value_malloc$1;
  y = 0;
  while (!(y >= yres)) {
    x = 0;
    while (!(x >= xres)) {
      signed int faddr = (xres * y + x) * 3;
      signed int iaddr = faddr * 2;
      R = (signed int)(fimg[(signed long int)faddr] * 65535.000000f);
      G = (signed int)(fimg[(signed long int)(faddr + 1)] * 65535.000000f);
      B = (signed int)(fimg[(signed long int)(faddr + 2)] * 65535.000000f);
      if (R > 65535)
        R = 65535;
      if (R < 0)
        R = 0;
      img[(signed long int)iaddr] = (unsigned char)(R >> 8 & 255);
      img[(signed long int)(iaddr + 1)] = (unsigned char)(R & 255);
      if (G > 65535)
        G = 65535;
      if (G < 0)
        G = 0;
      img[(signed long int)(iaddr + 2)] = (unsigned char)(G >> 8 & 255);
      img[(signed long int)(iaddr + 3)] = (unsigned char)(G & 255);
      if (B > 65535)
        B = 65535;
      if (B < 0)
        B = 0;
      img[(signed long int)(iaddr + 4)] = (unsigned char)(B >> 8 & 255);
      img[(signed long int)(iaddr + 5)] = (unsigned char)(B & 255);
      x = x + 1;
    }
    y = y + 1;
  }
  return img;
}
```