#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 pid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sphFastGetPID();
int sphFastGetTID();
char *sphdeGetCmdLine();
int sphdeGetPID();
int sphdeGetTID();
scalar_t__ strcmp(char *, char const *);
int thread_basic_test(const char *argv0) {
  int rc = 0;
  pid_t pid, pid2, pid3;
  pid_t tid, tid2, tid3;
  char *cl;
  pid = sphdeGetPID();
  tid = sphdeGetTID();
  if ((pid != 0) && (tid != 0) && (pid == tid)) {
    printf("thread_basic_test PID=%d, TID=%d\n", pid, tid);
  } else {
    printf("thread_basic_test failed sphdeGetPID=%d, sphdeGetTID=%d\n", pid,
           tid);
    rc++;
  }
  cl = sphdeGetCmdLine();
  if ((cl != NULL) && (*cl != 0)) {
    printf("thread_basic_test sphdeGetCmdLine=%s\n", cl);
    if (0 != strcmp(cl, argv0)) {
      printf("thread_basic_test failed sphdeGetCmdLine=%s != ./sphthread_t\n",
             cl);
      rc++;
    }
  } else {
    printf("thread_basic_test failed sphdeGetCmdLine=%s\n", cl);
    rc++;
  }
  pid2 = sphdeGetPID();
  tid2 = sphdeGetTID();
  if ((pid2 != 0) && (tid2 != 0) && (pid2 == tid2)) {
    printf("thread_basic_test PID=%d, TID=%d\n", pid2, tid2);
    if ((pid != pid2) || (tid != tid2)) {
      printf("thread_basic_test failed PID %d != %d, TID %d != %d\n", pid, pid2,
             tid, tid2);
    }
  } else {
    printf("thread_basic_test failed sphdeGetPID=%d, sphdeGetTID=%d\n", pid2,
           tid2);
    rc++;
  }
  pid3 = sphFastGetPID();
  tid3 = sphFastGetTID();
  if ((pid3 != 0) && (tid3 != 0) && (pid3 == tid3)) {
    printf("thread_basic_test fast PID=%d, TID=%d\n", pid3, tid3);
    if ((pid != pid3) || (tid != tid3)) {
      printf("thread_basic_test fast failed PID %d != %d, TID %d != %d\n", pid,
             pid3, tid, tid3);
    }
  } else {
    printf("thread_basic_test failed sphFastGetPID=%d, sphFastGetTID=%d\n",
           pid3, tid3);
    rc++;
  }
  return rc;
}


