user: 请从给定的汇编指令推导出C源代码:

```asm
<CreateTestImage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  cmpl   $0x3,-0x34(%rbp)
  je     L209
  cmpl   $0x3,-0x34(%rbp)
  jg     L253
  cmpl   $0x2,-0x34(%rbp)
  je     L178
  cmpl   $0x2,-0x34(%rbp)
  jg     L253
  cmpl   $0x0,-0x34(%rbp)
  je     L159
  cmpl   $0x1,-0x34(%rbp)
  je     L36
  jmp    L253
L159:
  movl   $0x0,-0x18(%rbp)
  jmp    L338
L111:
  movl   $0x0,-0x1c(%rbp)
  jmp    L85
L68:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L85:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L68
  addl   $0x1,-0x18(%rbp)
L338:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L111
  jmp    L253
L36:
  movl   $0x0,-0x18(%rbp)
  jmp    L205
L144:
  movl   $0x0,-0x1c(%rbp)
  jmp    L304
L239:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  addl   $0x1,-0x1c(%rbp)
L304:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L239
  addl   $0x1,-0x18(%rbp)
L205:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L144
  jmp    L253
L178:
  movl   $0x0,-0x18(%rbp)
  jmp    L269
L286:
  movl   $0x0,-0x1c(%rbp)
  jmp    L244
L281:
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    -0x18(%rbp),%edx
  lea    0x1(%rdx),%esi
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rdx,%rcx
  cltd
  idiv   %esi
  mov    %edx,%eax
  mov    %eax,(%rcx)
  addl   $0x1,-0x1c(%rbp)
L244:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L281
  addl   $0x1,-0x18(%rbp)
L269:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L286
  jmp    L253
L209:
  movl   $0x0,-0x18(%rbp)
  jmp    L306
L320:
  movl   $0x0,-0x1c(%rbp)
  jmp    L21
L302:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x1c(%rbp)
L21:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L302
  addl   $0x1,-0x18(%rbp)
L306:
  mov    -0x18(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L320
  movl   $0x0,-0x14(%rbp)
  jmp    L23
L193:
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idivl  -0x2c(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idivl  -0x30(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x14(%rbp)
L23:
  mov    -0x2c(%rbp),%eax
  imul   -0x30(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L193
  movl   $0x0,-0x10(%rbp)
  jmp    L299
L323:
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idivl  -0x2c(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idivl  -0x30(%rbp)
  mov    %edx,-0x18(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L56
L169:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x4,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x1e,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  sub    $0xf,%eax
  mov    %eax,-0x8(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x4,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x1e,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  sub    $0xf,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  js     L214
  mov    -0x8(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L214
  cmpl   $0x0,-0x4(%rbp)
  js     L214
  mov    -0x4(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L214
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  jmp    L43
L214:
  nop
L43:
  addl   $0x1,-0xc(%rbp)
L56:
  cmpl   $0xf9,-0xc(%rbp)
  jle    L169
  addl   $0x1,-0x10(%rbp)
L299:
  cmpl   $0x9,-0x10(%rbp)
  jle    L323
  jmp    L253
L253:
  nop
  leave
  ret
```

assistant: ```c
void CreateTestImage(int **img, int w, int h, int mode) {
  int x, y;
  switch (mode) {
  case 0:
    for (y = 0; y < h; y++) {
      for (x = 0; x < w; x++) {
        img[y][x] = 0;
      }
    }
    break;
  case 1:
    for (y = 0; y < h; y++) {
      for (x = 0; x < w; x++) {
        img[y][x] = 1;
      }
    }
    break;
  case 2:
    for (y = 0; y < h; y++) {
      for (x = 0; x < w; x++) {
        img[y][x] = (x + 1) % (y + 1);
      }
    }
    break;
  case 3:
    for (y = 0; y < h; y++) {
      for (x = 0; x < w; x++) {
        img[y][x] = 0;
      }
    }
    for (int i = 0; i < w * h / 10; i++) {
      x = rand() % w;
      y = rand() % h;
      img[y][x] += 1;
    }
    for (int i = 0; i < 10; i++) {
      x = rand() % w;
      y = rand() % h;
      for (int j = 0; j < 250; j++) {
        int xs = x + rand() % 30 - 15;
        int ys = y + rand() % 30 - 15;
        if (xs < 0 || xs >= w || ys < 0 || ys >= h)
          continue;
        img[ys][xs] += 1;
      }
    }
  }
}
```