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

```asm
<test_rand>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0xa,%esi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L77
L46:
  mov    -0x44(%rbp),%eax
  cltq
  movl   $0x0,-0x30(%rbp,%rax,4)
  addl   $0x1,-0x44(%rbp)
L77:
  cmpl   $0x9,-0x44(%rbp)
  jle    L46
  movl   $0x0,-0x44(%rbp)
  jmp    L65
L70:
  mov    $0xa,%esi
  mov    $0x0,%edi
  call   <get_rand_int@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  mov    -0x3c(%rbp),%eax
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  addl   $0x1,-0x44(%rbp)
L65:
  cmpl   $0x98967f,-0x44(%rbp)
  jle    L70
  movl   $0x0,-0x44(%rbp)
  jmp    L8
L52:
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D55(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x44(%rbp),%eax
  movq   %rdx,%xmm0
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x44(%rbp)
L8:
  cmpl   $0x9,-0x44(%rbp)
  jle    L52
  mov    D16(%rip),%rax
  movq   %rax,%xmm0
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    D11(%rip),%rax
  movq   %rax,%xmm0
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L51
L53:
  mov    D11(%rip),%rax
  movq   %rax,%xmm0
  call   <percentage_chance@plt>
  test   %rax,%rax
  je     L5
  addl   $0x1,-0x40(%rbp)
L5:
  addl   $0x1,-0x44(%rbp)
L51:
  cmpl   $0x98967f,-0x44(%rbp)
  jle    L53
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x40(%rbp),%xmm0
  movsd  D55(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  lea    D118(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    D11(%rip),%rax
  movq   %rax,%xmm0
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D114
type: string
name: read_data
arguments: data_tag: D18
type: string
name: read_data
arguments: data_tag: D55
type: byte[8]
name: read_data
arguments: data_tag: D37
type: string
name: read_data
arguments: data_tag: D16
type: byte[8]
name: read_data
arguments: data_tag: D66
type: string
name: read_data
arguments: data_tag: D11
type: f64
name: read_data
arguments: data_tag: D80
type: string
name: read_data
arguments: data_tag: D118
type: string

tool: D114: 
### RANDOM UTILITY UNIT TEST ###

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


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

tool: D37: Bin %d: %lf


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

tool: D66: Expected fraction: %lf


tool: D11: 0.5

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


tool: D118: 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;
}
```