user: Please show me the C implementation that matches the assembly code listed below:

```asm
<reverse_sha256>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x58,%rsp
  mov    %rdi,0x38(%rsp)
  mov    %rcx,%rdi
  mov    %esi,0x34(%rsp)
  call   <strlen@plt>
  mov    %ebx,%esi
  mov    %eax,%edi
  mov    %eax,0x30(%rsp)
  call   <pow@plt>
  mov    $0x41,%edi
  mov    %eax,0x20(%rsp)
  mov    %eax,%r14d
  call   <malloc@plt>
  lea    0x1(%rbx),%edi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rax,%rbp
  movslq %ebx,%rax
  movb   $0x0,0x0(%rbp,%rax,1)
  test   %r14d,%r14d
  jle    L238
  lea    (%rbx,%rbx,1),%eax
  movl   $0x0,0x24(%rsp)
  mov    %eax,0x4c(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x48(%rsp)
  movq   $0x0,0x40(%rsp)
  movl   $0x0,0x14(%rsp)
  mov    %r13,0x28(%rsp)
L316:
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jne    L326
  mov    0x14(%rsp),%edi
  test   %edi,%edi
  jne    L157
  mov    0x48(%rsp),%edx
  mov    %ebx,%ecx
  xor    %edi,%edi
  test   %ebx,%ebx
  jle    L210
L293:
  test   %ecx,%ecx
  mov    $0x1,%esi
  movslq %ecx,%rax
  cmovle %rsi,%rax
  lea    0x1(%r12),%rsi
  add    %rbp,%rax
  cmp    %rax,%r12
  setae  %al
  cmp    %rsi,%rbp
  setae  %sil
  or     %sil,%al
  je     L240
  cmp    $0x7,%ecx
  jle    L240
  test   %ecx,%ecx
  mov    $0x1,%r8d
  cmovg  %ecx,%r8d
  cmp    $0xf,%ecx
  jle    L287
  movzbl (%r12),%eax
  movd   %eax,%xmm0
  mov    %r8d,%eax
  shr    $0x4,%eax
  punpcklbw %xmm0,%xmm0
  sub    $0x1,%eax
  punpcklwd %xmm0,%xmm0
  shl    $0x4,%rax
  pshufd $0x0,%xmm0,%xmm0
  lea    0x10(%rbp,%rax,1),%rsi
  mov    %rbp,%rax
  xchg   %ax,%ax
L277:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L277
  mov    %r8d,%r9d
  and    $0xfffffff0,%r9d
  mov    %r9d,%eax
  cmp    %r8d,%r9d
  je     L202
L94:
  sub    %r9d,%r8d
  lea    -0x1(%r8),%esi
  cmp    $0x6,%esi
  jbe    L138
  movzbl (%r12),%r10d
  mov    %r10d,%esi
  shl    $0x8,%esi
  or     %r10d,%esi
  movd   %esi,%xmm1
  mov    %r8d,%esi
  pshuflw $0x0,%xmm1,%xmm0
  and    $0xfffffff8,%esi
  movq   %xmm0,0x0(%rbp,%r9,1)
  add    %esi,%eax
  cmp    %esi,%r8d
  je     L202
L138:
  movzbl (%r12),%r8d
  movslq %eax,%rsi
  mov    %r8b,0x0(%rbp,%rsi,1)
  lea    0x1(%rax),%esi
  cmp    %ecx,%esi
  jge    L202
  movslq %esi,%rsi
  mov    %r8b,0x0(%rbp,%rsi,1)
  lea    0x2(%rax),%esi
  cmp    %ecx,%esi
  jge    L202
  movzbl (%r12),%r8d
  movslq %esi,%rsi
  mov    %r8b,0x0(%rbp,%rsi,1)
  lea    0x3(%rax),%esi
  cmp    %esi,%ecx
  jle    L202
  movslq %esi,%rsi
  mov    %r8b,0x0(%rbp,%rsi,1)
  lea    0x4(%rax),%esi
  cmp    %esi,%ecx
  jle    L202
  movzbl (%r12),%r8d
  movslq %esi,%rsi
  mov    %r8b,0x0(%rbp,%rsi,1)
  lea    0x5(%rax),%esi
  cmp    %esi,%ecx
  jle    L202
  movslq %esi,%rsi
  add    $0x6,%eax
  mov    %r8b,0x0(%rbp,%rsi,1)
  cmp    %eax,%ecx
  jle    L202
  movzbl (%r12),%esi
  cltq
  mov    %sil,0x0(%rbp,%rax,1)
L202:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  je     L210
  cmp    %ecx,%ebx
  jle    L210
  add    $0x1,%ecx
  movslq %edx,%rdx
  mov    0x30(%rsp),%r8d
  movslq %ecx,%rcx
  lea    0x1(%rbp,%rdx,1),%rsi
  nopw   0x0(%rax,%rax,1)
L108:
  cltd
  idiv   %r8d
  movslq %edx,%rdx
  movzbl (%r12,%rdx,1),%r9d
  mov    %rsi,%rdx
  sub    %rcx,%rdx
  test   %eax,%eax
  mov    %r9b,(%rdx)
  setne  %r9b
  cmp    %ecx,%ebx
  setg   %dl
  add    $0x1,%rcx
  test   %dl,%r9b
  jne    L108
L210:
  mov    0x34(%rsp),%eax
  cmp    %edi,%eax
  cmovge %eax,%edi
  mov    %ebx,%eax
  sub    %edi,%eax
  mov    %eax,0x10(%rsp)
  js     L182
  xor    %r13d,%r13d
  mov    %r12,0x18(%rsp)
  mov    0x28(%rsp),%r14
  mov    %ebx,0xc(%rsp)
  mov    0x38(%rsp),%r15
  mov    %r13,%r12
  jmp    L45
  nopl   0x0(%rax,%rax,1)
L237:
  add    $0x1,%r12
  cmp    %r12d,0x10(%rsp)
  jl     L333
L45:
  mov    0xc(%rsp),%r13d
  lea    0x0(%rbp,%r12,1),%rbx
  mov    %r14,%rdx
  mov    %rbx,%rdi
  sub    %r12d,%r13d
  mov    %r13d,%esi
  call   <sha256@plt>
  mov    %r15,%rdi
  mov    %eax,%esi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L237
  lea    0x1(%r13),%edi
  mov    %rbx,%r15
  mov    0x18(%rsp),%r12
  mov    0xc(%rsp),%ebx
  call   <malloc@plt>
  mov    %r15,%rsi
  mov    %r13d,%edx
  mov    %rax,%rdi
  mov    %rax,%r15
  mov    %rax,0x40(%rsp)
  call   <strncpy@plt>
  mov    0x14(%rsp),%edi
  mov    0x20(%rsp),%ecx
  movslq %r13d,%r8
  movb   $0x0,(%r15,%r8,1)
  lea    0x1(%rdi),%eax
  cmp    %eax,%ecx
  jle    L26
  add    $0x2,%edi
  mov    %edi,0x14(%rsp)
  cmp    %ecx,%edi
  jge    L26
L326:
  addl   $0x1,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    0x20(%rsp),%eax
  jge    L26
  movl   $0x1,0x24(%rsp)
L182:
  addl   $0x1,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  jg     L316
L26:
  mov    0x28(%rsp),%r13
L165:
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L157:
  call   <log@plt>
  mov    0x30(%rsp),%edi
  mov    %eax,%r14d
  call   <log@plt>
  mov    %eax,%r8d
  mov    %r14d,%eax
  cltd
  idiv   %r8d
  mov    %eax,%edi
  call   <floor@plt>
  mov    0x4c(%rsp),%edx
  mov    %ebx,%ecx
  lea    0x1(%rax),%edi
  sub    %edi,%edx
  sub    %edi,%ecx
  sub    $0x1,%edx
  test   %ecx,%ecx
  jg     L293
  xor    %ecx,%ecx
  jmp    L202
  nopl   0x0(%rax)
L333:
  mov    0xc(%rsp),%ebx
  mov    0x18(%rsp),%r12
  jmp    L182
  cs nopw 0x0(%rax,%rax,1)
L240:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L9:
  movzbl (%r12),%esi
  mov    %sil,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L9
  jmp    L202
L287:
  xor    %eax,%eax
  xor    %r9d,%r9d
  jmp    L94
L238:
  movq   $0x0,0x40(%rsp)
  jmp    L165
```

