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

```asm
<generate_heightmap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r15d
  mov    %edi,0x10(%rsp)
  mov    %esi,%ebx
  mov    %esi,0x14(%rsp)
  movslq %esi,%r14
  lea    0x0(,%rsi,8),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %ebx,%ebx
  jle    L232
  mov    %ebx,%eax
  lea    0x0(,%r15,4),%r13d
  mov    %r12,%rbx
  mov    %eax,%eax
  lea    (%r12,%rax,8),%r15
  mov    %r12,%rbp
L76:
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  add    $0x8,%rbp
  cmp    %r15,%rbp
  jne    L76
  mov    0x10(%rsp),%edi
  lea    -0x1(%rdi),%eax
  lea    0x4(,%rax,4),%rsi
  jmp    L209
L201:
  mov    (%rcx),%rdx
  movl   $0x0,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rsi
  jne    L201
L214:
  add    $0x8,%rbx
  cmp    %r15,%rbx
  je     L232
L209:
  mov    %rbx,%rcx
  mov    $0x0,%eax
  test   %edi,%edi
  jg     L201
  jmp    L214
L232:
  mov    $0x0,%eax
  call   <generate_seed@plt>
  mov    %eax,%esi
  mov    0x10(%rsp),%r15d
  movslq %r15d,%rcx
  lea    -0x8(%r12,%rcx,8),%rbx
  shl    $0x2,%rcx
  mov    (%rbx),%r8
  cltq
  imul   $0x51eb851f,%rax,%rdx
  sar    $0x25,%rdx
  mov    %esi,%edi
  sar    $0x1f,%edi
  sub    %edi,%edx
  imul   $0x64,%edx,%r9d
  sub    %r9d,%esi
  mov    %esi,-0x4(%r8,%rcx,1)
  mov    (%rbx),%r8
  movslq %edx,%rsi
  imul   $0x51eb851f,%rsi,%rsi
  sar    $0x25,%rsi
  mov    %edx,%r9d
  sar    $0x1f,%r9d
  sub    %r9d,%esi
  imul   $0x64,%esi,%esi
  sub    %esi,%edx
  mov    %edx,(%r8)
  mov    (%r12),%r8
  imul   $0x68db8bad,%rax,%rdx
  sar    $0x2c,%rdx
  sub    %edi,%edx
  movslq %edx,%rsi
  imul   $0x51eb851f,%rsi,%rsi
  sar    $0x25,%rsi
  mov    %edx,%r9d
  sar    $0x1f,%r9d
  sub    %r9d,%esi
  imul   $0x64,%esi,%esi
  sub    %esi,%edx
  mov    %edx,-0x4(%r8,%rcx,1)
  mov    (%r12),%rsi
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  sub    %edi,%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x25,%rdx
  mov    %eax,%edi
  sar    $0x1f,%edi
  sub    %edi,%edx
  imul   $0x64,%edx,%edx
  sub    %edx,%eax
  mov    %eax,(%rsi)
  mov    (%rbx),%rdx
  mov    (%r12),%rax
  mov    -0x4(%rax,%rcx,1),%esi
  mov    -0x4(%rdx,%rcx,1),%r8d
  mov    (%rdx),%ecx
  mov    %esi,%edx
  mov    (%rax),%esi
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    (%r12),%rcx
  mov    (%rbx),%rdx
  mov    (%rcx),%eax
  add    -0x4(%rcx,%r14,4),%eax
  add    (%rdx),%eax
  add    -0x4(%rdx,%r14,4),%eax
  lea    0x3(%rax),%ebx
  cmovns %eax,%ebx
  sar    $0x2,%ebx
  mov    $0x0,%eax
  call   <salt@plt>
  mov    %eax,%esi
  lea    -0x1(%r15),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  movslq %edx,%rdx
  mov    0x14(%rsp),%edi
  lea    -0x1(%rdi),%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  cltq
  mov    (%r12,%rdx,8),%rdx
  add    %esi,%ebx
  mov    %ebx,(%rdx,%rax,4)
  mov    %r15d,%ecx
  shr    $0x1f,%r15d
  mov    %r15d,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %eax,0x28(%rsp)
  cmp    $0x1,%ecx
  jle    L126
  mov    %edi,%ecx
  shr    $0x1f,%edi
  mov    %edi,%edx
  add    %ecx,%edx
  sar    %edx
  mov    %edx,0x2c(%rsp)
  mov    %eax,%r15d
  jmp    L133
L28:
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %ebp,%ecx
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %r12,%rdi
  call   <diamond_step@plt>
  add    $0x1,%ebx
  add    0xc(%rsp),%ebp
  cmp    %r13d,%ebx
  jne    L28
L170:
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  mov    0xc(%rsp),%ecx
  add    %ecx,0x24(%rsp)
  cmp    0x20(%rsp),%eax
  je     L54
L72:
  mov    0x24(%rsp),%r14d
  mov    0x1c(%rsp),%ebp
  mov    $0x0,%ebx
  test   %r13d,%r13d
  jg     L28
  jmp    L170
L54:
  mov    0x1c(%rsp),%eax
  mov    %eax,0x24(%rsp)
  mov    $0x0,%r14d
  jmp    L110
L63:
  add    $0x1,%ebx
  add    0xc(%rsp),%ebp
  cmp    %r13d,%ebx
  je     L166
L223:
  cmp    $0x1,%r15d
  jle    L63
  mov    %r15d,%ecx
  mov    0x18(%rsp),%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <square_step@plt>
  jmp    L63
L166:
  add    $0x1,%r14d
  mov    0xc(%rsp),%edx
  add    %edx,0x24(%rsp)
  cmp    0x20(%rsp),%r14d
  je     L122
L110:
  mov    0x24(%rsp),%eax
  mov    %eax,0x18(%rsp)
  mov    0x1c(%rsp),%ebp
  mov    $0x0,%ebx
  test   %r13d,%r13d
  jg     L223
  jmp    L166
L122:
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %r12,%rdi
  call   <inter_smooth@plt>
  cmp    $0x1,%r15d
  je     L126
  mov    %r15d,%eax
  shr    $0x1f,%eax
  add    %r15d,%eax
  sar    %eax
  sub    %eax,%r15d
  test   %r15d,%r15d
  jle    L126
L133:
  mov    0x28(%rsp),%eax
  cltd
  idiv   %r15d
  mov    %eax,0x20(%rsp)
  test   %eax,%eax
  jle    L122
  mov    0x2c(%rsp),%eax
  cltd
  idiv   %r15d
  mov    %eax,%r13d
  mov    %r15d,0x1c(%rsp)
  lea    (%r15,%r15,1),%eax
  mov    %eax,0xc(%rsp)
  mov    %r15d,0x24(%rsp)
  movl   $0x0,0x18(%rsp)
  jmp    L72
L126:
  lea    D0(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D1
type_guessed: string
name: parse_data
arguments: label: D0
type_guessed: string

tool: D1: Corner Seeds:
%d	%d
%d	%d


tool: D0: Heightmap generated

assistant: ```c
int **generate_heightmap(int width, int height) {
  int **map;
  map = (int **)malloc(sizeof(int *) * height);
  for (int i = 0; i < height; i++) {
    map[i] = (int *)malloc(sizeof(int) * width);
  }
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      map[i][j] = 0;
    }
  }
  int seed = generate_seed();
  map[width - 1][width - 1] = seed % 100;
  map[width - 1][0] = seed / 100 % 100;
  map[0][width - 1] = seed / 10000 % 100;
  map[0][0] = seed / 1000000 % 100;
  printf("Corner Seeds:\n%d\t%d\n%d\t%d\n", map[0][0], map[0][width - 1], map[width - 1][0], map[width - 1][width - 1]);
  map[(width - 1) / 2][(height - 1) / 2] = (map[0][0] + map[0][height - 1] + map[width - 1][0] + map[width - 1][height - 1]) / 4 + salt();
  int length = width / 2;
  while (length > 0) {
    int i, j;
    for (i = 0; i < width / 2 / length; i++) {
      for (j = 0; j < height / 2 / length; j++) {
        diamond_step(map, width, height, length + (j * 2 * length), length + (i * 2 * length), length);
      }
    }
    for (i = 0; i < width / 2 / length; i++) {
      for (j = 0; j < height / 2 / length; j++) {
        if (length > 1) {
          square_step(map, length + (j * 2 * length), length + (i * 2 * length), length);
        }
      }
    }
    inter_smooth(map, width, height);
    if (length == 1)
      length = 0;
    length -= length / 2;
  }
  printf("Heightmap generated\n");
  return map;
}
```