// File: /workspace/github_cpp_makefile_star2_O2/buildsi[P]ldaudit-yaml/auditlib.cpp
// Function: la_symbind32
uintptr_t la_symbind32(Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
               uintptr_t *defcook, unsigned int *flags, const char *symname) {

  std::stringstream refcookie;
  refcookie << refcook;
  std::stringstream defcookie;
  defcookie << defcook;

  std::string desc;
  switch (*flags) {
    case LA_SYMB_DLSYM:
      desc = "The binding resulted from a call to dlsym(3).";     
      break;
    case LA_SYMB_ALTVALUE:
      desc = "A previous la_symbind*() call returned an alternate value for this symbol.";
      break;
    default:
      desc = "Unknown";
  }
   
  std::string output = "  - event: symbol_bind\n    name: \"" + std::string(symname) + "\"\n    function: la_symbind32\n    where_needed: " + refcookie.str() + "\n    where_defined: " + defcookie.str() +"\n    index_symbol: " + std::to_string(ndx) + "\n    description: " + desc + "\n";
  doPrint(output);

  return sym->st_value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x518, %rsp            # imm = 0x518
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x390(%rsp), %rdi
callq 0x20b0
leaq 0x3a0(%rsp), %rdi
movq %r13, %rsi
callq 0x20e0
leaq 0x208(%rsp), %rdi
callq 0x20b0
leaq 0x218(%rsp), %rdi
movq %r12, %rsi
callq 0x20e0
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl (%r15), %eax
cmpl $0x10, %eax
leaq 0x1249(%rip), %rcx      # 0x4594
leaq 0x1177(%rip), %rdx      # 0x44c9
cmoveq %rcx, %rdx
cmpl $0x8, %eax
leaq 0x1206(%rip), %rsi      # 0x4566
cmovneq %rdx, %rsi
leaq 0x8(%rsp), %rdi
callq 0x22a0
leaq 0xa8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r14, %rsi
callq 0x2250
leaq 0x1255(%rip), %rsi      # 0x45df
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x2240
leaq 0x125c(%rip), %rdx      # 0x4602
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x2050
leaq 0x3a8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x2220
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x2100
leaq 0x123e(%rip), %rdx      # 0x4632
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x2050
leaq 0x220(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x2220
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x2100
leaq 0x120b(%rip), %rdx      # 0x4647
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2050
leaq 0x48(%rsp), %rdi
movl %ebp, %esi
callq 0x2210
leaq 0x188(%rsp), %rdi
leaq 0x168(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x2100
leaq 0xfb9(%rip), %rdx       # 0x4437
leaq 0x1a8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x2050
leaq 0x1c8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x21e0
leaq 0xe46(%rip), %rdx       # 0x42fa
leaq 0x1e8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x2050
leaq 0x1c8(%rsp), %rdi
callq 0x20a0
leaq 0x1a8(%rsp), %rdi
callq 0x20a0
leaq 0x188(%rsp), %rdi
callq 0x20a0
leaq 0x48(%rsp), %rdi
callq 0x20a0
leaq 0x168(%rsp), %rdi
callq 0x20a0
leaq 0x148(%rsp), %rdi
callq 0x20a0
leaq 0x68(%rsp), %rdi
callq 0x20a0
leaq 0x128(%rsp), %rdi
callq 0x20a0
leaq 0x108(%rsp), %rdi
callq 0x20a0
leaq 0x88(%rsp), %rdi
callq 0x20a0
leaq 0xe8(%rsp), %rdi
callq 0x20a0
leaq 0xc8(%rsp), %rdi
callq 0x20a0
leaq 0xa8(%rsp), %rdi
callq 0x20a0
leaq 0x28(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x21a0
leaq 0x28(%rsp), %rdi
callq 0x25c5
leaq 0x28(%rsp), %rdi
callq 0x20a0
movl 0x4(%rbx), %ebx
leaq 0x1e8(%rsp), %rdi
callq 0x20a0
leaq 0x8(%rsp), %rdi
callq 0x20a0
leaq 0x208(%rsp), %rdi
callq 0x20d0
leaq 0x390(%rsp), %rdi
callq 0x20d0
movq %rbx, %rax
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20a0
jmp 0x35ed
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
jmp 0x36af
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x20a0
jmp 0x360f
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x20a0
jmp 0x3621
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
callq 0x20a0
jmp 0x3633
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20a0
jmp 0x3642
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x20a0
leaq 0x148(%rsp), %rdi
callq 0x20a0
leaq 0x68(%rsp), %rdi
callq 0x20a0
leaq 0x128(%rsp), %rdi
callq 0x20a0
leaq 0x108(%rsp), %rdi
callq 0x20a0
leaq 0x88(%rsp), %rdi
callq 0x20a0
leaq 0xe8(%rsp), %rdi
callq 0x20a0
leaq 0xc8(%rsp), %rdi
callq 0x20a0
leaq 0xa8(%rsp), %rdi
callq 0x20a0
leaq 0x8(%rsp), %rdi
callq 0x20a0
leaq 0x208(%rsp), %rdi
callq 0x20d0
leaq 0x390(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2270
movq %rax, %rbx
jmp 0x364f
movq %rax, %rbx
jmp 0x365c
movq %rax, %rbx
jmp 0x3666
movq %rax, %rbx
jmp 0x3673
movq %rax, %rbx
jmp 0x3680
movq %rax, %rbx
jmp 0x368d
movq %rax, %rbx
jmp 0x369a
movq %rax, %rbx
jmp 0x36a7
jmp 0x3719
movq %rax, %rbx
jmp 0x36b4
movq %rax, %rbx
jmp 0x36be
jmp 0x3725
movq %rax, %rbx
jmp 0x36cb