assistant: ```c
char *reverse_sha256(const char *hash, int min_length, int max_length, const char *character_set) {
  int character_set_length = strlen(character_set), str_length;
  char *str_hash;
  char *str;
  int i, t, range;
  int64_t id, remainder;
  int64_t max_id = pow(character_set_length, max_length);
  int done = 0;
  char *result = NULL;
#pragma omp parallel private(id, i, t, range, remainder, str, str_hash)
  {
    str_hash = (char *)malloc(65 * sizeof(char));
    str = (char *)malloc((max_length + 1) * sizeof(char));
    str[max_length] = '\0';
#pragma omp for schedule(dynamic)
    for (id = 0; id < max_id; ++id) {
#pragma omp flush(done)
      if (done)
        continue;
      str_length = id == 0 ? 0 : (floor(log(id) / log(character_set_length)) + 1);
      t = 2 * max_length - str_length - 1;
      for (i = 0; i < max_length - str_length; ++i)
        str[i] = character_set[0];
      for (remainder = id; remainder && i < max_length; ++i) {
        str[t - i] = character_set[remainder % character_set_length];
        remainder /= character_set_length;
      }
      range = max_length - (str_length > min_length ? str_length : min_length);
      for (i = 0; i <= range; ++i) {
        if (strcmp(hash, sha256(str + i, max_length - i, str_hash)) == 0) {
          result = (char *)malloc((max_length - i + 1) * sizeof(char));
          strncpy(result, str + i, max_length - i);
          result[max_length - i] = '\0';
          done = 1;
          break;
        }
      }
    }
    free(str_hash);
    free(str);
  }
  return result;
}
```