user: 请将以下的汇编代码转换成C语言代码:

```asm
<test_rand>:
  endbr64
  push   %r12
  lea    D76(%rip),%rdi
  push   %rbp
  push   %rbx
  mov    $0x989680,%ebx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  xor    %edi,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0xa,%esi
  lea    D87(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  movq   $0x0,0x20(%rsp)
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  nopl   0x0(%rax)
L28:
  mov    $0xa,%esi
  xor    %edi,%edi
  call   <get_rand_int@plt>
  cltq
  addl   $0x1,(%rsp,%rax,4)
  sub    $0x1,%ebx
  jne    L28
  xor    %ebx,%ebx
  mov    %rsp,%r12
  lea    D67(%rip),%rbp
  nopl   0x0(%rax,%rax,1)
L13:
  pxor   %xmm0,%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  cvtsi2sdl (%r12,%rbx,4),%xmm0
  add    $0x1,%rbx
  divsd  D30(%rip),%xmm0
  call   <printf@plt>
  cmp    $0xa,%rbx
  jne    L13
  movsd  D77(%rip),%xmm0
  lea    D44(%rip),%r12
  mov    $0x1,%eax
  xor    %ebp,%ebp
  mov    %r12,%rdi
  mov    $0x989680,%ebx
  call   <printf@plt>
  mov    D86(%rip),%rax
  lea    D106(%rip),%rdi
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <printf@plt>
  nopl   0x0(%rax,%rax,1)
L32:
  mov    D86(%rip),%rax
  movq   %rax,%xmm0
  call   <percentage_chance@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%ebp
  sub    $0x1,%ebx
  jne    L32
  lea    D59(%rip),%rdi
  pxor   %xmm0,%xmm0
  mov    $0x1,%eax
  cvtsi2sd %ebp,%xmm0
  divsd  D30(%rip),%xmm0
  call   <printf@plt>
  mov    D86(%rip),%rax
  mov    %r12,%rdi
  movq   %rax,%xmm0
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D76
type: string
name: retrieve_data
arguments: data_label: D87
type: string
name: retrieve_data
arguments: data_label: D67
type: string
name: retrieve_data
arguments: data_label: D30
type: byte[8]
name: retrieve_data
arguments: data_label: D77
type: byte[8]
name: retrieve_data
arguments: data_label: D44
type: string
name: retrieve_data
arguments: data_label: D86
type: f64
name: retrieve_data
arguments: data_label: D106
type: string
name: retrieve_data
arguments: data_label: D59
type: string

tool: D76: 
### RANDOM UTILITY UNIT TEST ###

tool: D87: 
Testing get_rand_int() with %d bins


tool: D67: Bin %d: %lf


tool: {"D30": [0x00,0x00,0x00,0x00,0xd0,0x12,0x63,0x41]}

tool: {"D77": [0x9a,0x99,0x99,0x99,0x99,0x99,0xb9,0x3f]}

tool: D44: Expected fraction: %lf


tool: D86: 0.5

tool: D106: 
Testing percentage_chance() with rate %lf


tool: D59: Percentage chance fraction: %lf


assistant: ```c
int test_rand() {
  int i;
  int num;
  int counter;
  double frac;
  int results[(10)];
  printf("\n### RANDOM UTILITY UNIT TEST ###\n");
  srand(time(NULL));
  printf("\nTesting get_rand_int() with %d bins\n", (10));
  for (i = 0; i < (10); i++)
    results[i] = 0;
  for (i = 0; i < (10000000); i++) {
    num = get_rand_int(0, (10));
    results[num]++;
  }
  for (i = 0; i < (10); i++) {
    frac = (double)results[i] / (10000000);
    printf("Bin %d: %lf\n", i, frac);
  }
  printf("Expected fraction: %lf\n", 1.0 / (10));
  printf("\nTesting percentage_chance() with rate %lf\n", (0.5));
  counter = 0;
  for (i = 0; i < (10000000); i++) {
    if (percentage_chance((0.5)))
      counter++;
  }
  printf("Percentage chance fraction: %lf\n", (double)counter / (10000000));
  printf("Expected fraction: %lf\n", (double)(0.5));
  return 0;
}
```