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

```asm
<get_min_max_colors_inset_bbox>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movb   $0xff,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  mov    %al,-0xa(%rbp)
  movzbl -0xa(%rbp),%eax
  mov    %al,-0xb(%rbp)
  movb   $0x0,-0xc(%rbp)
  movzbl -0xc(%rbp),%eax
  mov    %al,-0xd(%rbp)
  movzbl -0xd(%rbp),%eax
  mov    %al,-0xe(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L24
L147:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0xb(%rbp),%eax
  cmp    %al,%dl
  jae    L49
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xb(%rbp)
L49:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0xa(%rbp),%eax
  cmp    %al,%dl
  jae    L69
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
L69:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0x9(%rbp),%eax
  cmp    %al,%dl
  jae    L50
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
L50:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0xe(%rbp),%eax
  cmp    %al,%dl
  jbe    L56
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xe(%rbp)
L56:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0xd(%rbp),%eax
  cmp    %al,%dl
  jbe    L82
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
L82:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  movzbl -0xc(%rbp),%eax
  cmp    %al,%dl
  jbe    L44
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xc(%rbp)
L44:
  addl   $0x1,-0x18(%rbp)
L24:
  cmpl   $0xf,-0x18(%rbp)
  jle    L147
  movzbl -0xe(%rbp),%eax
  movzbl %al,%eax
  movzbl -0xb(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  sar    $0x4,%eax
  mov    %al,-0x11(%rbp)
  movzbl -0xd(%rbp),%eax
  movzbl %al,%eax
  movzbl -0xa(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  sar    $0x4,%eax
  mov    %al,-0x10(%rbp)
  movzbl -0xc(%rbp),%eax
  movzbl %al,%eax
  movzbl -0x9(%rbp),%edx
  movzbl %dl,%edx
  sub    %edx,%eax
  sar    $0x4,%eax
  mov    %al,-0xf(%rbp)
  movzbl -0xb(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x11(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %al,-0xb(%rbp)
  movzbl -0xa(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x10(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %al,-0xa(%rbp)
  movzbl -0x9(%rbp),%eax
  movzbl %al,%edx
  movzbl -0xf(%rbp),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0xe(%rbp),%edx
  movzbl -0x11(%rbp),%eax
  cmp    %al,%dl
  jb     L102
  movzbl -0xe(%rbp),%eax
  movzbl -0x11(%rbp),%edx
  sub    %edx,%eax
  jmp    L144
L102:
  mov    $0x0,%eax
L144:
  mov    %al,-0xe(%rbp)
  movzbl -0xd(%rbp),%edx
  movzbl -0x10(%rbp),%eax
  cmp    %al,%dl
  jb     L123
  movzbl -0xd(%rbp),%eax
  movzbl -0x10(%rbp),%edx
  sub    %edx,%eax
  jmp    L41
L123:
  mov    $0x0,%eax
L41:
  mov    %al,-0xd(%rbp)
  movzbl -0xc(%rbp),%edx
  movzbl -0xf(%rbp),%eax
  cmp    %al,%dl
  jb     L74
  movzbl -0xc(%rbp),%eax
  movzbl -0xf(%rbp),%edx
  sub    %edx,%eax
  jmp    L141
L74:
  mov    $0x0,%eax
L141:
  mov    %al,-0xc(%rbp)
  lea    -0xb(%rbp),%rax
  mov    %rax,%rdi
  call   <pack_rgb565@plt>
  mov    -0x38(%rbp),%rdx
  mov    %ax,(%rdx)
  lea    -0xe(%rbp),%rax
  mov    %rax,%rdi
  call   <pack_rgb565@plt>
  mov    -0x30(%rbp),%rdx
  mov    %ax,(%rdx)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

assistant: ```c
void get_min_max_colors_inset_bbox(const unsigned char *block, unsigned short *max16, unsigned short *min16) {
  int i;
  unsigned char inset[3], mx[3], mn[3];
  mn[0] = mn[1] = mn[2] = 255;
  mx[0] = mx[1] = mx[2] = 0;
  for (i = 0; i < 16; ++i) {
    if (block[4 * i + 0] < mn[0])
      mn[0] = block[4 * i + 0];
    if (block[4 * i + 1] < mn[1])
      mn[1] = block[4 * i + 1];
    if (block[4 * i + 2] < mn[2])
      mn[2] = block[4 * i + 2];
    if (block[4 * i + 0] > mx[0])
      mx[0] = block[4 * i + 0];
    if (block[4 * i + 1] > mx[1])
      mx[1] = block[4 * i + 1];
    if (block[4 * i + 2] > mx[2])
      mx[2] = block[4 * i + 2];
  }
  inset[0] = (mx[0] - mn[0]) >> 4;
  inset[1] = (mx[1] - mn[1]) >> 4;
  inset[2] = (mx[2] - mn[2]) >> 4;
  mn[0] = (mn[0] + inset[0] <= 255) ? mn[0] + inset[0] : 255;
  mn[1] = (mn[1] + inset[1] <= 255) ? mn[1] + inset[1] : 255;
  mn[2] = (mn[2] + inset[2] <= 255) ? mn[2] + inset[2] : 255;
  mx[0] = (mx[0] >= inset[0]) ? mx[0] - inset[0] : 0;
  mx[1] = (mx[1] >= inset[1]) ? mx[1] - inset[1] : 0;
  mx[2] = (mx[2] >= inset[2]) ? mx[2] - inset[2] : 0;
  *min16 = pack_rgb565(mn);
  *max16 = pack_rgb565(mx);
}
```