// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/linker.c
// Function: linker_mapfile
void linker_mapfile(struct GlobalVars *gv)
/* print section mapping, when desired */
{
  if (gv->map_file) {
    struct ObjectUnit *obj;
    struct Section *sec;
    struct LinkedSection *ls;

    /* print file names and the new addresses of their sections */
    fprintf(gv->map_file,"\nFiles:\n");

    for (obj=(struct ObjectUnit *)gv->selobjects.first;
         obj->n.next!=NULL; obj=(struct ObjectUnit *)obj->n.next) {
      struct LinkFile *lfile = obj->lnkfile;
      char sep = ' ';

      if (!(obj->flags & OUF_SCRIPT)) {
        if (lfile->type == ID_LIBARCH)
          fprintf(gv->map_file,"  %s (%s):",lfile->pathname,obj->objname);
        else
          fprintf(gv->map_file,"  %s:",obj->objname);

        if (lfile->type != ID_SHAREDOBJ) {
          for (ls=(struct LinkedSection *)gv->lnksec.first;
               ls->n.next!=NULL; ls=(struct LinkedSection *)ls->n.next) {
            for (sec=(struct Section *)ls->sections.first;
                 sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
              if (sec->obj == obj) {  /* section came from this object? */
                if (strcmp(sec->name,gv->common_sec_name) &&
                    strcmp(sec->name,gv->scommon_sec_name)) {
                  fprintf(gv->map_file,"%c %s %lx(%lx)",sep,sec->name,
                          sec->va,sec->size);
                  sep = ',';
                }
              }
            }
          }
        }

        if (sep == ',')  /* any sections listed? */
          fprintf(gv->map_file," hex\n");
        else
          fprintf(gv->map_file,"  symbols only\n"); /* empty or shared obj. */
      }
    }

    /* print section mappings */
    fprintf(gv->map_file,"\n\nSection mapping (numbers in hex):\n");

    for (ls=(struct LinkedSection *)gv->lnksec.first;
         ls->n.next!=NULL; ls=(struct LinkedSection *)ls->n.next) {
      if (!(ls->size==0 && listempty(&ls->relocs) &&
            listempty(&ls->symbols) && !(ls->ld_flags & LSF_PRESERVE))) {
        fprintf(gv->map_file,"------------------------------\n"
                "  %08lx %s  (size %lx",ls->copybase,ls->name,ls->size);
        if (ls->filesize < ls->size)
          fprintf(gv->map_file,", allocated %lx",ls->filesize);
        fprintf(gv->map_file,")\n");
  
        for (sec=(struct Section *)ls->sections.first;
             sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
          if (sec->obj!=NULL && !is_ld_script(sec->obj)) {
            fprintf(gv->map_file,"           %08lx - %08lx %s(%s)\n",
                    sec->va,sec->va+sec->size,sec->obj->objname,sec->name);
          }
        }
      }
    }
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x90(%rax)
je 0xcd14
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
leaq 0x28930(%rip), %rsi     # 0x3527f
movb $0x0, %al
callq 0x5150
movq 0x30(%rsp), %rax
movq 0x138(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
je 0xcb60
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movb $0x20, 0xf(%rsp)
movq 0x28(%rsp), %rax
movzwl 0x80(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
jne 0xcb4c
movq 0x10(%rsp), %rax
movzbl 0x39(%rax), %eax
cmpl $0x8, %eax
jne 0xc9df
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdx
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
leaq 0x288b2(%rip), %rsi     # 0x35288
movb $0x0, %al
callq 0x5150
jmp 0xca02
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x28898(%rip), %rsi     # 0x35293
movb $0x0, %al
callq 0x5150
movq 0x10(%rsp), %rax
movzbl 0x39(%rax), %eax
cmpl $0x4, %eax
je 0xcb0a
movq 0x30(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0xcb08
movq 0x18(%rsp), %rax
movq 0x60(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0xcaf4
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
cmpq 0x28(%rsp), %rax
jne 0xcae0
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x220(%rax), %rsi
callq 0x5130
cmpl $0x0, %eax
je 0xcade
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x228(%rax), %rsi
callq 0x5130
cmpl $0x0, %eax
je 0xcade
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movsbl 0xf(%rsp), %edx
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x20(%rsp), %rax
movq 0x30(%rax), %r8
movq 0x20(%rsp), %rax
movq 0x48(%rax), %r9
leaq 0x287c7(%rip), %rsi     # 0x35299
movb $0x0, %al
callq 0x5150
movb $0x2c, 0xf(%rsp)
jmp 0xcae0
jmp 0xcae2
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0xca42
jmp 0xcaf6
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xca25
jmp 0xcb0a
movsbl 0xf(%rsp), %eax
cmpl $0x2c, %eax
jne 0xcb30
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
leaq 0x28a39(%rip), %rsi     # 0x35560
movb $0x0, %al
callq 0x5150
jmp 0xcb4a
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
leaq 0x28765(%rip), %rsi     # 0x352a8
movb $0x0, %al
callq 0x5150
jmp 0xcb4c
jmp 0xcb4e
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0xc967
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
leaq 0x28745(%rip), %rsi     # 0x352b8
movb $0x0, %al
callq 0x5150
movq 0x30(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0xcd12
movq 0x18(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jne 0xcbdf
movq 0x18(%rsp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, (%rax)
jne 0xcbdf
movq 0x18(%rsp), %rax
movq 0xb0(%rax), %rax
cmpq $0x0, (%rax)
jne 0xcbdf
movq 0x18(%rsp), %rax
movzwl 0x24(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xccfe
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rdx
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rsp), %rax
movq 0x48(%rax), %r8
leaq 0x286d0(%rip), %rsi     # 0x352dd
movb $0x0, %al
callq 0x5150
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rax
movq 0x18(%rsp), %rcx
cmpq 0x48(%rcx), %rax
jae 0xcc4b
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x18(%rsp), %rax
movq 0x50(%rax), %rdx
leaq 0x286ce(%rip), %rsi     # 0x35312
movb $0x0, %al
callq 0x5150
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
leaq 0x2664c(%rip), %rsi     # 0x332aa
movb $0x0, %al
callq 0x5150
movq 0x18(%rsp), %rax
movq 0x60(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0xccfc
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0xcce8
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x14a60
cmpl $0x0, %eax
jne 0xcce8
movq 0x30(%rsp), %rax
movq 0x90(%rax), %rdi
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x20(%rsp), %rax
addq 0x48(%rax), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %r8
movq 0x20(%rsp), %rax
movq 0x20(%rax), %r9
leaq 0x28641(%rip), %rsi     # 0x35322
movb $0x0, %al
callq 0x5150
jmp 0xccea
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0xcc73
jmp 0xccfe
jmp 0xcd00
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xcb8b
jmp 0xcd14
addq $0x38, %rsp
retq
nopl (%rax)