// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/linker.c
// Function: searchlib
static char *searchlib(struct GlobalVars *gv,char *libname,int so_ver)
{
  struct LibPath *lpn = (struct LibPath *)gv->libpaths.first;
  struct LibPath *nextlpn;
  char *p,*path,*flavour_dir;
  int i,count;
  size_t len;

  if (p = scan_directory(".",libname,so_ver))
    return (p);

  while (nextlpn = (struct LibPath *)lpn->n.next) {
    for (count=gv->flavours.n_flavours; count>=0; count--) {
      flavour_dir = gv->flavours.flavour_dir;
      for (flavour_dir[0]='\0',i=0; i<count; i++) {
        if (!path_append(flavour_dir,flavour_dir,gv->flavours.flavours[i],
                         gv->flavours.flavours_len + 1))
          ierror("searchlib(): flavour \"%s\" doesn't fit into path buffer",
                 gv->flavours.flavours[i]);
      }
      len = strlen(lpn->path) + strlen(flavour_dir) + 3;
      if (len < FNAMEBUFSIZE) {
        path = path_append(namebuf2,lpn->path,flavour_dir,FNAMEBUFSIZE);
        if (p = scan_directory(path,libname,so_ver))
          return (p);
      }
    }
    lpn = nextlpn;
  }
  return (NULL);
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
leaq 0x253d5(%rip), %rdi     # 0x34004
callq 0xedd0
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0xec4e
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0xedc0
jmp 0xec50
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0xedb7
movq 0x58(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, 0x18(%rsp)
cmpl $0x0, 0x18(%rsp)
jl 0xeda8
movq 0x58(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movb $0x0, (%rax)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x18(%rsp), %eax
jge 0xed0a
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x58(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x58(%rsp), %rax
movl 0x34(%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
callq 0xf3c0
cmpq $0x0, %rax
jne 0xecfb
movq 0x58(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x26777(%rip), %rdi     # 0x3546b
movb $0x0, %al
callq 0x8ae0
jmp 0xecfd
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xec9c
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x50c0
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0x50c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
addq %rcx, %rax
addq $0x3, %rax
movq %rax, 0x10(%rsp)
cmpq $0x400, 0x10(%rsp)      # imm = 0x400
jae 0xed96
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rsp), %rdx
leaq 0x35875(%rip), %rdi     # 0x445d0
movl $0x400, %ecx            # imm = 0x400
callq 0xf3c0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
callq 0xedd0
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0xed94
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0xedc0
jmp 0xed96
jmp 0xed98
movl 0x18(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xec73
movq 0x38(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xec50
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw (%rax,%rax)