user: Translate the below assembly code into C programming language:

```asm
<generate_char_data_set>:
  endbr64
  push   %r15
  mov    %r9d,%r15d
  push   %r14
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  mov    %edx,%edi
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x3c(%rsp)
  mov    0x80(%rsp),%r12d
  cmp    0x90(%rsp),%r12d
  jg     L3
  test   %r12d,%r12d
  js     L3
L181:
  mov    $0xf,%ecx
  xor    %edx,%edx
  mov    $0x8,%esi
  mov    %r8d,0x8(%rsp)
  call   <offset_and_clip_value@plt>
  mov    %r13d,%edi
  mov    $0xf,%ecx
  xor    %edx,%edx
  mov    $0x8,%esi
  mov    %eax,%ebx
  call   <offset_and_clip_value@plt>
  mov    0x8(%rsp),%edi
  mov    $0xf,%ecx
  xor    %edx,%edx
  mov    $0x8,%esi
  mov    %eax,%r14d
  call   <offset_and_clip_value@plt>
  mov    $0xf,%ecx
  xor    %edx,%edx
  mov    %r15d,%edi
  mov    $0x8,%esi
  mov    %eax,%r13d
  mov    %eax,0x1c(%rsp)
  call   <offset_and_clip_value@plt>
  mov    %r13b,0x8(%rsp)
  mov    %eax,0x28(%rsp)
  mov    %eax,%r13d
  mov    %bl,0x35(%rsp)
  mov    %r14b,0x36(%rsp)
  cmp    $0x4,%ebp
  je     L216
L121:
  mov    0x88(%rsp),%esi
  test   %esi,%esi
  jle    L27
  mov    0xa0(%rsp),%ecx
  mov    %r14d,%r9d
  shl    $0x4,%ebx
  mov    %r12d,%r15d
  and    $0xf,%r9d
  movl   $0x0,0x30(%rsp)
  test   %ecx,%ecx
  movl   $0x0,0x2c(%rsp)
  lea    (%r9,%rbx,1),%r14d
  sete   %dl
  cmp    $0x4,%ebp
  mov    %r14d,%r12d
  sete   %al
  and    %eax,%edx
  mov    0x90(%rsp),%eax
  imul   0x98(%rsp),%eax
  mov    %dl,0x37(%rsp)
  mov    0xa8(%rsp),%rdx
  mov    %eax,0x38(%rsp)
  mov    0x98(%rsp),%eax
  sub    $0x1,%eax
  lea    0x1(%rdx,%rax,1),%rax
  mov    %rax,0x20(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L124:
  cmpb   $0x0,0x37(%rsp)
  jne    L233
L171:
  mov    0x30(%rsp),%eax
  mov    0x90(%rsp),%edx
  xor    %r8d,%r8d
  mov    %eax,0x18(%rsp)
  test   %edx,%edx
  jle    L9
  mov    %r12d,%edi
  mov    %r15d,%ecx
  mov    %r8d,%r12d
  xchg   %ax,%ax
L247:
  mov    0x98(%rsp),%eax
  test   %eax,%eax
  jle    L58
  movzbl 0x1c(%rsp),%edx
  movslq 0x18(%rsp),%rsi
  mov    %r13d,%eax
  mov    %r12d,%r8d
  movzbl 0x28(%rsp),%r15d
  mov    0xa8(%rsp),%rbx
  mov    $0xf,%r9d
  add    %r12d,%edx
  add    %r12d,%r15d
  add    %rsi,%rbx
  mov    %edx,%r12d
  add    0x20(%rsp),%rsi
  mov    %r15d,%r13d
  mov    %eax,%r15d
  jmp    L254
  nopl   0x0(%rax)
L159:
  cmp    $0x2,%ebp
  jne    L231
  mov    %r12d,%r14d
  mov    %r13d,%eax
  and    $0xf,%r14d
  and    $0xf,%eax
L99:
  cmp    $0xffffffff,%ecx
  je     L120
L149:
  mov    %edi,%r11d
  cmp    %r8d,%ecx
  je     L120
L71:
  mov    %r11b,(%rbx)
  add    $0x1,%rbx
  add    $0x1,%r12d
  add    $0x1,%r13d
  cmp    %rsi,%rbx
  je     L46
L254:
  cmp    $0x3,%ebp
  je     L33
  jg     L210
  cmp    $0x1,%ebp
  jne    L159
  movzbl 0x8(%rsp),%r14d
  mov    %r15d,%eax
  cmp    $0xffffffff,%ecx
  jne    L149
L120:
  shl    $0x4,%r14d
  and    $0xf,%eax
  mov    %r14d,%r11d
  add    %eax,%r11d
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L210:
  cmp    $0x4,%ebp
  jne    L231
  xor    %eax,%eax
  mov    %ecx,0x80(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %dil,0x34(%rsp)
  mov    %r8d,0xc(%rsp)
  call   <rand@plt>
  mov    %eax,%r14d
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  add    %eax,%r14d
  and    $0xf,%r14d
  sub    %eax,%r14d
  xor    %eax,%eax
  call   <rand@plt>
  mov    0xc(%rsp),%r8d
  movzbl 0x34(%rsp),%edi
  mov    $0xf,%r9d
  mov    %eax,%r11d
  mov    0x10(%rsp),%rsi
  mov    0x80(%rsp),%ecx
  sar    $0x1f,%r11d
  shr    $0x1c,%r11d
  add    %r11d,%eax
  and    $0xf,%eax
  sub    %r11d,%eax
  jmp    L99
  nopl   0x0(%rax)
L231:
  movzbl 0x36(%rsp),%eax
  movzbl 0x35(%rsp),%r14d
  jmp    L99
  nopl   0x0(%rax,%rax,1)
L33:
  mov    %r12d,%eax
  mov    %r9d,%r14d
  mov    %r13d,%r11d
  and    $0xf,%eax
  and    $0xf,%r11d
  sub    %eax,%r14d
  mov    %r9d,%eax
  sub    %r11d,%eax
  jmp    L99
  xchg   %ax,%ax
L46:
  mov    %r15d,%r13d
  mov    %r8d,%r12d
L58:
  mov    0x98(%rsp),%edx
  add    $0x1,%r12d
  add    %edx,0x18(%rsp)
  cmp    %r12d,0x90(%rsp)
  jne    L247
  mov    %edi,%r12d
  mov    %ecx,%r15d
L9:
  addl   $0x1,0x2c(%rsp)
  mov    0x38(%rsp),%edi
  mov    0x2c(%rsp),%eax
  add    %edi,0x30(%rsp)
  cmp    %eax,0x88(%rsp)
  jne    L124
L27:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L233:
  mov    0x3c(%rsp),%edi
  call   <srand@plt>
  jmp    L171
L3:
  mov    $0xffffffff,%r12d
  jmp    L181
L216:
  mov    0x3c(%rsp),%edi
  call   <srand@plt>
  jmp    L121
```

