user: Demonstrate the C code that generates the assembly output below:

```asm
<reorganize_GPU_to_upper_triangle>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,-0x3c(%rsp)
  mov    %esi,-0x24(%rsp)
  mov    %edx,-0x8(%rsp)
  test   %edx,%edx
  jle    L13
  mov    %r8,%r15
  mov    %r9,%r14
  mov    %ecx,-0x38(%rsp)
  mov    %ecx,%eax
  cltd
  idiv   %edi
  mov    %eax,-0x4(%rsp)
  mov    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%esi
  imul   %ecx,%esi
  mov    %esi,-0xc(%rsp)
  lea    (%rdi,%rdi,1),%eax
  mov    %eax,-0x30(%rsp)
  movl   $0x0,-0x10(%rsp)
  movl   $0x0,-0x14(%rsp)
  mov    $0x0,%edi
  add    $0x2,%eax
  mov    %eax,-0x18(%rsp)
  jmp    L2
L12:
  subl   $0x1,-0x20(%rsp)
  mov    -0x20(%rsp),%eax
  add    %eax,-0x28(%rsp)
  lea    0x1(%r12),%r13d
  mov    %r13d,%r12d
  jmp    L24
L109:
  movslq %eax,%rdi
  mov    (%r10,%rdx,8),%r8d
  mov    %r8d,(%r14,%rdi,4)
  movslq %esi,%r8
  mov    (%r15,%r8,4),%r8d
  mov    %r8d,0x4(%r14,%rdi,4)
L29:
  add    $0x1,%rdx
  add    $0x2,%ecx
  add    $0x2,%eax
  add    $0x2,%esi
  cmp    %r9d,%ecx
  je     L53
L37:
  cmp    %r12d,%r13d
  jne    L109
  cmp    %edx,%r11d
  jg     L29
  movslq %eax,%rdi
  mov    (%r10,%rdx,8),%r8d
  mov    %r8d,(%r14,%rdi,4)
  movslq %esi,%r8
  mov    (%r15,%r8,4),%r8d
  mov    %r8d,0x4(%r14,%rdi,4)
  jmp    L29
L53:
  mov    -0x40(%rsp),%edi
  mov    -0x30(%rsp),%eax
  add    %eax,%edi
  add    $0x1,%r11d
  add    $0x1,%ebx
  add    -0x38(%rsp),%ebp
  add    %eax,%r9d
  cmp    %r11d,-0x3c(%rsp)
  je     L94
L110:
  mov    %edi,-0x40(%rsp)
  lea    0x2(%rdi),%ecx
  lea    -0x1(%rbx),%eax
  imul   %ebx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  sar    %edx
  mov    %ebp,%eax
  sub    %edx,%eax
  mov    -0x34(%rsp),%edx
  sub    %ebx,%edx
  add    %edx,%eax
  add    %eax,%eax
  lea    0x1(%rdi),%esi
  movslq %edi,%rdi
  lea    (%r15,%rdi,4),%r10
  mov    $0x0,%edx
  jmp    L37
L94:
  add    $0x1,%r13d
  addl   $0x1,-0x2c(%rsp)
  mov    -0x2c(%rsp),%eax
  cmp    %eax,-0x24(%rsp)
  je     L79
L95:
  mov    -0x2c(%rsp),%ebx
  cmp    %ebx,-0x28(%rsp)
  je     L12
L24:
  mov    -0x3c(%rsp),%eax
  test   %eax,%eax
  jle    L94
  mov    %eax,%ebx
  imul   %r13d,%ebx
  mov    %ebx,-0x34(%rsp)
  imul   %r12d,%eax
  mov    %eax,%ebx
  imul   -0x38(%rsp),%eax
  mov    -0x1c(%rsp),%esi
  lea    (%rax,%rsi,1),%ebp
  mov    -0x18(%rsp),%eax
  lea    (%rax,%rdi,1),%r9d
  mov    $0x0,%r11d
  jmp    L110
L79:
  addl   $0x1,-0x14(%rsp)
  mov    -0x14(%rsp),%eax
  mov    -0xc(%rsp),%esi
  add    %esi,-0x10(%rsp)
  cmp    %eax,-0x8(%rsp)
  je     L13
L2:
  mov    -0x10(%rsp),%ebx
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  mov    %eax,-0x1c(%rsp)
  cmpl   $0x0,-0x24(%rsp)
  jle    L79
  mov    -0x4(%rsp),%eax
  mov    %eax,-0x28(%rsp)
  mov    %eax,-0x20(%rsp)
  movl   $0x0,-0x2c(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%r13d
  jmp    L95
L13:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void reorganize_GPU_to_upper_triangle(int block_side_length, int num_blocks, int actual_num_frequencies, int actual_num_elements, int *gpu_data, int *final_matrix) {
  int GPU_address = 0;
  for (int frequency_bin = 0; frequency_bin < actual_num_frequencies; frequency_bin++) {
    int block_x_ID = 0;
    int block_y_ID = 0;
    int num_blocks_x = actual_num_elements / block_side_length;
    int block_check = num_blocks_x;
    int frequency_offset = frequency_bin * (actual_num_elements * (actual_num_elements + 1)) / 2;
    for (int block_ID = 0; block_ID < num_blocks; block_ID++) {
      if (block_ID == block_check) {
        num_blocks_x--;
        block_check += num_blocks_x;
        block_y_ID++;
        block_x_ID = block_y_ID;
      }
      for (int y_ID_local = 0; y_ID_local < block_side_length; y_ID_local++) {
        for (int x_ID_local = 0; x_ID_local < block_side_length; x_ID_local++) {
          int x_ID_global = block_x_ID * block_side_length + x_ID_local;
          int y_ID_global = block_y_ID * block_side_length + y_ID_local;
          int address_1d_output = frequency_offset + y_ID_global * actual_num_elements - ((y_ID_global - 1) * y_ID_global) / 2 + (x_ID_global - y_ID_global);
          if (block_x_ID != block_y_ID) {
            final_matrix[address_1d_output * 2] = gpu_data[GPU_address++];
            final_matrix[address_1d_output * 2 + 1] = gpu_data[GPU_address++];
          } else {
            if (x_ID_local >= y_ID_local) {
              final_matrix[address_1d_output * 2] = gpu_data[GPU_address++];
              final_matrix[address_1d_output * 2 + 1] = gpu_data[GPU_address++];
            } else {
              GPU_address += 2;
            }
          }
        }
      }
      block_x_ID++;
    }
  }
  return;
}
```