// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
testl %edi, %edi
je 0x2dfd
leaq 0x14dd(%rip), %rbx      # 0x42d3
callq 0x2100
jmp 0x2e09
leaq 0x14c3(%rip), %rbx      # 0x42c7
callq 0x21d0
leaq 0x1433(%rip), %rdi      # 0x4243
movl %eax, %esi
xorl %eax, %eax
callq 0x342b
movq %rax, %r14
movq %rax, 0x18(%rsp)
leaq 0x13ca(%rip), %rsi      # 0x41f2
movq %rbx, %rdi
callq 0x22a0
testq %rax, %rax
je 0x2f98
movq %rax, %rbx
callq 0x2100
movl %eax, %ebp
leaq 0x1495(%rip), %rdi      # 0x42df
callq 0x2030
testq %rax, %rax
jne 0x2e6f
leaq 0x1489(%rip), %rdi      # 0x42e4
callq 0x2030
testq %rax, %rax
jne 0x2e6f
callq 0x2220
testq %rax, %rax
je 0x2e84
movq %rax, %r14
movq %rax, %rdi
callq 0x2180
testq %rax, %rax
je 0x2e84
cmpl %ebp, 0x10(%rax)
je 0x2e97
movl %ebp, %edi
callq 0x20d0
testq %rax, %rax
je 0x2faa
movq (%rax), %r14
callq 0x2210
movl %ebp, %r15d
leaq 0x30(%rsp), %r12
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x22c0
movq 0x8(%rsp), %rdi
testq %rax, %rax
js 0x2f86
leaq 0x20(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x21c0
cmpq %r15, %rax
setne %al
movq 0x8(%rsp), %rbp
movq 0x20(%rsp), %r13
cmpq %rbp, %r13
sete %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2f14
movq %r14, %rdi
callq 0x20e0
movq %rax, %r13
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2070
testl %eax, %eax
jne 0x2ea4
addq %r13, %rbp
movq %rbp, 0x20(%rsp)
movq %rbp, %r13
movq %r13, %rdi
leaq 0x142a(%rip), %rsi      # 0x4348
leaq 0x10(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x28(%rsp), %r8
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jl 0x2ea4
movq 0x28(%rsp), %rax
movzbl 0x1(%r13,%rax), %eax
cmpq $0x3a, %rax
ja 0x2ea4
movabsq $0x400000000000401, %rcx # imm = 0x400000000000401
btq %rax, %rcx
jae 0x2ea4
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
leaq 0x18(%rsp), %rdi
leaq 0x1393(%rip), %rsi      # 0x430d
xorl %eax, %eax
callq 0x3258
jmp 0x2ea4
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 0x133b(%rip), %rsi      # 0x42ec
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110