user: Converte this assembly snippet into its equivalent C code:

```asm
<find_ranlib>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x10000(%rsp),%r11
L69:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L69
  sub    $0xc0,%rsp
  mov    %rdi,-0x100a8(%rbp)
  mov    %esi,-0x100ac(%rbp)
  mov    %rdx,-0x100b8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x100ac(%rbp),%edx
  mov    -0x100a8(%rbp),%rax
  mov    %rax,%rsi
  lea    D102(%rip),%rax
  mov    %rax,%rdi
  call   <which@plt>
  test   %rax,%rax
  je     L21
  mov    $0x1,%eax
  jmp    L13
L21:
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  lea    D65(%rip),%rax
  mov    %rax,%rdx
  lea    D148(%rip),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <putfile@plt>
  lea    D15(%rip),%rax
  mov    %rax,%rdx
  lea    D148(%rip),%rax
  mov    %rax,%rsi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <putfile@plt>
  mov    -0x100b8(%rbp),%rdx
  lea    -0x10090(%rbp),%rax
  lea    D106(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x10090(%rbp),%rdx
  lea    -0x10010(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x10000,%edx
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <msystem@plt>
  mov    %eax,-0x10094(%rbp)
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  cmpl   $0x0,-0x10094(%rbp)
  jne    L45
  lea    -0x10010(%rbp),%rax
  lea    D90(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <STRSTR@plt>
  test   %rax,%rax
  je     L45
  mov    -0x100a8(%rbp),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    $0x1,%eax
  jmp    L13
L45:
  mov    $0x0,%eax
L13:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L64
  call   <__stack_chk_fail@plt>
L64:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D102
type_infered: string
name: retrieve_data
arguments: data_tag: D49
type_infered: string
name: retrieve_data
arguments: data_tag: D65
type_infered: string
name: retrieve_data
arguments: data_tag: D148
type_infered: string
name: retrieve_data
arguments: data_tag: D47
type_infered: string
name: retrieve_data
arguments: data_tag: D15
type_infered: string
name: retrieve_data
arguments: data_tag: D119
type_infered: string
name: retrieve_data
arguments: data_tag: D106
type_infered: string
name: retrieve_data
arguments: data_tag: D51
type_infered: string
name: retrieve_data
arguments: data_tag: D90
type_infered: string
name: retrieve_data
arguments: data_tag: D23
type_infered: string

tool: D102: ranlib

tool: D49: _.a

tool: D65: sub(){}


tool: D148: w

tool: D47: _.c

tool: D15: _.a:; $(CC) -c _.c
	$(AR) cr _.a _.o
	$(AR) st _.a
	echo SUCCESS


tool: D119: _make

tool: D106: %s -f _make

tool: D51: _.o

tool: D90: SUCCESS

tool: D23: $(AR) st

assistant: ```c
int find_ranlib(char *ranlib, int size, const char *make) {
  char command[128];
  char res[0x10000];
  int rcode;
  if (which("ranlib", ranlib, size))
    return 1;
  unlink("_.a");
  putfile("_.c", "w", "sub(){}\n");
  putfile("_make", "w", "_.a:; $(CC) -c _.c\n\t$(AR) cr _.a _.o\n\t$(AR) st _.a\n\techo SUCCESS\n");
  sprintf(command, "%s -f _make", make);
  rcode = msystem(1, res, sizeof(res), command);
  unlink("_.c");
  unlink("_make");
  unlink("_.a");
  unlink("_.o");
  if (rcode == 0 && STRSTR(res, "SUCCESS")) {
    strcpy(ranlib, "$(AR) st");
    return 1;
  }
  return 0;
}
```