#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ entbuf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ cap_getent(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
char *s_dup(char *);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char const *, int);
char *strtok_r(char *, char *, char **);
char *cap_getstr(const char *path, const char *entname, const char *strname,
                 char *buf, int bufsize) {
  FILE *fp;
  char *cp, *tp;
  char *lcp, *ltp;
  static int rlev = 0;
  char *retval = NULL;
  char entbuf[2048];
  if (++rlev > 32)
    return NULL;
  fp = fopen(path, "r");
  if (fp == NULL)
    goto Exit;
  while (cap_getent(fp, entbuf, sizeof(entbuf)) > 0) {
    tp = strchr(entbuf, ':');
    *tp++ = '\0';
    cp = strtok_r(entbuf, "|", &lcp);
    while (cp) {
      if (strcmp(cp, entname) == 0) {
        tp = strtok_r(tp, ":", &ltp);
        while (tp) {
          if (strncmp(tp, strname, 2) == 0 && tp[2] == '=') {
            if (buf) {
              if (strlen(tp + 3) >= bufsize)
                return NULL;
              strcpy(buf, tp + 3);
              retval = buf;
            } else
              retval = s_dup(tp + 3);
            goto Exit;
          } else if (strncmp(tp, "tc=", 3) == 0) {
            retval = cap_getstr(path, tp + 3, strname, buf, bufsize);
            if (retval)
              goto Exit;
          }
          tp = strtok_r(NULL, ":", &ltp);
        }
        goto Exit;
      }
      cp = strtok_r(NULL, "|", &lcp);
    }
  }
Exit:
  --rlev;
  if (fp)
    fclose(fp);
  return retval;
}


