// File: /workspace/github_c_makefile_star2_O3/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 0x2f2c
leaq 0x13ae(%rip), %rbx      # 0x42d3
callq 0x2100
jmp 0x2f38
leaq 0x1394(%rip), %rbx      # 0x42c7
callq 0x21d0
leaq 0x1304(%rip), %rdi      # 0x4243
movl %eax, %esi
xorl %eax, %eax
callq 0x35be
movq %rax, %r14
movq %rax, 0x18(%rsp)
leaq 0x129b(%rip), %rsi      # 0x41f2
movq %rbx, %rdi
callq 0x22a0
testq %rax, %rax
je 0x30d8
movq %rax, %rbx
callq 0x2100
movl %eax, %ebp
leaq 0x1366(%rip), %rdi      # 0x42df
callq 0x2030
testq %rax, %rax
jne 0x2f9e
leaq 0x135a(%rip), %rdi      # 0x42e4
callq 0x2030
testq %rax, %rax
jne 0x2f9e
callq 0x2220
testq %rax, %rax
je 0x2fb3
movq %rax, %r14
movq %rax, %rdi
callq 0x2180
testq %rax, %rax
je 0x2fb3
cmpl %ebp, 0x10(%rax)
je 0x2fc6
movl %ebp, %edi
callq 0x20d0
testq %rax, %rax
je 0x30ea
movq (%rax), %r14
callq 0x2210
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rbx, %rdx
callq 0x22c0
testq %rax, %rax
js 0x30c1
movl %ebp, %r13d
leaq 0x28(%rsp), %rbp
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r13, %rax
setne %al
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %r12
cmpq %r15, %r12
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x3047
movq %r14, %rdi
callq 0x20e0
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2070
testl %eax, %eax
jne 0x30a8
addq %r12, %r15
movq %r15, 0x20(%rsp)
movq %r15, %r12
movq %r12, %rdi
leaq 0x12f7(%rip), %rsi      # 0x4348
leaq 0x10(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x30(%rsp), %r8
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jl 0x30a8
movq 0x30(%rsp), %rax
movzbl 0x1(%r12,%rax), %eax
cmpq $0x3a, %rax
ja 0x30a8
movabsq $0x400000000000401, %rcx # imm = 0x400000000000401
btq %rax, %rcx
jae 0x30a8
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
leaq 0x18(%rsp), %rdi
leaq 0x126c(%rip), %rsi      # 0x430d
xorl %eax, %eax
callq 0x33e0
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x22c0
testq %rax, %rax
jns 0x2fee
movq 0x8(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x20b0
movq 0x18(%rsp), %r14
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11fb(%rip), %rsi      # 0x42ec
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110