// File: /workspace/github_c_makefile_star2_O0/arachsys[P]containers/map.c
// Function: readranges
static char *readranges(int type) {
  char *line = NULL, *entry, *range, *user;
  size_t end, size;
  struct passwd *passwd;
  uid_t uid;
  unsigned int length, start;
  FILE *file;

  range = string("%u:1", getid(type));
  if (!(file = fopen(subpath(type), "r")))
    return range;

  uid = getuid();
  user = getenv("USER");
  user = user ? user : getenv("LOGNAME");
  user = user ? user : getlogin();
  if (!user || !(passwd = getpwnam(user)) || passwd->pw_uid != uid) {
    if (!(passwd = getpwuid(uid)))
      errx(EXIT_FAILURE, "Failed to validate your username");
    user = passwd->pw_name;
  }
  endpwent();

  while (getline(&line, &size, file) >= 0) {
    if (strtol(line, &entry, 10) != uid || entry == line) {
      if (strncmp(line, user, strlen(user)))
        continue;
      entry = line + strlen(user);
    }
    if (sscanf(entry, ":%u:%u%zn", &start, &length, &end) < 2)
      continue;
    if (strchr(":\n", entry[end + 1]))
      append(&range, ",%u:%u", start, length);
  }

  free(line);
  fclose(file);
  return range;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2ff6
callq 0x21e0
movl %eax, -0x64(%rbp)
jmp 0x2ffe
callq 0x2100
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %esi
leaq 0x123b(%rip), %rdi      # 0x4243
movb $0x0, %al
callq 0x3900
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %ecx
leaq 0x12b9(%rip), %rdi      # 0x42d6
leaq 0x12a6(%rip), %rax      # 0x42ca
cmpl $0x0, %ecx
cmoveq %rax, %rdi
leaq 0x11c0(%rip), %rsi      # 0x41f2
callq 0x22b0
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
jne 0x304e
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3224
callq 0x2100
movl %eax, -0x4c(%rbp)
leaq 0x1285(%rip), %rdi      # 0x42e2
callq 0x2030
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3077
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x3087
leaq 0x1269(%rip), %rdi      # 0x42e7
callq 0x2030
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x30a0
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x30a9
callq 0x2230
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x30d7
movq -0x30(%rbp), %rdi
callq 0x2190
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x30d7
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x4c(%rbp), %eax
je 0x3107
movl -0x4c(%rbp), %edi
callq 0x20d0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0x30fc
movl $0x1, %edi
leaq 0x11fa(%rip), %rsi      # 0x42ef
movb $0x0, %al
callq 0x2110
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x2220
movq -0x60(%rbp), %rdx
leaq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x22d0
cmpq $0x0, %rax
jl 0x320a
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0xa, %edx
callq 0x21d0
movl -0x4c(%rbp), %ecx
cmpq %rcx, %rax
jne 0x314b
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x31a6
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rdi
callq 0x20e0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0x2070
cmpl $0x0, %eax
je 0x3181
jmp 0x310c
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rdi
callq 0x20e0
movq %rax, %rcx
movq -0x90(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x119d(%rip), %rsi      # 0x434e
leaq -0x54(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x38(%rbp), %r8
movb $0x0, %al
callq 0x2210
cmpl $0x2, %eax
jge 0x31ce
jmp 0x310c
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movsbl 0x1(%rax,%rcx), %esi
leaq 0x112e(%rip), %rdi      # 0x4310
callq 0x2120
cmpq $0x0, %rax
je 0x3205
movl -0x54(%rbp), %edx
movl -0x50(%rbp), %ecx
leaq -0x28(%rbp), %rdi
leaq 0x1115(%rip), %rsi      # 0x4313
movb $0x0, %al
callq 0x3680
jmp 0x310c
movq -0x18(%rbp), %rdi
callq 0x2040
movq -0x60(%rbp), %rdi
callq 0x20b0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)