// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_vobj.c
// Function: vobj_read
static void vobj_read(struct GlobalVars *gv,struct LinkFile *lf,uint8_t *data)
{
  struct ObjectUnit *u;
  int bpb,bpt,nsecs,nsyms,i;
  struct vobj_symbol *vsymbols = NULL;

  if (lf->type == ID_LIBARCH) {  /* check ar-member for correct format */
    vobj_check_ar_type(fff[lf->format],lf->pathname,data);
  }
  p = data + 5;  /* skip ID and endianess */
  bpb = (int)read_number();  /* bits per byte */
  if (bpb != 8) {
    /* bits per byte are not supported */
    error(113,lf->pathname,fff[lf->format]->tname,bpb);
  }
  bpt = (int)read_number();  /* bytes per taddr */
  if (bpt > sizeof(taddr)) {
    /* n bytes per target-address are not supported */
    error(114,lf->pathname,fff[lf->format]->tname,bpt);
  }
  skip_string();  /* skip cpu-string */

  u = create_objunit(gv,lf,lf->objname);
  nsecs = (int)read_number();  /* number of sections */
  nsyms = (int)read_number();  /* number of symbols */

  if (nsyms) {
    vsymbols = alloc(nsyms * sizeof(struct vobj_symbol));
    for (i=0; i<nsyms; i++)
      read_symbol(&vsymbols[i]);
  }

  for (i=1; i<=nsecs; i++)
    read_section(gv,u,(uint32_t)i,vsymbols,nsyms);

  /* add relocatable and absolute symbols, ignore unknown symbol-refs */
  for (i=0; i<nsyms; i++) {
    struct vobj_symbol *vs = &vsymbols[i];
    struct Section *s = NULL;
    uint8_t type,bind,info;

    if (vs->flags & WEAK)
      bind = SYMB_WEAK;
    else if (vs->flags & EXPORT)
      bind = SYMB_GLOBAL;
    else
      bind = SYMB_LOCAL;

    if (vs->flags & COMMON) {
      type = SYM_COMMON;
      s = common_section(gv,u);
    }
    else if (vs->type == EXPRESSION) {
      type = SYM_ABS;
      s = abs_section(u);
    }
    else if (vs->type == LABSYM) {
      type = SYM_RELOC;
      if (!(s = find_sect_id(u,vs->sec))) {
        /* a section with this index doesn't exist! */
        error(53,lf->pathname,vs->name,lf->objname,vs->sec);
      }
    }
    else if (vs->type == IMPORT) {
      type = 0;  /* ignore unknown symbols */
    }
    else {
      /* illegal symbol type */
      error(116,getobjname(u),fff[lf->format]->tname,
            vs->type,vs->name,lf->objname);
      type = 0;
    }

    switch (TYPE(vs)) {
      case TYPE_UNKNOWN: info = SYMI_NOTYPE; break;
      case TYPE_OBJECT: info = SYMI_OBJECT; break;
      case TYPE_FUNCTION: info = SYMI_FUNC; break;
      case TYPE_SECTION: type = 0; break;  /* ignore SECTION symbols */
      case TYPE_FILE: info = SYMI_FILE; break;
      default:
        error(54,lf->pathname,TYPE(vs),vs->name,lf->objname);
        type = 0;
        break;
    }

    if (type) {
      if (bind == SYMB_LOCAL)
        addlocsymbol(gv,s,vs->name,NULL,(lword)vs->val,type,0,info,vs->size);
      else
        addsymbol(gv,s,vs->name,NULL,(lword)vs->val,
                  type,0,info,bind,vs->size,TRUE);
    }
  }
  if (nsyms)
    free(vsymbols);

  add_objunit(gv,u,TRUE);  /* add object unit and fix relocations */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
cmpb $0x8, 0x39(%rsi)
jne 0x1d2b5
movq 0x18(%rsp), %rdx
movzbl 0x38(%rdx), %eax
leaq 0x11f1b(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movq 0x10(%rdx), %rsi
cmpb $0x56, (%rbx)
jne 0x1d2a8
cmpb $0x4f, 0x1(%rbx)
jne 0x1d2a8
cmpb $0x42, 0x2(%rbx)
jne 0x1d2a8
cmpb $0x4a, 0x3(%rbx)
jne 0x1d2a8
xorl %ecx, %ecx
cmpb $0x1, 0xaa(%rax)
movzbl 0x4(%rbx), %edx
adcl $0x1, %ecx
cmpl %edx, %ecx
je 0x1d2b5
movq (%rax), %rdx
pushq $0x29
popq %rdi
xorl %eax, %eax
callq 0x6c19
addq $0x5, %rbx
movq %rbx, 0x16df0(%rip)     # 0x340b0
callq 0x1da5d
cmpl $0x8, %eax
je 0x1d2f1
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rsi
movzbl 0x38(%rcx), %ecx
leaq 0x11eb2(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
pushq $0x71
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x6c19
callq 0x1da5d
cmpl $0x9, %eax
jb 0x1d322
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rsi
movzbl 0x38(%rcx), %ecx
leaq 0x11e81(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
pushq $0x72
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x6c19
callq 0x1daae
movq 0x18(%rsp), %rsi
movq 0x20(%rsi), %rdx
movq 0x20(%rsp), %rdi
callq 0xb87e
movq %rax, 0x10(%rsp)
callq 0x1da5d
movq %rax, %r12
callq 0x1da5d
movq %rax, %rbp
xorl %ebx, %ebx
testl %ebp, %ebp
je 0x1d3e0
movslq %ebp, %rdi
shlq $0x5, %rdi
callq 0x6340
movq %rax, %rcx
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
shlq $0x5, %r14
xorl %r15d, %r15d
movq %rax, (%rsp)
cmpq %r15, %r14
je 0x1d3e8
movq 0x16d25(%rip), %rax     # 0x340b0
movq %rax, (%rcx,%r15)
callq 0x1daae
callq 0x1da5d
movq (%rsp), %rcx
movl %eax, 0x8(%rcx,%r15)
callq 0x1da5d
movq (%rsp), %rcx
movl %eax, 0xc(%rcx,%r15)
callq 0x1da5d
movq (%rsp), %rcx
movl %eax, 0x10(%rcx,%r15)
callq 0x1da5d
movq (%rsp), %rcx
movq %rax, 0x18(%rcx,%r15)
callq 0x1da5d
movq (%rsp), %rcx
movl %eax, 0x14(%rcx,%r15)
addq $0x20, %r15
jmp 0x1d37f
movq $0x0, (%rsp)
testl %r12d, %r12d
cmovlel %ebx, %r12d
incl %r12d
movq %r12, 0x88(%rsp)
pushq $0x1
popq %rbx
movq %rbp, 0x38(%rsp)
cmpl 0x88(%rsp), %ebx
je 0x1d81c
movl %ebx, 0x8(%rsp)
movq 0x16c96(%rip), %rax     # 0x340b0
movq %rax, 0x50(%rsp)
callq 0x1daae
movb $0x2, %bpl
movb $0x1, %bl
xorl %r13d, %r13d
movq 0x16c7d(%rip), %r14     # 0x340b0
movzbl (%r14), %r15d
testq %r15, %r15
je 0x1d48c
callq 0x5290
movq (%rax), %rax
movl (%rax,%r15,4), %eax
cmpl $0x61, %eax
je 0x1d483
cmpl $0x63, %eax
je 0x1d47e
cmpl $0x64, %eax
je 0x1d46b
cmpl $0x75, %eax
je 0x1d475
cmpl $0x78, %eax
je 0x1d470
cmpl $0x77, %eax
jne 0x1d487
orb $0x2, %bl
jmp 0x1d487
movb $0x2, %bpl
jmp 0x1d487
orb $0x4, %bl
jmp 0x1d487
orb $0x2, %r13b
movb $0x3, %bpl
jmp 0x1d487
movb $0x1, %bpl
jmp 0x1d487
orb $0x1, %r13b
incq %r14
jmp 0x1d433
callq 0x1daae
callq 0x1da5d
callq 0x1da5d
movq %rax, %rdi
callq 0x6a69
movl %eax, 0x40(%rsp)
callq 0x1da5d
movq %rax, %r14
callq 0x1da5d
movq %rax, 0x30(%rsp)
callq 0x1da5d
movq %rax, %r15
cmpb $0x3, %bpl
jne 0x1d4d2
movq 0x16be2(%rip), %r12     # 0x340b0
xorl %edx, %edx
jmp 0x1d50a
cmpq %r15, %r14
jle 0x1d500
movq %r14, %rdi
callq 0x638a
movq %rax, 0x60(%rsp)
movq 0x16bc5(%rip), %r12     # 0x340b0
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x51a0
movq 0x60(%rsp), %rdx
jmp 0x1d50a
movq 0x16ba9(%rip), %r12     # 0x340b0
movq %r12, %rdx
addq %r15, %r12
movq %r12, 0x16b9c(%rip)     # 0x340b0
subq $0x8, %rsp
movzbl 0x48(%rsp), %eax
movzbl %bl, %r10d
movzbl %bpl, %r8d
movzbl %r13b, %r9d
movq 0x18(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %rdx, 0x68(%rsp)
movq %r14, %rcx
pushq $0x0
pushq %rax
pushq %r10
callq 0xbab3
addq $0x20, %rsp
movl 0x8(%rsp), %ebx
movq %rax, 0x78(%rsp)
movl %ebx, 0x28(%rax)
movw $0xffff, 0xe(%rsp)      # imm = 0xFFFF
pushq $-0x1
popq %rax
movl %eax, 0x4c(%rsp)
pushq $-0x1
popq %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x68(%rsp)
movl %ebx, 0x2c(%rsp)
movq 0x38(%rsp), %rbp
movq 0x30(%rsp), %rax
testl %eax, %eax
jle 0x1d815
movq %rax, 0x30(%rsp)
callq 0x1da5d
movq %rax, %rbx
callq 0x1da5d
movq %rax, %r14
callq 0x1da5d
movq %rax, 0x50(%rsp)
callq 0x1da5d
movq %rax, %r13
callq 0x1da5d
movq %rax, 0x40(%rsp)
callq 0x1da5d
movq %rax, 0x80(%rsp)
callq 0x1da5d
movq %rbx, %rdi
leal -0x1(%rax), %r12d
movzbl %dil, %r15d
leal -0x11(%r15), %ecx
cmpl $-0x10, %ecx
setb %cl
testq %r14, %r14
sets %dl
movzwl %r13w, %esi
cmpl $0x41, %esi
setae %sil
orb %dl, %sil
orb %cl, %sil
testl %eax, %eax
setle %cl
cmpl %ebp, %eax
setg %bpl
orb %cl, %bpl
orb %bpl, %sil
movl %r12d, %ebx
je 0x1d69c
testl %r15d, %r15d
je 0x1d68e
movq 0x10(%rsp), %rdi
callq 0x6e1c
xorl %r11d, %r11d
leaq 0x6210(%rip), %r10      # 0x2383c
testb %bpl, %bpl
jne 0x1d642
shlq $0x5, %rbx
movq (%rsp), %rcx
movq (%rcx,%rbx), %r10
movl 0x8(%rcx,%rbx), %r11d
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rcx
movzbl 0x38(%rcx), %ecx
leaq 0x11b3a(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movl $0xffff, %ecx           # imm = 0xFFFF
movq 0x50(%rsp), %r9
andl %ecx, %r9d
andl %ecx, %r13d
pushq $0x73
popq %rdi
movq %rax, %rsi
movl %r15d, %ecx
movq %r14, %r8
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x50(%rsp)
pushq %r13
callq 0x6c19
addq $0x20, %rsp
movq 0x38(%rsp), %rbp
movl 0x8(%rsp), %ebx
jmp 0x1d809
shlq $0x5, %rbx
movq (%rsp), %rax
leaq (%rax,%rbx), %rbp
movl 0x8(%rax,%rbx), %eax
cmpl $0x2, %eax
je 0x1d6c4
cmpl $0x1, %eax
jne 0x1d6de
movl 0x10(%rbp), %eax
movl %eax, 0x2c(%rsp)
xorl %edx, %edx
jmp 0x1d74f
movq (%rbp), %rdx
movb 0xc(%rbp), %r15b
shrb $0x6, %r15b
andb $0x1, %r15b
movl $0x0, 0x2c(%rsp)
jmp 0x1d752
movq 0x10(%rsp), %rbx
movq %rdi, 0x90(%rsp)
movq %rbx, %rdi
callq 0x6e1c
movq 0x10(%rbx), %rcx
movzbl 0x38(%rcx), %ecx
leaq 0x11a8e(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movq 0x50(%rsp), %rcx
movl %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
andl %ecx, %r9d
movl %r13d, %r10d
andl %ecx, %r10d
movl 0x8(%rbp), %r11d
pushq $0x73
popq %rdi
movq %rax, %rsi
movl %r15d, %ecx
movq %r14, %r8
xorl %eax, %eax
pushq %r11
pushq (%rbp)
pushq 0x50(%rsp)
pushq %r10
callq 0x6c19
xorl %edx, %edx
movq 0xb0(%rsp), %rdi
addq $0x20, %rsp
xorl %r15d, %r15d
movl 0x8(%rsp), %ebx
cmpl 0x4c(%rsp), %r12d
sete %al
cmpq 0x70(%rsp), %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x38(%rsp), %rbp
jne 0x1d786
movq 0x50(%rsp), %rax
cmpw %ax, 0xe(%rsp)
jne 0x1d786
cmpq $0x0, 0x68(%rsp)
jne 0x1d7cc
movzbl %dil, %eax
movq 0x20(%rsp), %rdi
movq 0x78(%rsp), %rsi
xorl %ecx, %ecx
movl 0x2c(%rsp), %r8d
movq %r14, %r9
pushq 0x80(%rsp)
pushq %rax
callq 0xabec
addq $0x10, %rsp
movq %rax, 0x68(%rsp)
orb %r15b, 0x39(%rax)
movl %r12d, 0x4c(%rsp)
movq %r14, 0x70(%rsp)
movq 0x50(%rsp), %rax
movw %ax, 0xe(%rsp)
movzwl 0x50(%rsp), %edx
movzwl %r13w, %ecx
movq 0x78(%rsp), %rdi
movq 0x68(%rsp), %r15
movq %r15, %rsi
movq 0x40(%rsp), %r8
callq 0xac9f
movl %r14d, %esi
addq 0x60(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq %r15, %rdx
movq 0x80(%rsp), %rcx
callq 0xaf7b
movq 0x30(%rsp), %rax
decl %eax
jmp 0x1d582
incl %ebx
jmp 0x1d402
testl %ebp, %ebp
movl $0x0, %r12d
cmovgl %ebp, %r12d
shlq $0x5, %r12
xorl %ebp, %ebp
movq (%rsp), %rdi
movq %r12, 0x30(%rsp)
cmpq %rbp, %r12
je 0x1da2e
movd 0xc(%rdi,%rbp), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x5f7d(%rip), %xmm0     # 0x237d0
pcmpeqd 0x3b25(%rip), %xmm0     # 0x21380
movdqa %xmm0, 0x50(%rsp)
movmskps %xmm0, %eax
movl %eax, %ecx
andb $0x4, %cl
shrb $0x2, %cl
movb $0x2, %dl
subb %cl, %dl
movzbl %dl, %r14d
testb $0x8, %al
pushq $0x3
popq %rcx
cmovel %ecx, %r14d
testb $0x1, %al
je 0x1d8b2
movl 0x8(%rdi,%rbp), %eax
cmpl $0x1, %eax
je 0x1d8d7
movb $0x1, %r13b
cmpl $0x2, %eax
je 0x1d8d2
cmpl $0x3, %eax
jne 0x1d8f4
movq 0x10(%rsp), %rdi
callq 0xbbcd
movq %rax, %r15
movb $0x1, %bl
xorl %r13d, %r13d
movq (%rsp), %rdi
jmp 0x1d96a
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xbb2a
movq (%rsp), %rdi
movq %rax, %r15
movb $0x3, %bl
xorl %r13d, %r13d
jmp 0x1d96a
xorl %r15d, %r15d
jmp 0x1d938
movl 0x10(%rdi,%rbp), %esi
movq %rdi, %r12
movq 0x10(%rsp), %rdi
callq 0xb783
movb $0x2, %bl
testq %rax, %rax
je 0x1d93c
movq %rax, %r15
jmp 0x1d95f
movq 0x10(%rsp), %rdi
callq 0x6e1c
movq 0x18(%rsp), %rsi
movzbl 0x38(%rsi), %ecx
leaq 0x11882(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movq (%rsp), %rbx
movl 0x8(%rbx,%rbp), %ecx
movq (%rbx,%rbp), %r8
movq 0x20(%rsi), %r9
xorl %r15d, %r15d
pushq $0x74
popq %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x6c19
movq %rbx, %rdi
xorl %ebx, %ebx
jmp 0x1d96a
movq (%r12,%rbp), %rdx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rcx
movl 0x10(%r12,%rbp), %r8d
xorl %r15d, %r15d
pushq $0x35
popq %rdi
xorl %eax, %eax
callq 0x6c19
xorl %r13d, %r13d
movq %r12, %rdi
movq 0x30(%rsp), %r12
movl 0xc(%rdi,%rbp), %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x1da06
leaq 0x5e5f(%rip), %rcx      # 0x237e0
movslq (%rcx,%rdx,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
jmp 0x1d998
movb $0x4, %al
jmp 0x1d998
movb $0x1, %al
jmp 0x1d998
movb $0x2, %al
testb %r13b, %r13b
jne 0x1da25
movq (%rdi,%rbp), %rdx
movq 0x18(%rdi,%rbp), %r8
movdqa 0x50(%rsp), %xmm0
pextrw $0x2, %xmm0, %ecx
movl 0x14(%rdi,%rbp), %r10d
movzbl %al, %eax
movzbl %bl, %r9d
subq $0x8, %rsp
testb $0x1, %cl
je 0x1d9e4
movq 0x28(%rsp), %rdi
movq %r15, %rsi
xorl %ecx, %ecx
pushq %r10
pushq %rax
pushq $0x0
callq 0xa7c3
addq $0x20, %rsp
jmp 0x1da21
movzbl %r14b, %r11d
movq 0x28(%rsp), %rdi
movq %r15, %rsi
xorl %ecx, %ecx
pushq $0x1
pushq %r10
pushq %r11
pushq %rax
pushq $0x0
callq 0xa5d5
addq $0x30, %rsp
jmp 0x1da21
movq (%rdi,%rbp), %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rax), %r8
pushq $0x36
popq %rdi
xorl %eax, %eax
callq 0x6c19
movq (%rsp), %rdi
addq $0x20, %rbp
jmp 0x1d837
cmpl $0x0, 0x38(%rsp)
je 0x1da3a
callq 0x5040
pushq $0x1
popq %rdx
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb95b