assistant: ```c
void generate_char_data_set(int generation_Type, int random_seed, int default_real, int default_imaginary, int initial_real, int initial_imaginary, int single_frequency, int num_timesteps, int num_frequencies, int num_elements, int no_repeat_random, unsigned char *packed_data_set) {
  if (single_frequency > num_frequencies || single_frequency < 0)
    single_frequency = -1;
  default_real = offset_and_clip_value(default_real, 8, 0, 15);
  default_imaginary = offset_and_clip_value(default_imaginary, 8, 0, 15);
  initial_real = offset_and_clip_value(initial_real, 8, 0, 15);
  initial_imaginary = offset_and_clip_value(initial_imaginary, 8, 0, 15);
  unsigned char clipped_offset_default_real = (unsigned char)default_real;
  unsigned char clipped_offset_default_imaginary = (unsigned char)default_imaginary;
  unsigned char clipped_offset_initial_real = (unsigned char)initial_real;
  unsigned char clipped_offset_initial_imaginary = (unsigned char)initial_imaginary;
  unsigned char temp_output;
  if (generation_Type == 4u) {
    srand(random_seed);
  }
  for (int k = 0; k < num_timesteps; k++) {
    if (generation_Type == 4u && !no_repeat_random) {
      srand(random_seed);
    }
    for (int j = 0; j < num_frequencies; j++) {
      for (int i = 0; i < num_elements; i++) {
        int currentAddress = k * num_frequencies * num_elements + j * num_elements + i;
        unsigned char new_real;
        unsigned char new_imaginary;
        switch (generation_Type) {
        case 1u:
          new_real = clipped_offset_initial_real;
          new_imaginary = clipped_offset_initial_imaginary;
          break;
        case 2u:
          new_real = (j + clipped_offset_initial_real + i) % 16;
          new_imaginary = (j + clipped_offset_initial_imaginary + i) % 16;
          break;
        case 3u:
          new_real = 15 - ((j + clipped_offset_initial_real + i) % 16);
          new_imaginary = 15 - ((j + clipped_offset_initial_imaginary + i) % 16);
          break;
        case 4u:
          new_real = (unsigned char)(rand() % 16);
          new_imaginary = (unsigned char)(rand() % 16);
          break;
        default:
          new_real = clipped_offset_default_real;
          new_imaginary = clipped_offset_default_imaginary;
          break;
        }
        if (single_frequency == -1) {
          temp_output = ((new_real << 4) & 0xF0) + (new_imaginary & 0x0F);
          packed_data_set[currentAddress] = temp_output;
        } else {
          if (j == single_frequency) {
            temp_output = ((new_real << 4) & 0xF0) + (new_imaginary & 0x0F);
          } else {
            temp_output = ((clipped_offset_default_real << 4) & 0xF0) + (clipped_offset_default_imaginary & 0x0F);
          }
          packed_data_set[currentAddress] = temp_output;
        }
      }
    }
  }
  return;
}
```