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

```asm
<Rabin_Karp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  movl   $0x1,-0x2c(%rbp)
  movl   $0x100,-0x8(%rbp)
  movl   $0x95,-0x4(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L44
L125:
  mov    -0x2c(%rbp),%eax
  imul   -0x8(%rbp),%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,-0x2c(%rbp)
  addl   $0x1,-0x28(%rbp)
L44:
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x28(%rbp)
  jl     L125
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L126
L111:
  mov    -0x24(%rbp),%eax
  imul   -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x20(%rbp),%eax
  imul   -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,-0x20(%rbp)
  addl   $0x1,-0x1c(%rbp)
L126:
  mov    -0x1c(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L111
  movl   $0x0,-0x18(%rbp)
  jmp    L94
L98:
  mov    -0x24(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jne    L38
  movl   $0x0,-0x14(%rbp)
  jmp    L53
L43:
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L92
  addl   $0x1,-0x14(%rbp)
L53:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L43
  jmp    L49
L92:
  nop
L49:
  mov    -0x14(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L38
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L38:
  mov    -0x10(%rbp),%eax
  sub    -0xc(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jge    L89
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  imul   -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  sub    %edx,%eax
  imul   -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L89
  mov    -0x4(%rbp),%eax
  add    %eax,-0x24(%rbp)
L89:
  addl   $0x1,-0x18(%rbp)
L94:
  mov    -0x10(%rbp),%eax
  sub    -0xc(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jle    L98
  nop
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D5
type_guessed: string

tool: D5: 

Pattern searched is found at position %d



assistant: ```c
void Rabin_Karp(char *text, char *pattern) {
  int text_len = strlen(text);
  int pattern_len = strlen(pattern);
  int hash = 1;
  int asciichars = 256;
  int prime = 149;
  for (int i = 0; i < pattern_len - 1; i++) {
    hash = (hash * asciichars) % prime;
  }
  int hash_txt = 0, hash_pat = 0;
  for (int i = 0; i < pattern_len; i++) {
    hash_txt = (hash_txt * asciichars + text[i]) % prime;
    hash_pat = (hash_pat * asciichars + pattern[i]) % prime;
  }
  for (int i = 0; i <= text_len - pattern_len; i++) {
    int j;
    if (hash_txt == hash_pat) {
      for (j = 0; j < pattern_len; j++) {
        if (text[i + j] != pattern[j])
          break;
      }
      if (j == pattern_len) {
        printf("\n\nPattern searched is found at position %d\n\n", i + 1);
      }
    }
    if (i < text_len - pattern_len) {
      hash_txt = ((hash_txt - text[i] * hash) * asciichars + text[i + pattern_len]) % prime;
      if (hash_txt < 0) {
        hash_txt = hash_txt + prime;
      }
    }
  }
}
```