user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  jg     L89
  lea    D31(%rip),%rdi
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D15(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
L89:
  mov    %rsi,%rbx
  lea    0x10(%rsp),%r12
  mov    0x8(%rsi),%rsi
  lea    0x60(%rsp),%r14
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    0x10(%rbx),%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    0x18(%rbx),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %r12,%rdi
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <does_not_exist@plt>
  test   %eax,%eax
  je     L62
  lea    D26(%rip),%rdi
  mov    %r12,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
L62:
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <does_not_exist@plt>
  mov    %r14,%rsi
  test   %eax,%eax
  jne    L97
  xor    %eax,%eax
  mov    %r12,%rdi
  call   <are_not_same_size@plt>
  test   %eax,%eax
  je     L45
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
L97:
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
L45:
  lea    0x8(%rsp),%rdx
  mov    %rsp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <get_image_size@plt>
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  xor    %eax,%eax
  call   <allocate_image_array@plt>
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  movslq %eax,%r13
  xor    %eax,%eax
  call   <allocate_image_array@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  movslq %eax,%rbp
  xor    %eax,%eax
  call   <read_image_array@plt>
  mov    %r14,%rdi
  mov    %rbp,%rsi
  xor    %eax,%eax
  call   <read_image_array@plt>
  mov    0x8(%rsp),%r11
  mov    %r13,%r8
  mov    %rbp,%r10
  mov    (%rsp),%r14
  xor    %r9d,%r9d
  lea    (%r11,%r11,1),%rdi
L77:
  cmp    %r9,%r14
  jle    L29
  test   %r11,%r11
  jle    L15
  mov    (%r10),%rsi
  xor    %eax,%eax
L98:
  cmpw   $0x0,(%rsi,%rax,1)
  je     L91
  mov    (%r8),%rcx
  mov    $0xff,%r15d
  add    %rax,%rcx
  movzwl (%rcx),%edx
  add    %ebx,%edx
  cmp    %r15w,%dx
  cmovg  %r15d,%edx
  mov    %dx,(%rcx)
L91:
  add    $0x2,%rax
  cmp    %rax,%rdi
  jne    L98
L15:
  add    $0x1,%r9
  add    $0x8,%r8
  add    $0x8,%r10
  jmp    L77
L29:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <write_image_array@plt>
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <free_image_array@plt>
  mov    (%rsp),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <free_image_array@plt>
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  add    $0xc8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D31
type_guessed: string
name: unpack_data
arguments: data_tag: D15
type_guessed: string
name: unpack_data
arguments: data_tag: D26
type_guessed: string
name: unpack_data
arguments: data_tag: D16
type_guessed: string
name: unpack_data
arguments: data_tag: D14
type_guessed: string

tool: D31: 

Not enough parameters:

tool: D15: 
   usage: hidet image-file text-file-image factor  

tool: D26: 
ERROR input file %s does not exist

tool: D16: 
ERROR images are not same size

tool: D14: 
ERROR output file %s does not exist

assistant: ```c
int main(argc, argv)
int argc;
char *argv[];
{
  char image_name[80], water_name[80];
  int i, j;
  long length, width;
  short factor;
  short **the_image;
  short **out_image;
  if (argc < 4) {
    printf("\n\nNot enough parameters:");
    printf("\n");
    printf("\n   usage: hidet image-file text-file-image factor  ");
    exit(0);
  }
  strcpy(image_name, argv[1]);
  strcpy(water_name, argv[2]);
  factor = atoi(argv[3]);
  if (does_not_exist(image_name)) {
    printf("\nERROR input file %s does not exist", image_name);
    exit(0);
  }
  if (does_not_exist(water_name)) {
    printf("\nERROR output file %s does not exist", water_name);
    exit(0);
  }
  if (are_not_same_size(image_name, water_name)) {
    printf("\nERROR images are not same size");
    exit(0);
  }
  get_image_size(image_name, &length, &width);
  the_image = allocate_image_array(length, width);
  out_image = allocate_image_array(length, width);
  read_image_array(image_name, the_image);
  read_image_array(water_name, out_image);
  for (i = 0; i < length; i++) {
    for (j = 0; j < width; j++) {
      if (out_image[i][j] != 0) {
        the_image[i][j] = the_image[i][j] + factor;
        if (the_image[i][j] > 255)
          the_image[i][j] = 255;
      }
    }
  }
  write_image_array(image_name, the_image);
  free_image_array(the_image, length);
  free_image_array(out_image, length);
}
```