// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq $0x0, 0x8(%rsp)
testl %edi, %edi
je 0x2f05
leaq 0x13d8(%rip), %rbx      # 0x42d6
callq 0x2100
jmp 0x2f11
leaq 0x13be(%rip), %rbx      # 0x42ca
callq 0x21e0
leaq 0x132b(%rip), %rdi      # 0x4243
movl %eax, %esi
xorl %eax, %eax
callq 0x3612
movq %rax, 0x20(%rsp)
leaq 0x12c5(%rip), %rsi      # 0x41f2
movq %rbx, %rdi
callq 0x22b0
testq %rax, %rax
je 0x30aa
movq %rax, %rbx
callq 0x2100
movl %eax, %ebp
leaq 0x1393(%rip), %rdi      # 0x42e2
callq 0x2030
movq %rax, %r14
testq %rax, %rax
jne 0x2f6b
leaq 0x1384(%rip), %rdi      # 0x42e7
callq 0x2030
movq %rax, %r14
testq %r14, %r14
jne 0x2f78
callq 0x2230
movq %rax, %r14
testq %r14, %r14
je 0x2f8f
movq %r14, %rdi
callq 0x2190
testq %rax, %rax
je 0x2f8f
cmpl %ebp, 0x10(%rax)
je 0x2fa2
movl %ebp, %edi
callq 0x20d0
testq %rax, %rax
je 0x30be
movq (%rax), %r14
callq 0x2220
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rbx, %rdx
callq 0x22d0
testq %rax, %rax
js 0x3098
movl %ebp, %r13d
leaq 0x28(%rsp), %rbp
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x21d0
cmpq %r13, %rax
jne 0x2fef
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x3019
movq 0x8(%rsp), %r12
movq %r14, %rdi
callq 0x20e0
movq %rax, %r15
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2070
testl %eax, %eax
jne 0x307f
addq %r15, %r12
movq %r12, 0x10(%rsp)
movq 0x10(%rsp), %r12
movq %r12, %rdi
leaq 0x1326(%rip), %rsi      # 0x434e
leaq 0x18(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x30(%rsp), %r8
xorl %eax, %eax
callq 0x2210
cmpl $0x2, %eax
jl 0x307f
movq 0x30(%rsp), %rax
movsbl 0x1(%r12,%rax), %esi
movl $0x3, %edx
leaq 0x12b6(%rip), %rdi      # 0x4310
callq 0x2170
testq %rax, %rax
je 0x307f
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
leaq 0x20(%rsp), %rdi
leaq 0x129b(%rip), %rsi      # 0x4313
xorl %eax, %eax
callq 0x3434
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x22d0
testq %rax, %rax
jns 0x2fca
movq 0x8(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x20b0
movq 0x20(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x122a(%rip), %rsi      # 0x42ef
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110