// File: /workspace/github_c_makefile_star2_O3/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 $0xa8, %rsp
movq %rdx, %rbx
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
cmpb $0x8, 0x39(%rsi)
jne 0x1ed1b
movq 0x10(%rsp), %rdx
movzbl 0x38(%rdx), %eax
leaq 0x104a7(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movq 0x10(%rdx), %rsi
cmpb $0x56, (%rbx)
jne 0x1ed0c
cmpb $0x4f, 0x1(%rbx)
jne 0x1ed0c
cmpb $0x42, 0x2(%rbx)
jne 0x1ed0c
cmpb $0x4a, 0x3(%rbx)
jne 0x1ed0c
xorl %ecx, %ecx
cmpb $0x1, 0xaa(%rax)
movzbl 0x4(%rbx), %edx
adcl $0x1, %ecx
cmpl %edx, %ecx
je 0x1ed1b
movq (%rax), %rdx
movl $0x29, %edi
xorl %eax, %eax
callq 0x6f14
addq $0x5, %rbx
movq %rbx, 0x14f9a(%rip)     # 0x33cc0
callq 0x1f55b
cmpl $0x8, %eax
je 0x1ed59
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rsi
movzbl 0x38(%rcx), %ecx
leaq 0x1043c(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movl $0x71, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x6f14
callq 0x1f55b
cmpl $0x9, %eax
jb 0x1ed8c
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rsi
movzbl 0x38(%rcx), %ecx
leaq 0x10409(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movl $0x72, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x6f14
movq 0x14f2d(%rip), %rax     # 0x33cc0
cmpb $0x0, (%rax)
je 0x1eda7
leaq 0x1(%rax), %rcx
cmpb $0x0, 0x1(%rax)
movq %rcx, %rax
jne 0x1ed98
jmp 0x1edaa
movq %rax, %rcx
incq %rcx
movq %rcx, 0x14f0c(%rip)     # 0x33cc0
movq 0x10(%rsp), %rsi
movq 0x20(%rsi), %rdx
movq 0x18(%rsp), %rdi
callq 0xbeac
movq %rax, 0x8(%rsp)
callq 0x1f55b
movq %rax, 0x88(%rsp)
callq 0x1f55b
movq %rax, %r12
testl %r12d, %r12d
je 0x1ee78
movslq %r12d, %rdi
shlq $0x5, %rdi
callq 0x6638
movq %rax, %r13
testl %r12d, %r12d
jle 0x1ee7b
movl %r12d, %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movq %r14, %r15
shlq $0x5, %r15
movq 0x14ea8(%rip), %rax     # 0x33cc0
movq %rax, (%r13,%r15)
cmpb $0x0, (%rax)
je 0x1ee31
leaq 0x1(%rax), %rcx
cmpb $0x0, 0x1(%rax)
movq %rcx, %rax
jne 0x1ee22
jmp 0x1ee34
movq %rax, %rcx
addq %r13, %r15
incq %rcx
movq %rcx, 0x14e7f(%rip)     # 0x33cc0
callq 0x1f55b
movl %eax, 0x8(%r15)
callq 0x1f55b
movl %eax, 0xc(%r15)
callq 0x1f55b
movl %eax, 0x10(%r15)
callq 0x1f55b
movq %rax, 0x18(%r15)
callq 0x1f55b
movl %eax, 0x14(%r15)
incq %r14
cmpq %rbx, %r14
jne 0x1ee0a
jmp 0x1ee7b
xorl %r13d, %r13d
movq %r13, 0x68(%rsp)
cmpl $0x0, 0x88(%rsp)
movq %r12, 0x60(%rsp)
jle 0x1f32a
movl $0x1, %eax
movq %rax, 0x58(%rsp)
movq 0x14e1c(%rip), %rcx     # 0x33cc0
cmpb $0x0, (%rcx)
movq %rcx, %r14
je 0x1eebc
movq %rcx, %rax
leaq 0x1(%rax), %r14
cmpb $0x0, 0x1(%rax)
movq %r14, %rax
jne 0x1eeaf
movb 0x1(%r14), %r12b
testb %r12b, %r12b
movq %rcx, 0x40(%rsp)
je 0x1ef40
callq 0x5280
movq (%rax), %rax
leaq 0x2(%r14), %rcx
movb $0x1, %bl
movb $0x2, %r15b
xorl %ebp, %ebp
movzbl %r12b, %edx
movl (%rax,%rdx,4), %edx
cmpl $0x74, %edx
jg 0x1eefd
cmpl $0x61, %edx
je 0x1ef11
cmpl $0x63, %edx
je 0x1ef20
cmpl $0x64, %edx
jne 0x1ef28
movb $0x2, %r15b
jmp 0x1ef28
cmpl $0x75, %edx
je 0x1ef17
cmpl $0x78, %edx
je 0x1ef25
cmpl $0x77, %edx
jne 0x1ef28
orb $0x2, %bl
jmp 0x1ef28
orb $0x1, %bpl
jmp 0x1ef28
orb $0x2, %bpl
movb $0x3, %r15b
jmp 0x1ef28
movb $0x1, %r15b
jmp 0x1ef28
orb $0x4, %bl
movb (%rcx), %r12b
incq %rcx
testb %r12b, %r12b
jne 0x1eedd
cmpb $0x0, 0x2(%r14)
leaq 0x1(%r14), %r14
jne 0x1ef33
jmp 0x1ef47
movb $0x1, %bl
movb $0x2, %r15b
xorl %ebp, %ebp
addq $0x2, %r14
movq %r14, 0x14d6e(%rip)     # 0x33cc0
callq 0x1f55b
callq 0x1f55b
movq %rax, %rdi
callq 0x6e27
movl %eax, 0x28(%rsp)
callq 0x1f55b
movq %rax, %r13
callq 0x1f55b
movq %rax, %r14
callq 0x1f55b
movq %rax, %r12
cmpb $0x3, %r15b
movq %r13, 0x30(%rsp)
jne 0x1ef96
movq 0x14d2e(%rip), %r13     # 0x33cc0
xorl %edx, %edx
jmp 0x1efce
cmpq %r12, %r13
jle 0x1efc4
movq %r13, %rdi
callq 0x6686
movq %rax, 0x70(%rsp)
movq 0x14d11(%rip), %r13     # 0x33cc0
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x51a0
movq 0x70(%rsp), %rdx
jmp 0x1efce
movq 0x14cf5(%rip), %r13     # 0x33cc0
movq %r13, %rdx
movq 0x40(%rsp), %rsi
movl 0x28(%rsp), %eax
addq %r12, %r13
movq %r13, 0x14cdf(%rip)     # 0x33cc0
subq $0x8, %rsp
movzbl %al, %eax
movzbl %bl, %r10d
movzbl %r15b, %r8d
movzbl %bpl, %r9d
movq 0x10(%rsp), %rdi
movq %rdx, 0x78(%rsp)
movq 0x38(%rsp), %rcx
pushq $0x0
pushq %rax
pushq %r10
callq 0xc11b
addq $0x20, %rsp
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x98(%rsp)
movl %eax, 0x28(%rcx)
testl %r14d, %r14d
movq 0x60(%rsp), %r12
jle 0x1f310
incl %r14d
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
movq $-0x1, 0x90(%rsp)
movw $0xffff, 0x6(%rsp)      # imm = 0xFFFF
movq 0x58(%rsp), %rax
movl %eax, 0x24(%rsp)
movq $0x0, 0x80(%rsp)
callq 0x1f55b
movq %rax, %rbx
callq 0x1f55b
movq %rax, %r13
callq 0x1f55b
movq %rax, 0x30(%rsp)
callq 0x1f55b
movq %rax, %rbp
callq 0x1f55b
movq %rax, 0x40(%rsp)
callq 0x1f55b
movq %rax, 0x28(%rsp)
callq 0x1f55b
movq %rbx, %r8
leal -0x1(%rax), %edi
movzbl %r8b, %r15d
leal -0x11(%r15), %ecx
cmpl $-0x10, %ecx
setb %cl
testq %r13, %r13
sets %dl
movzwl %bp, %esi
cmpl $0x41, %esi
setae %sil
orb %dl, %sil
orb %cl, %sil
testl %eax, %eax
setle %cl
cmpl %r12d, %eax
setg %bl
orb %cl, %bl
orb %bl, %sil
je 0x1f16f
testl %r15d, %r15d
je 0x1f303
movl %edi, %r12d
movq 0x8(%rsp), %rdi
callq 0x7104
xorl %r11d, %r11d
leaq 0x6b1c(%rip), %r10      # 0x25c1c
testb %bl, %bl
jne 0x1f119
movl %r12d, %ecx
shlq $0x5, %rcx
movq 0x68(%rsp), %rdx
movq (%rdx,%rcx), %r10
movl 0x8(%rdx,%rcx), %r11d
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
movzbl 0x38(%rcx), %ecx
leaq 0x10053(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movl $0xffff, %ecx           # imm = 0xFFFF
movq 0x30(%rsp), %r9
andl %ecx, %r9d
andl %ecx, %ebp
movl $0x73, %edi
movq %rax, %rsi
movl %r15d, %ecx
movq %r13, %r8
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x50(%rsp)
pushq %rbp
callq 0x6f14
addq $0x20, %rsp
movq 0x60(%rsp), %r12
jmp 0x1f303
movl %edi, %eax
shlq $0x5, %rax
movq 0x68(%rsp), %rcx
leaq (%rcx,%rax), %rbx
movl 0x8(%rcx,%rax), %eax
cmpl $0x2, %eax
je 0x1f19a
cmpl $0x1, %eax
jne 0x1f1b6
movl 0x10(%rbx), %eax
movl %eax, 0x24(%rsp)
xorl %edx, %edx
jmp 0x1f239
movq (%rbx), %rdx
movb 0xc(%rbx), %r15b
shrb $0x6, %r15b
andb $0x1, %r15b
movl $0x0, 0x24(%rsp)
jmp 0x1f23c
movq 0x8(%rsp), %r12
movl %edi, 0x78(%rsp)
movq %r12, %rdi
movq %r8, 0xa0(%rsp)
callq 0x7104
movq 0x10(%r12), %rcx
movq 0x60(%rsp), %r12
movzbl 0x38(%rcx), %ecx
leaq 0xff9c(%rip), %rdx      # 0x2f180
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movq 0x30(%rsp), %rcx
movl %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
andl %ecx, %r9d
movl %ebp, %r10d
andl %ecx, %r10d
movl 0x8(%rbx), %r11d
movl $0x73, %edi
movq %rax, %rsi
movl %r15d, %ecx
movq %r13, %r8
xorl %eax, %eax
pushq %r11
pushq (%rbx)
pushq 0x50(%rsp)
pushq %r10
callq 0x6f14
xorl %edx, %edx
movq 0xc0(%rsp), %r8
movl 0x98(%rsp), %edi
addq $0x20, %rsp
xorl %r15d, %r15d
cmpl 0x3c(%rsp), %edi
sete %al
cmpq 0x90(%rsp), %r13
sete %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x30(%rsp), %rbx
jne 0x1f26c
cmpw %bx, 0x6(%rsp)
jne 0x1f26c
cmpq $0x0, 0x80(%rsp)
jne 0x1f2c6
movzbl %r8b, %eax
movq %rbp, 0x78(%rsp)
movq %r12, %rbp
movl %edi, %r12d
movq 0x18(%rsp), %rdi
movq 0x98(%rsp), %rsi
xorl %ecx, %ecx
movl 0x24(%rsp), %r8d
movq %r13, %r9
pushq 0x28(%rsp)
pushq %rax
callq 0xb13c
addq $0x10, %rsp
movq %rax, 0x80(%rsp)
orb %r15b, 0x39(%rax)
movl %r12d, 0x3c(%rsp)
movq %rbp, %r12
movq 0x78(%rsp), %rbp
movq %r13, 0x90(%rsp)
movw %bx, 0x6(%rsp)
movzwl %bx, %edx
movzwl %bp, %ecx
movq 0x98(%rsp), %rdi
movq 0x80(%rsp), %rbx
movq %rbx, %rsi
movq 0x40(%rsp), %r8
callq 0xb1f1
movl %r13d, %esi
addq 0x70(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
movq 0x28(%rsp), %rcx
callq 0xb4ed
decl %r14d
cmpl $0x1, %r14d
jg 0x1f065
movq 0x58(%rsp), %rcx
leal 0x1(%rcx), %eax
cmpl 0x88(%rsp), %ecx
movq %rax, 0x58(%rsp)
jne 0x1ee9d
testl %r12d, %r12d
jle 0x1f527
movl %r12d, %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq 0x68(%rsp), %r13
movd 0xc(%r13), %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x685b(%rip), %xmm0     # 0x25bb0
pcmpeqd 0x2d63(%rip), %xmm0     # 0x220c0
movdqa %xmm0, 0x40(%rsp)
movmskps %xmm0, %eax
movl %eax, %ecx
andb $0x4, %cl
shrb $0x2, %cl
movb $0x2, %dl
subb %cl, %dl
movzbl %dl, %r15d
testb $0x8, %al
movl $0x3, %ecx
cmovel %ecx, %r15d
testb $0x1, %al
je 0x1f3ad
movl 0x8(%r13), %eax
cmpl $0x1, %eax
je 0x1f3cb
movb $0x1, %r12b
cmpl $0x2, %eax
je 0x1f3c7
cmpl $0x3, %eax
jne 0x1f3ea
movq 0x8(%rsp), %rdi
callq 0xc25f
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x1f3c2
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0xc195
movq %rax, %rbx
movb $0x3, %bpl
xorl %r12d, %r12d
jmp 0x1f42a
xorl %ebx, %ebx
jmp 0x1f428
movl 0x10(%r13), %esi
movq 0x8(%rsp), %rdi
callq 0xbdad
movb $0x2, %bpl
testq %rax, %rax
je 0x1f4ff
movq %rax, %rbx
jmp 0x1f3c2
movq 0x8(%rsp), %rdi
callq 0x7104
movq 0x10(%rsp), %rsi
movzbl 0x38(%rsi), %ecx
leaq 0xfd7c(%rip), %rdx      # 0x2f180
movq (%rdx,%rcx,8), %rcx
movq (%rcx), %rdx
movl 0x8(%r13), %ecx
movq (%r13), %r8
movq 0x20(%rsi), %r9
xorl %ebx, %ebx
movl $0x74, %edi
movq %rax, %rsi
xorl %eax, %eax
callq 0x6f14
xorl %ebp, %ebp
movl 0xc(%r13), %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x1f4ce
leaq 0x677f(%rip), %rcx      # 0x25bc0
movslq (%rcx,%rdx,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %ecx, %ecx
jmp 0x1f458
movb $0x4, %cl
jmp 0x1f458
movb $0x1, %cl
jmp 0x1f458
movb $0x2, %cl
testb %r12b, %r12b
jne 0x1f4eb
movq (%r13), %rdx
movq 0x18(%r13), %r8
movl 0x14(%r13), %eax
movdqa 0x40(%rsp), %xmm0
pextrw $0x2, %xmm0, %esi
subq $0x8, %rsp
testb $0x1, %sil
je 0x1f4a4
movzbl %cl, %r10d
movzbl %bpl, %r9d
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
pushq %rax
pushq %r10
pushq $0x0
callq 0xacd9
addq $0x20, %rsp
jmp 0x1f4eb
movzbl %r15b, %r10d
movzbl %cl, %r11d
movzbl %bpl, %r9d
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
pushq $0x1
pushq %rax
pushq %r10
pushq %r11
pushq $0x0
callq 0xaad4
addq $0x30, %rsp
jmp 0x1f4eb
movq (%r13), %rcx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rax), %r8
movl $0x36, %edi
xorl %eax, %eax
callq 0x6f14
addq $0x20, %r13
decq %r14
movq 0x60(%rsp), %r12
jne 0x1f342
jmp 0x1f527
movq (%r13), %rdx
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rcx
movl 0x10(%r13), %r8d
xorl %ebx, %ebx
movl $0x35, %edi
xorl %eax, %eax
callq 0x6f14
jmp 0x1f3c2
testl %r12d, %r12d
je 0x1f536
movq 0x68(%rsp), %rdi
callq 0x5040
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl $0x1, %edx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbf8e