x86 assembly (clang, -O0):
<cap_getstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
movq   $0x0,-0x60(%rbp)
mov    0x2e9f(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e96(%rip)
cmp    $0x20,%eax
jle    11fc <cap_getstr+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    1428 <cap_getstr+0x278>
mov    -0x10(%rbp),%rdi
lea    0xdf9(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1220 <cap_getstr+0x70>
jmp    13fd <cap_getstr+0x24d>
jmp    1225 <cap_getstr+0x75>
mov    -0x38(%rbp),%rdi
lea    -0x860(%rbp),%rsi
mov    $0x800,%edx
call   10c0 <cap_getent@plt>
cmp    $0x0,%rax
jle    13f8 <cap_getstr+0x248>
lea    -0x860(%rbp),%rdi
mov    $0x3a,%esi
call   1070 <strchr@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x48(%rbp)
movb   $0x0,(%rax)
lea    -0x860(%rbp),%rdi
lea    0xd89(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   10a0 <strtok_r@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     13f3 <cap_getstr+0x243>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    13d6 <cap_getstr+0x226>
mov    -0x48(%rbp),%rdi
lea    0xd51(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   10a0 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     13d1 <cap_getstr+0x221>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    135a <cap_getstr+0x1aa>
mov    -0x48(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x3d,%eax
jne    135a <cap_getstr+0x1aa>
cmpq   $0x0,-0x28(%rbp)
je     1344 <cap_getstr+0x194>
mov    -0x48(%rbp),%rdi
add    $0x3,%rdi
call   1060 <strlen@plt>
cmp    -0x2c(%rbp),%eax
jl     1326 <cap_getstr+0x176>
movq   $0x0,-0x8(%rbp)
jmp    1428 <cap_getstr+0x278>
mov    -0x28(%rbp),%rdi
mov    -0x48(%rbp),%rsi
add    $0x3,%rsi
call   1040 <strcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    1355 <cap_getstr+0x1a5>
mov    -0x48(%rbp),%rdi
add    $0x3,%rdi
call   1090 <s_dup@plt>
mov    %rax,-0x60(%rbp)
jmp    13fd <cap_getstr+0x24d>
mov    -0x48(%rbp),%rdi
lea    0xca1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13af <cap_getstr+0x1ff>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
add    $0x3,%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1080 <cap_getstr@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     13aa <cap_getstr+0x1fa>
jmp    13fd <cap_getstr+0x24d>
jmp    13af <cap_getstr+0x1ff>
jmp    13b4 <cap_getstr+0x204>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc45(%rip),%rsi
lea    -0x58(%rbp),%rdx
call   10a0 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
jmp    12c0 <cap_getstr+0x110>
jmp    13fd <cap_getstr+0x24d>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc21(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   10a0 <strtok_r@plt>
mov    %rax,-0x40(%rbp)
jmp    1286 <cap_getstr+0xd6>
jmp    1225 <cap_getstr+0x75>
jmp    13fd <cap_getstr+0x24d>
mov    0x2c79(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2c70(%rip)
cmpq   $0x0,-0x38(%rbp)
je     1420 <cap_getstr+0x270>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x60(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cap_getstr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    %rcx,%rbx
mov    0x2eb2(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ea9(%rip)
cmp    $0x1f,%eax
jle    11df <cap_getstr+0x2f>
xor    %eax,%eax
jmp    1396 <cap_getstr+0x1e6>
mov    %r8d,%r12d
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbp
lea    0xe0e(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     12b4 <cap_getstr+0x104>
mov    %rax,%r13
lea    0x30(%rsp),%rsi
mov    %rax,%rdi
mov    $0x800,%edx
call   10c0 <cap_getent@plt>
test   %rax,%rax
jle    137a <cap_getstr+0x1ca>
mov    %rbp,0x18(%rsp)
mov    %r12d,0xc(%rsp)
mov    %rbx,0x10(%rsp)
lea    0x30(%rsp),%rbp
lea    0xdc9(%rip),%r12
lea    0x28(%rsp),%rbx
xor    %eax,%eax
mov    %rax,(%rsp)
jmp    126e <cap_getstr+0xbe>
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
lea    0x30(%rsp),%rbp
mov    %rbp,%rsi
mov    $0x800,%edx
call   10c0 <cap_getent@plt>
test   %rax,%rax
jle    13d9 <cap_getstr+0x229>
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1070 <strchr@plt>
mov    %rbp,%rdi
mov    %rax,%rbp
movb   $0x0,(%rax)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rsi
mov    %rbx,%rdx
call   10a0 <strtok_r@plt>
test   %rax,%rax
je     1250 <cap_getstr+0xa0>
mov    %rax,%rdi
mov    %r14,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     12c2 <cap_getstr+0x112>
xor    %edi,%edi
jmp    1290 <cap_getstr+0xe0>
addl   $0xffffffff,0x2dc1(%rip)
xor    %eax,%eax
jmp    1396 <cap_getstr+0x1e6>
add    $0x1,%rbp
lea    0xd37(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rbp,%rdi
call   10a0 <strtok_r@plt>
test   %rax,%rax
je     137a <cap_getstr+0x1ca>
mov    %rax,%rbx
mov    %r13,%rbp
lea    0xd16(%rip),%r14
lea    0xd0d(%rip),%r12
xor    %eax,%eax
mov    %rax,(%rsp)
lea    0x20(%rsp),%r13
jmp    1325 <cap_getstr+0x175>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   10a0 <strtok_r@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1383 <cap_getstr+0x1d3>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1340 <cap_getstr+0x190>
cmpb   $0x3d,0x2(%rbx)
je     13a8 <cap_getstr+0x1f8>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1310 <cap_getstr+0x160>
add    $0x3,%rbx
mov    0x18(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    0x10(%rsp),%rcx
mov    0xc(%rsp),%r8d
call   1080 <cap_getstr@plt>
test   %rax,%rax
je     1310 <cap_getstr+0x160>
jmp    137f <cap_getstr+0x1cf>
mov    %r13,%rbp
xor    %eax,%eax
mov    %rax,(%rsp)
addl   $0xffffffff,0x2cf2(%rip)
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    (%rsp),%rax
add    $0x838,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x3,%rbx
mov    0x10(%rsp),%r14
test   %r14,%r14
je     13de <cap_getstr+0x22e>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    0xc(%rsp),%eax
jge    11d8 <cap_getstr+0x28>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r14,(%rsp)
jmp    1383 <cap_getstr+0x1d3>
mov    %r13,%rbp
jmp    1383 <cap_getstr+0x1d3>
mov    %rbx,%rdi
call   1090 <s_dup@plt>
jmp    137f <cap_getstr+0x1cf>

LLVM IR (-O0):
@cap_getstr.rlev = internal global i32 0
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [2 x i8] c":\00"
@.str.3 = [4 x i8] c"tc=\00"
define i8* @cap_getstr(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca [2048 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* null, i8** %17
%19 = load i32, i32* @cap_getstr.rlev
%20 = add nsw i32 %19, 1
store i32 %20, i32* @cap_getstr.rlev
%21 = icmp sgt i32 %20, 32
br i1 %21, label %22, label %23
22: ; preds = %5
store i8* null, i8** %6
br label %122
23: ; preds = %5
%24 = load i8*, i8** %7
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %25, i32** %12
%26 = load i32*, i32** %12
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %29
28: ; preds = %23
br label %112
29: ; preds = %23
br label %30
30: ; preds = %110, %29
%31 = load i32*, i32** %12
%32 = getelementptr inbounds [2048 x i8], [2048 x i8]* %18, i64 0, i64 0
%33 = call i64 @cap_getent(i32* %31, i8* %32, i32 2048)
%34 = icmp sgt i64 %33, 0
br i1 %34, label %35, label %111
35: ; preds = %30
%36 = getelementptr inbounds [2048 x i8], [2048 x i8]* %18, i64 0, i64 0
%37 = call i8* @strchr(i8* %36, i8 signext 58)
store i8* %37, i8** %14
%38 = load i8*, i8** %14
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %14
store i8 0, i8* %38
%40 = getelementptr inbounds [2048 x i8], [2048 x i8]* %18, i64 0, i64 0
%41 = call i8* @strtok_r(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %15)
store i8* %41, i8** %13
br label %42
42: ; preds = %108, %35
%43 = load i8*, i8** %13
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %110
45: ; preds = %42
%46 = load i8*, i8** %13
%47 = load i8*, i8** %8
%48 = call i64 @strcmp(i8* %46, i8* %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %108
50: ; preds = %45
%51 = load i8*, i8** %14
%52 = call i8* @strtok_r(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %16)
store i8* %52, i8** %14
br label %53
53: ; preds = %105, %50
%54 = load i8*, i8** %14
%55 = icmp ne i8* %54, null
br i1 %55, label %56, label %107
56: ; preds = %53
%57 = load i8*, i8** %14
%58 = load i8*, i8** %9
%59 = call i64 @strncmp(i8* %57, i8* %58, i32 2)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %88
61: ; preds = %56
%62 = load i8*, i8** %14
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 61
br i1 %66, label %67, label %88
67: ; preds = %61
%68 = load i8*, i8** %10
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %83
70: ; preds = %67
%71 = load i8*, i8** %14
%72 = getelementptr inbounds i8, i8* %71, i64 3
%73 = call i32 @strlen(i8* %72)
%74 = load i32, i32* %11
%75 = icmp sge i32 %73, %74
br i1 %75, label %76, label %77
76: ; preds = %70
store i8* null, i8** %6
br label %122
77: ; preds = %70
%78 = load i8*, i8** %10
%79 = load i8*, i8** %14
%80 = getelementptr inbounds i8, i8* %79, i64 3
%81 = call i32 @strcpy(i8* %78, i8* %80)
%82 = load i8*, i8** %10
store i8* %82, i8** %17
br label %87
83: ; preds = %67
%84 = load i8*, i8** %14
%85 = getelementptr inbounds i8, i8* %84, i64 3
%86 = call i8* @s_dup(i8* %85)
store i8* %86, i8** %17
br label %87
87: ; preds = %83, %77
br label %112
88: ; preds = %61, %56
%89 = load i8*, i8** %14
%90 = call i64 @strncmp(i8* %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %104
92: ; preds = %88
%93 = load i8*, i8** %7
%94 = load i8*, i8** %14
%95 = getelementptr inbounds i8, i8* %94, i64 3
%96 = load i8*, i8** %9
%97 = load i8*, i8** %10
%98 = load i32, i32* %11
%99 = call i8* @cap_getstr(i8* %93, i8* %95, i8* %96, i8* %97, i32 %98)
store i8* %99, i8** %17
%100 = load i8*, i8** %17
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %103
102: ; preds = %92
br label %112
103: ; preds = %92
br label %104
104: ; preds = %103, %88
br label %105
105: ; preds = %104
%106 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %16)
store i8* %106, i8** %14
br label %53
107: ; preds = %53
br label %112
108: ; preds = %45
%109 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %15)
store i8* %109, i8** %13
br label %42
110: ; preds = %42
br label %30
111: ; preds = %30
br label %112
112: ; preds = %111, %107, %102, %87, %28
%113 = load i32, i32* @cap_getstr.rlev
%114 = add nsw i32 %113, -1
store i32 %114, i32* @cap_getstr.rlev
%115 = load i32*, i32** %12
%116 = icmp ne i32* %115, null
br i1 %116, label %117, label %120
117: ; preds = %112
%118 = load i32*, i32** %12
%119 = call i32 @fclose(i32* %118)
br label %120
120: ; preds = %117, %112
%121 = load i8*, i8** %17
store i8* %121, i8** %6
br label %122
122: ; preds = %120, %76, %22
%123 = load i8*, i8** %6
ret i8* %123
}

LLVM IR (-O2):
@cap_getstr.rlev = internal unnamed_addr global i32 0
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"|\00"
@.str.2 = [2 x i8] c":\00"
@.str.3 = [4 x i8] c"tc=\00"
define i8* @cap_getstr(i8* nocapture %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [2048 x i8]
%9 = bitcast i8** %6 to i8*
%10 = bitcast i8** %7 to i8*
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 0
%12 = load i32, i32* @cap_getstr.rlev
%13 = add nsw i32 %12, 1
store i32 %13, i32* @cap_getstr.rlev
%14 = icmp sgt i32 %12, 31
br i1 %14, label %75, label %15
15: ; preds = %5
%16 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i64 @cap_getent(i32* %16, i8* %11, i32 2048)
%20 = icmp sgt i64 %19, 0
br i1 %20, label %27, label %70
21: ; preds = %15
%22 = load i32, i32* @cap_getstr.rlev
%23 = add nsw i32 %22, -1
store i32 %23, i32* @cap_getstr.rlev
br label %75
24: ; preds = %67, %27
%25 = call i64 @cap_getent(i32* %16, i8* %11, i32 2048)
%26 = icmp sgt i64 %25, 0
br i1 %26, label %27, label %70
27: ; preds = %18, %24
%28 = call i8* @strchr(i8* %11, i8 signext 58)
store i8 0, i8* %28
%29 = call i8* @strtok_r(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %6)
%30 = icmp eq i8* %29, null
br i1 %30, label %24, label %31
31: ; preds = %27, %67
%32 = phi i8* [ %68, %67 ], [ %29, %27 ]
%33 = call i64 @strcmp(i8* %32, i8* %1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %67
35: ; preds = %31
%36 = getelementptr inbounds i8, i8* %28, i64 1
%37 = call i8* @strtok_r(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7)
%38 = icmp eq i8* %37, null
br i1 %38, label %70, label %39
39: ; preds = %35, %64
%40 = phi i8* [ %65, %64 ], [ %37, %35 ]
%41 = call i64 @strncmp(i8* %40, i8* %2, i32 2)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %57
43: ; preds = %39
%44 = getelementptr inbounds i8, i8* %40, i64 2
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 61
br i1 %46, label %47, label %57
47: ; preds = %43
%48 = icmp eq i8* %3, null
%49 = getelementptr inbounds i8, i8* %40, i64 3
br i1 %48, label %55, label %50
50: ; preds = %47
%51 = call i32 @strlen(i8* %49)
%52 = icmp slt i32 %51, %4
br i1 %52, label %53, label %75
53: ; preds = %50
%54 = call i32 @strcpy(i8* %3, i8* %49)
br label %70
55: ; preds = %47
%56 = call i8* @s_dup(i8* %49)
br label %70
57: ; preds = %43, %39
%58 = call i64 @strncmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %57
%61 = getelementptr inbounds i8, i8* %40, i64 3
%62 = call i8* @cap_getstr(i8* %0, i8* %61, i8* %2, i8* %3, i32 %4)
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %70
64: ; preds = %57, %60
%65 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7)
%66 = icmp eq i8* %65, null
br i1 %66, label %70, label %39
67: ; preds = %31
%68 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %6)
%69 = icmp eq i8* %68, null
br i1 %69, label %24, label %31
70: ; preds = %24, %64, %60, %55, %53, %35, %18
%71 = phi i8* [ %3, %53 ], [ %56, %55 ], [ null, %35 ], [ null, %18 ], [ %62, %60 ], [ null, %64 ], [ null, %24 ]
%72 = load i32, i32* @cap_getstr.rlev
%73 = add nsw i32 %72, -1
store i32 %73, i32* @cap_getstr.rlev
%74 = call i32 @fclose(i32* %16)
br label %75
75: ; preds = %21, %70, %50, %5
%76 = phi i8* [ null, %5 ], [ null, %50 ], [ %71, %70 ], [ null, %21 ]
ret i8* %76
}