#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 */

/* Variables and functions */
int /*<<< orphan*/ kapi_Error_pch1(int, int /*<<< orphan*/, char *, char *);
scalar_t__ strchr(char *, char);
char *strtok(char *, char *);
void ParseInterCluster(char *pch_in, char **ppchClrSrc, char **ppchFcSrc,
                       char **ppchOppSrc, char **ppchCportSrc,
                       char **ppchClrDest, char **ppchFcDest,
                       char **ppchOppDest, char **ppchCportDest,
                       char **ppchValue) {
  char *pchSrc, *pchDest, *pchVal;
  pchVal = (char *)strchr(pch_in, '=');
  if (pchVal == NULL) {
    kapi_Error_pch1(-1, 0, "Malformed intercluster bypass '%s' -- '=' required",
                    pch_in);
    return;
  }
  *pchVal = '\0';
  *ppchValue = pchVal + 1;
  pchDest = (char *)strchr(pch_in, ':');
  if (pchDest == NULL) {
    kapi_Error_pch1(-1, 0, "Malformed intercluster bypass '%s' -- ':' required",
                    pch_in);
    return;
  }
  *pchDest = '\0';
  pchDest = pchDest + 1;
  pchSrc = pch_in;
  *ppchClrSrc = NULL;
  *ppchFcSrc = NULL;
  *ppchOppSrc = NULL;
  *ppchCportSrc = NULL;
  *ppchClrDest = NULL;
  *ppchFcDest = NULL;
  *ppchOppDest = NULL;
  *ppchCportDest = NULL;
  *ppchClrSrc = strtok(pchSrc, " /");
  if (*ppchClrSrc) {
    *ppchFcSrc = strtok(NULL, " /");
    if (*ppchFcSrc) {
      *ppchOppSrc = strtok(NULL, " /");
      if (*ppchOppSrc) {
        *ppchCportSrc = strtok(NULL, " /");
      }
    }
  }
  *ppchClrDest = strtok(pchDest, " /");
  if (*ppchClrDest) {
    *ppchFcDest = strtok(NULL, " /");
    if (*ppchFcDest) {
      *ppchOppDest = strtok(NULL, " /");
      if (*ppchOppDest) {
        *ppchCportDest = strtok(NULL, " /");
      }
    }
  }
}