x86 assembly (clang, -O0):
<thread_basic_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sphdeGetPID@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sphdeGetTID@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11d0 <thread_basic_test+0x60>
cmpl   $0x0,-0x1c(%rbp)
je     11d0 <thread_basic_test+0x60>
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11d0 <thread_basic_test+0x60>
mov    -0x10(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ed <thread_basic_test+0x7d>
mov    -0x10(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1090 <sphdeGetCmdLine@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1260 <thread_basic_test+0xf0>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1260 <thread_basic_test+0xf0>
mov    -0x30(%rbp),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     125b <thread_basic_test+0xeb>
mov    -0x30(%rbp),%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    127b <thread_basic_test+0x10b>
mov    -0x30(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sphdeGetPID@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <sphdeGetTID@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     12fb <thread_basic_test+0x18b>
cmpl   $0x0,-0x20(%rbp)
je     12fb <thread_basic_test+0x18b>
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    12fb <thread_basic_test+0x18b>
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    12db <thread_basic_test+0x16b>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
je     12f6 <thread_basic_test+0x186>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1318 <thread_basic_test+0x1a8>
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1070 <sphFastGetPID@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1080 <sphFastGetTID@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1398 <thread_basic_test+0x228>
cmpl   $0x0,-0x24(%rbp)
je     1398 <thread_basic_test+0x228>
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1398 <thread_basic_test+0x228>
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1378 <thread_basic_test+0x208>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1393 <thread_basic_test+0x223>
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13b5 <thread_basic_test+0x245>
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_basic_test>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <sphdeGetPID@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1040 <sphdeGetTID@plt>
mov    %eax,%r14d
test   %r12d,%r12d
je     11b6 <thread_basic_test+0x46>
test   %r14d,%r14d
je     11b6 <thread_basic_test+0x46>
cmp    %r14d,%r12d
jne    11b6 <thread_basic_test+0x46>
lea    0xe5b(%rip),%rdi
xor    %ebp,%ebp
mov    %r12d,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11cf <thread_basic_test+0x5f>
lea    0xe65(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
xor    %eax,%eax
call   1090 <sphdeGetCmdLine@plt>
mov    %rax,%rbx
test   %rax,%rax
je     120d <thread_basic_test+0x9d>
cmpb   $0x0,(%rbx)
je     120d <thread_basic_test+0x9d>
lea    0xe71(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1221 <thread_basic_test+0xb1>
lea    0xe76(%rip),%rdi
jmp    1214 <thread_basic_test+0xa4>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <sphdeGetPID@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <sphdeGetTID@plt>
test   %ebx,%ebx
je     1274 <thread_basic_test+0x104>
test   %eax,%eax
je     1274 <thread_basic_test+0x104>
cmp    %eax,%ebx
jne    1274 <thread_basic_test+0x104>
lea    0xdbc(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %ebx,%r12d
jne    1259 <thread_basic_test+0xe9>
cmp    %ebx,%r14d
je     1289 <thread_basic_test+0x119>
lea    0xe8c(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1289 <thread_basic_test+0x119>
lea    0xda7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1070 <sphFastGetPID@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <sphFastGetTID@plt>
test   %ebx,%ebx
je     12dc <thread_basic_test+0x16c>
test   %eax,%eax
je     12dc <thread_basic_test+0x16c>
cmp    %eax,%ebx
jne    12dc <thread_basic_test+0x16c>
lea    0xe75(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %ebx,%r12d
jne    12c1 <thread_basic_test+0x151>
cmp    %ebx,%r14d
je     12f1 <thread_basic_test+0x181>
lea    0xe80(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12f1 <thread_basic_test+0x181>
lea    0xe9f(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"thread_basic_test PID=%d, TID=%d\0A\00"
@.str.1 = [57 x i8] c"thread_basic_test failed sphdeGetPID=%d, sphdeGetTID=%d\0A\00"
@.str.2 = [38 x i8] c"thread_basic_test sphdeGetCmdLine=%s\0A\00"
@.str.3 = [62 x i8] c"thread_basic_test failed sphdeGetCmdLine=%s != ./sphthread_t\0A\00"
@.str.4 = [45 x i8] c"thread_basic_test failed sphdeGetCmdLine=%s\0A\00"
@.str.5 = [53 x i8] c"thread_basic_test failed PID %d != %d, TID %d != %d\0A\00"
@.str.6 = [39 x i8] c"thread_basic_test fast PID=%d, TID=%d\0A\00"
@.str.7 = [58 x i8] c"thread_basic_test fast failed PID %d != %d, TID %d != %d\0A\00"
@.str.8 = [61 x i8] c"thread_basic_test failed sphFastGetPID=%d, sphFastGetTID=%d\0A\00"
define i32 @thread_basic_test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%11 = call i32 (...) @sphdeGetPID()
store i32 %11, i32* %4
%12 = call i32 (...) @sphdeGetTID()
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %1
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %4
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* %4
%24 = load i32, i32* %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
br label %32
26: ; preds = %18, %15, %1
%27 = load i32, i32* %4
%28 = load i32, i32* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28)
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %26, %22
%33 = call i8* (...) @sphdeGetCmdLine()
store i8* %33, i8** %10
%34 = load i8*, i8** %10
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %54
36: ; preds = %32
%37 = load i8*, i8** %10
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %54
41: ; preds = %36
%42 = load i8*, i8** %10
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %10
%45 = load i8*, i8** %2
%46 = call i64 @strcmp(i8* %44, i8* %45)
%47 = icmp ne i64 0, %46
br i1 %47, label %48, label %53
48: ; preds = %41
%49 = load i8*, i8** %10
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), i8* %49)
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %53
53: ; preds = %48, %41
br label %59
54: ; preds = %36, %32
%55 = load i8*, i8** %10
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i8* %55)
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
br label %59
59: ; preds = %54, %53
%60 = call i32 (...) @sphdeGetPID()
store i32 %60, i32* %5
%61 = call i32 (...) @sphdeGetTID()
store i32 %61, i32* %8
%62 = load i32, i32* %5
%63 = icmp ne i32 %62, 0
br i1 %63, label %64, label %89
64: ; preds = %59
%65 = load i32, i32* %8
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %89
67: ; preds = %64
%68 = load i32, i32* %5
%69 = load i32, i32* %8
%70 = icmp eq i32 %68, %69
br i1 %70, label %71, label %89
71: ; preds = %67
%72 = load i32, i32* %5
%73 = load i32, i32* %8
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %72, i32 %73)
%75 = load i32, i32* %4
%76 = load i32, i32* %5
%77 = icmp ne i32 %75, %76
br i1 %77, label %82, label %78
78: ; preds = %71
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = icmp ne i32 %79, %80
br i1 %81, label %82, label %88
82: ; preds = %78, %71
%83 = load i32, i32* %4
%84 = load i32, i32* %5
%85 = load i32, i32* %7
%86 = load i32, i32* %8
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %83, i32 %84, i32 %85, i32 %86)
br label %88
88: ; preds = %82, %78
br label %95
89: ; preds = %67, %64, %59
%90 = load i32, i32* %5
%91 = load i32, i32* %8
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %90, i32 %91)
%93 = load i32, i32* %3
%94 = add nsw i32 %93, 1
store i32 %94, i32* %3
br label %95
95: ; preds = %89, %88
%96 = call i32 (...) @sphFastGetPID()
store i32 %96, i32* %6
%97 = call i32 (...) @sphFastGetTID()
store i32 %97, i32* %9
%98 = load i32, i32* %6
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %125
100: ; preds = %95
%101 = load i32, i32* %9
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %125
103: ; preds = %100
%104 = load i32, i32* %6
%105 = load i32, i32* %9
%106 = icmp eq i32 %104, %105
br i1 %106, label %107, label %125
107: ; preds = %103
%108 = load i32, i32* %6
%109 = load i32, i32* %9
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %108, i32 %109)
%111 = load i32, i32* %4
%112 = load i32, i32* %6
%113 = icmp ne i32 %111, %112
br i1 %113, label %118, label %114
114: ; preds = %107
%115 = load i32, i32* %7
%116 = load i32, i32* %9
%117 = icmp ne i32 %115, %116
br i1 %117, label %118, label %124
118: ; preds = %114, %107
%119 = load i32, i32* %4
%120 = load i32, i32* %6
%121 = load i32, i32* %7
%122 = load i32, i32* %9
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %119, i32 %120, i32 %121, i32 %122)
br label %124
124: ; preds = %118, %114
br label %131
125: ; preds = %103, %100, %95
%126 = load i32, i32* %6
%127 = load i32, i32* %9
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i32 %126, i32 %127)
%129 = load i32, i32* %3
%130 = add nsw i32 %129, 1
store i32 %130, i32* %3
br label %131
131: ; preds = %125, %124
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@.str = [34 x i8] c"thread_basic_test PID=%d, TID=%d\0A\00"
@.str.1 = [57 x i8] c"thread_basic_test failed sphdeGetPID=%d, sphdeGetTID=%d\0A\00"
@.str.2 = [38 x i8] c"thread_basic_test sphdeGetCmdLine=%s\0A\00"
@.str.3 = [62 x i8] c"thread_basic_test failed sphdeGetCmdLine=%s != ./sphthread_t\0A\00"
@.str.4 = [45 x i8] c"thread_basic_test failed sphdeGetCmdLine=%s\0A\00"
@.str.5 = [53 x i8] c"thread_basic_test failed PID %d != %d, TID %d != %d\0A\00"
@.str.6 = [39 x i8] c"thread_basic_test fast PID=%d, TID=%d\0A\00"
@.str.7 = [58 x i8] c"thread_basic_test fast failed PID %d != %d, TID %d != %d\0A\00"
@.str.8 = [61 x i8] c"thread_basic_test failed sphFastGetPID=%d, sphFastGetTID=%d\0A\00"
define i32 @thread_basic_test(i8* %0) {
%2 = tail call i32 (...) @sphdeGetPID()
%3 = tail call i32 (...) @sphdeGetTID()
%4 = icmp ne i32 %2, 0
%5 = icmp ne i32 %3, 0
%6 = select i1 %4, i1 %5, i1 false
%7 = icmp eq i32 %2, %3
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
br label %13
11: ; preds = %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %3)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ 0, %9 ], [ 1, %11 ]
%15 = tail call i8* (...) @sphdeGetCmdLine()
%16 = icmp eq i8* %15, null
br i1 %16, label %27, label %17
17: ; preds = %13
%18 = load i8, i8* %15
%19 = icmp eq i8 %18, 0
br i1 %19, label %27, label %20
20: ; preds = %17
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%22 = tail call i64 @strcmp(i8* %15, i8* %0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %20
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%26 = add nuw nsw i32 %14, 1
br label %30
27: ; preds = %17, %13
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%29 = add nuw nsw i32 %14, 1
br label %30
30: ; preds = %20, %24, %27
%31 = phi i32 [ %26, %24 ], [ %14, %20 ], [ %29, %27 ]
%32 = tail call i32 (...) @sphdeGetPID()
%33 = tail call i32 (...) @sphdeGetTID()
%34 = icmp ne i32 %32, 0
%35 = icmp ne i32 %33, 0
%36 = select i1 %34, i1 %35, i1 false
%37 = icmp eq i32 %32, %33
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %46
39: ; preds = %30
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %32)
%41 = icmp eq i32 %2, %32
%42 = icmp eq i32 %3, %32
%43 = select i1 %41, i1 %42, i1 false
br i1 %43, label %49, label %44
44: ; preds = %39
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %2, i32 %32, i32 %3, i32 %32)
br label %49
46: ; preds = %30
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %32, i32 %33)
%48 = add nuw nsw i32 %31, 1
br label %49
49: ; preds = %39, %44, %46
%50 = phi i32 [ %31, %44 ], [ %48, %46 ], [ %31, %39 ]
%51 = tail call i32 (...) @sphFastGetPID()
%52 = tail call i32 (...) @sphFastGetTID()
%53 = icmp ne i32 %51, 0
%54 = icmp ne i32 %52, 0
%55 = select i1 %53, i1 %54, i1 false
%56 = icmp eq i32 %51, %52
%57 = select i1 %55, i1 %56, i1 false
br i1 %57, label %58, label %65
58: ; preds = %49
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %51, i32 %51)
%60 = icmp eq i32 %2, %51
%61 = icmp eq i32 %3, %51
%62 = select i1 %60, i1 %61, i1 false
br i1 %62, label %68, label %63
63: ; preds = %58
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0), i32 %2, i32 %51, i32 %3, i32 %51)
br label %68
65: ; preds = %49
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.8, i64 0, i64 0), i32 %51, i32 %52)
%67 = add nuw nsw i32 %50, 1
br label %68
68: ; preds = %58, %63, %65
%69 = phi i32 [ %50, %63 ], [ %67, %65 ], [ %50, %58 ]
ret i32 %69
}