x86 assembly (clang, -O0):
<ParseInterCluster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1199 <ParseInterCluster+0x69>
mov    -0x8(%rbp),%rcx
mov    $0xffffffff,%edi
xor    %esi,%esi
lea    0xe71(%rip),%rdx
call   1040 <kapi_Error_pch1@plt>
jmp    1393 <ParseInterCluster+0x263>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rcx
add    $0x1,%rcx
mov    0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11e8 <ParseInterCluster+0xb8>
mov    -0x8(%rbp),%rcx
mov    $0xffffffff,%edi
xor    %esi,%esi
lea    0xe55(%rip),%rdx
call   1040 <kapi_Error_pch1@plt>
jmp    1393 <ParseInterCluster+0x263>
mov    -0x40(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x30(%rbp),%rax
movq   $0x0,(%rax)
mov    0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x38(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     12f7 <ParseInterCluster+0x1c7>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdd8(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     12f2 <ParseInterCluster+0x1c2>
xor    %eax,%eax
mov    %eax,%edi
lea    0xdb0(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     12ed <ParseInterCluster+0x1bd>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd88(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    12f2 <ParseInterCluster+0x1c2>
jmp    12f7 <ParseInterCluster+0x1c7>
mov    -0x40(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
je     1393 <ParseInterCluster+0x263>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd3c(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     138e <ParseInterCluster+0x25e>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd14(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1389 <ParseInterCluster+0x259>
xor    %eax,%eax
mov    %eax,%edi
lea    0xcec(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,%rcx
mov    0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    138e <ParseInterCluster+0x25e>
jmp    1393 <ParseInterCluster+0x263>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseInterCluster>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r15
mov    %r8,0x8(%rsp)
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%rbp
mov    0x78(%rsp),%rbx
mov    0x70(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x68(%rsp),%rax
mov    %rax,0x18(%rsp)
mov    0x60(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     12cd <ParseInterCluster+0x19d>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %rbp,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     12d6 <ParseInterCluster+0x1a6>
mov    %rax,%rbx
movb   $0x0,(%rax)
add    $0x1,%rbx
movq   $0x0,(%r14)
movq   $0x0,0x0(%r13)
movq   $0x0,(%r12)
mov    0x8(%rsp),%rax
movq   $0x0,(%rax)
movq   $0x0,(%r15)
mov    0x20(%rsp),%rax
movq   $0x0,(%rax)
mov    0x18(%rsp),%rax
movq   $0x0,(%rax)
mov    0x10(%rsp),%rax
movq   $0x0,(%rax)
lea    0xe5f(%rip),%rsi
mov    %rbp,%rdi
call   1050 <strtok@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     125b <ParseInterCluster+0x12b>
lea    0xe48(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    %rax,0x0(%r13)
test   %rax,%rax
je     125b <ParseInterCluster+0x12b>
lea    0xe31(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    %rax,(%r12)
test   %rax,%rax
je     125b <ParseInterCluster+0x12b>
lea    0xe1a(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx)
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strtok@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     12be <ParseInterCluster+0x18e>
lea    0xded(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    0x20(%rsp),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     12be <ParseInterCluster+0x18e>
lea    0xdd2(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    0x18(%rsp),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     12be <ParseInterCluster+0x18e>
lea    0xdb7(%rip),%rsi
xor    %edi,%edi
call   1050 <strtok@plt>
mov    0x10(%rsp),%rcx
mov    %rax,(%rcx)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd2c(%rip),%rdx
jmp    12dd <ParseInterCluster+0x1ad>
lea    0xd56(%rip),%rdx
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    %rbp,%rcx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <kapi_Error_pch1@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Malformed intercluster bypass '%s' -- '=' required\00"
@.str.1 = [51 x i8] c"Malformed intercluster bypass '%s' -- ':' required\00"
@.str.2 = [3 x i8] c" /\00"
define void @ParseInterCluster(i8* %0, i8** %1, i8** %2, i8** %3, i8** %4, i8** %5, i8** %6, i8** %7, i8** %8, i8** %9) {
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca i8**
%16 = alloca i8**
%17 = alloca i8**
%18 = alloca i8**
%19 = alloca i8**
%20 = alloca i8**
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
store i8* %0, i8** %11
store i8** %1, i8*** %12
store i8** %2, i8*** %13
store i8** %3, i8*** %14
store i8** %4, i8*** %15
store i8** %5, i8*** %16
store i8** %6, i8*** %17
store i8** %7, i8*** %18
store i8** %8, i8*** %19
store i8** %9, i8*** %20
%24 = load i8*, i8** %11
%25 = call i64 @strchr(i8* %24, i8 signext 61)
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %23
%27 = load i8*, i8** %23
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %32
29: ; preds = %10
%30 = load i8*, i8** %11
%31 = call i32 @kapi_Error_pch1(i32 -1, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %30)
br label %105
32: ; preds = %10
%33 = load i8*, i8** %23
store i8 0, i8* %33
%34 = load i8*, i8** %23
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = load i8**, i8*** %20
store i8* %35, i8** %36
%37 = load i8*, i8** %11
%38 = call i64 @strchr(i8* %37, i8 signext 58)
%39 = inttoptr i64 %38 to i8*
store i8* %39, i8** %22
%40 = load i8*, i8** %22
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %45
42: ; preds = %32
%43 = load i8*, i8** %11
%44 = call i32 @kapi_Error_pch1(i32 -1, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %43)
br label %105
45: ; preds = %32
%46 = load i8*, i8** %22
store i8 0, i8* %46
%47 = load i8*, i8** %22
%48 = getelementptr inbounds i8, i8* %47, i64 1
store i8* %48, i8** %22
%49 = load i8*, i8** %11
store i8* %49, i8** %21
%50 = load i8**, i8*** %12
store i8* null, i8** %50
%51 = load i8**, i8*** %13
store i8* null, i8** %51
%52 = load i8**, i8*** %14
store i8* null, i8** %52
%53 = load i8**, i8*** %15
store i8* null, i8** %53
%54 = load i8**, i8*** %16
store i8* null, i8** %54
%55 = load i8**, i8*** %17
store i8* null, i8** %55
%56 = load i8**, i8*** %18
store i8* null, i8** %56
%57 = load i8**, i8*** %19
store i8* null, i8** %57
%58 = load i8*, i8** %21
%59 = call i8* @strtok(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%60 = load i8**, i8*** %12
store i8* %59, i8** %60
%61 = load i8**, i8*** %12
%62 = load i8*, i8** %61
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %81
64: ; preds = %45
%65 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%66 = load i8**, i8*** %13
store i8* %65, i8** %66
%67 = load i8**, i8*** %13
%68 = load i8*, i8** %67
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %80
70: ; preds = %64
%71 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%72 = load i8**, i8*** %14
store i8* %71, i8** %72
%73 = load i8**, i8*** %14
%74 = load i8*, i8** %73
%75 = icmp ne i8* %74, null
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%78 = load i8**, i8*** %15
store i8* %77, i8** %78
br label %79
79: ; preds = %76, %70
br label %80
80: ; preds = %79, %64
br label %81
81: ; preds = %80, %45
%82 = load i8*, i8** %22
%83 = call i8* @strtok(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%84 = load i8**, i8*** %16
store i8* %83, i8** %84
%85 = load i8**, i8*** %16
%86 = load i8*, i8** %85
%87 = icmp ne i8* %86, null
br i1 %87, label %88, label %105
88: ; preds = %81
%89 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%90 = load i8**, i8*** %17
store i8* %89, i8** %90
%91 = load i8**, i8*** %17
%92 = load i8*, i8** %91
%93 = icmp ne i8* %92, null
br i1 %93, label %94, label %104
94: ; preds = %88
%95 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%96 = load i8**, i8*** %18
store i8* %95, i8** %96
%97 = load i8**, i8*** %18
%98 = load i8*, i8** %97
%99 = icmp ne i8* %98, null
br i1 %99, label %100, label %103
100: ; preds = %94
%101 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%102 = load i8**, i8*** %19
store i8* %101, i8** %102
br label %103
103: ; preds = %100, %94
br label %104
104: ; preds = %103, %88
br label %105
105: ; preds = %29, %42, %104, %81
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Malformed intercluster bypass '%s' -- '=' required\00"
@.str.1 = [51 x i8] c"Malformed intercluster bypass '%s' -- ':' required\00"
@.str.2 = [3 x i8] c" /\00"
define void @ParseInterCluster(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3, i8** nocapture writeonly %4, i8** nocapture writeonly %5, i8** nocapture writeonly %6, i8** nocapture writeonly %7, i8** nocapture writeonly %8, i8** nocapture writeonly %9) {
%11 = tail call i64 @strchr(i8* %0, i8 signext 61)
%12 = inttoptr i64 %11 to i8*
%13 = icmp eq i64 %11, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 @kapi_Error_pch1(i32 -1, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %46
16: ; preds = %10
store i8 0, i8* %12
%17 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %17, i8** %9
%18 = tail call i64 @strchr(i8* %0, i8 signext 58)
%19 = inttoptr i64 %18 to i8*
%20 = icmp eq i64 %18, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = tail call i32 @kapi_Error_pch1(i32 -1, i32 0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %46
23: ; preds = %16
store i8 0, i8* %19
%24 = getelementptr inbounds i8, i8* %19, i64 1
store i8* null, i8** %1
store i8* null, i8** %2
store i8* null, i8** %3
store i8* null, i8** %4
store i8* null, i8** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i8* null, i8** %8
%25 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %25, i8** %1
%26 = icmp eq i8* %25, null
br i1 %26, label %35, label %27
27: ; preds = %23
%28 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %28, i8** %2
%29 = icmp eq i8* %28, null
br i1 %29, label %35, label %30
30: ; preds = %27
%31 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %31, i8** %3
%32 = icmp eq i8* %31, null
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %34, i8** %4
br label %35
35: ; preds = %27, %33, %30, %23
%36 = tail call i8* @strtok(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %36, i8** %5
%37 = icmp eq i8* %36, null
br i1 %37, label %46, label %38
38: ; preds = %35
%39 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %39, i8** %6
%40 = icmp eq i8* %39, null
br i1 %40, label %46, label %41
41: ; preds = %38
%42 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %42, i8** %7
%43 = icmp eq i8* %42, null
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %45, i8** %8
br label %46
46: ; preds = %35, %41, %44, %38, %21, %14
ret void
}