struct Person **PersonTreeFindParent(pointer, child, CompFunc)
struct Person **pointer;
struct Person **child;
int (*CompFunc)();
{
  switch ((*CompFunc)(child, pointer)) {
  case -1:
    if (AccessPersonPersonTreeLSon(pointer) == child)
      return (pointer);
    else
      return (PersonTreeFindParent(AccessPersonPersonTreeLSon(pointer), child,
                                   CompFunc));
  case 1:
    if (AccessPersonPersonTreeRSon(pointer) == child)
      return (pointer);
    else
      return (PersonTreeFindParent(AccessPersonPersonTreeRSon(pointer), child,
                                   CompFunc));
  }
}


x86 assembly (clang, -O0):
<PersonTreeFindParent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
call   *%rcx
mov    %eax,%ecx
mov    %ecx,-0x24(%rbp)
sub    $0xffffffff,%eax
je     1178 <PersonTreeFindParent+0x48>
jmp    1167 <PersonTreeFindParent+0x37>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
je     11c0 <PersonTreeFindParent+0x90>
jmp    1203 <PersonTreeFindParent+0xd3>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <AccessPersonPersonTreeLSon@plt>
cltq
cmp    -0x18(%rbp),%rax
jne    119c <PersonTreeFindParent+0x6c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1203 <PersonTreeFindParent+0xd3>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <AccessPersonPersonTreeLSon@plt>
movslq %eax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <PersonTreeFindParent@plt>
mov    %rax,-0x8(%rbp)
jmp    1203 <PersonTreeFindParent+0xd3>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <AccessPersonPersonTreeRSon@plt>
cltq
cmp    -0x18(%rbp),%rax
jne    11e4 <PersonTreeFindParent+0xb4>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1203 <PersonTreeFindParent+0xd3>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <AccessPersonPersonTreeRSon@plt>
movslq %eax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <PersonTreeFindParent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PersonTreeFindParent>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   *%r14
cmp    $0x1,%eax
je     1170 <PersonTreeFindParent+0x50>
cmp    $0xffffffff,%eax
jne    1190 <PersonTreeFindParent+0x70>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <AccessPersonPersonTreeLSon@plt>
cltq
cmp    %r15,%rax
je     1190 <PersonTreeFindParent+0x70>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <AccessPersonPersonTreeLSon@plt>
movslq %eax,%rbx
jmp    1130 <PersonTreeFindParent+0x10>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <AccessPersonPersonTreeRSon@plt>
cltq
cmp    %r15,%rax
je     1190 <PersonTreeFindParent+0x70>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <AccessPersonPersonTreeRSon@plt>
movslq %eax,%rbx
jmp    1130 <PersonTreeFindParent+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Person = type opaque
define %struct.Person** @PersonTreeFindParent(%struct.Person** %0, %struct.Person** %1, i32 (...)* %2) {
%4 = alloca %struct.Person**
%5 = alloca %struct.Person**
%6 = alloca %struct.Person**
%7 = alloca i32 (...)*
store %struct.Person** %0, %struct.Person*** %5
store %struct.Person** %1, %struct.Person*** %6
store i32 (...)* %2, i32 (...)** %7
%8 = load i32 (...)*, i32 (...)** %7
%9 = load %struct.Person**, %struct.Person*** %6
%10 = load %struct.Person**, %struct.Person*** %5
%11 = bitcast i32 (...)* %8 to i32 (%struct.Person**, %struct.Person**, ...)*
%12 = call i32 (%struct.Person**, %struct.Person**, ...) %11(%struct.Person** %9, %struct.Person** %10)
switch i32 %12, label %47 [
i32 -1, label %13
i32 1, label %30
]
13: ; preds = %3
%14 = load %struct.Person**, %struct.Person*** %5
%15 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeLSon to i32 (%struct.Person**, ...)*)(%struct.Person** %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to %struct.Person**
%18 = load %struct.Person**, %struct.Person*** %6
%19 = icmp eq %struct.Person** %17, %18
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = load %struct.Person**, %struct.Person*** %5
store %struct.Person** %21, %struct.Person*** %4
br label %47
22: ; preds = %13
%23 = load %struct.Person**, %struct.Person*** %5
%24 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeLSon to i32 (%struct.Person**, ...)*)(%struct.Person** %23)
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to %struct.Person**
%27 = load %struct.Person**, %struct.Person*** %6
%28 = load i32 (...)*, i32 (...)** %7
%29 = call %struct.Person** @PersonTreeFindParent(%struct.Person** %26, %struct.Person** %27, i32 (...)* %28)
store %struct.Person** %29, %struct.Person*** %4
br label %47
30: ; preds = %3
%31 = load %struct.Person**, %struct.Person*** %5
%32 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeRSon to i32 (%struct.Person**, ...)*)(%struct.Person** %31)
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to %struct.Person**
%35 = load %struct.Person**, %struct.Person*** %6
%36 = icmp eq %struct.Person** %34, %35
br i1 %36, label %37, label %39
37: ; preds = %30
%38 = load %struct.Person**, %struct.Person*** %5
store %struct.Person** %38, %struct.Person*** %4
br label %47
39: ; preds = %30
%40 = load %struct.Person**, %struct.Person*** %5
%41 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeRSon to i32 (%struct.Person**, ...)*)(%struct.Person** %40)
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to %struct.Person**
%44 = load %struct.Person**, %struct.Person*** %6
%45 = load i32 (...)*, i32 (...)** %7
%46 = call %struct.Person** @PersonTreeFindParent(%struct.Person** %43, %struct.Person** %44, i32 (...)* %45)
store %struct.Person** %46, %struct.Person*** %4
br label %47
47: ; preds = %20, %22, %37, %39, %3
%48 = load %struct.Person**, %struct.Person*** %4
ret %struct.Person** %48
}

LLVM IR (-O2):
%struct.Person = type opaque
define %struct.Person** @PersonTreeFindParent(%struct.Person** %0, %struct.Person** %1, i32 (...)* %2) {
%4 = bitcast i32 (...)* %2 to i32 (%struct.Person**, %struct.Person**, ...)*
br label %5
5: ; preds = %15, %3
%6 = phi %struct.Person** [ %0, %3 ], [ %18, %15 ]
%7 = tail call i32 (%struct.Person**, %struct.Person**, ...) %4(%struct.Person** %1, %struct.Person** %6)
switch i32 %7, label %26 [
i32 -1, label %8
i32 1, label %19
]
8: ; preds = %5
%9 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeLSon to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.Person**
%12 = icmp eq %struct.Person** %11, %1
br i1 %12, label %26, label %13
13: ; preds = %8
%14 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeLSon to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
br label %15
15: ; preds = %13, %24
%16 = phi i32 [ %14, %13 ], [ %25, %24 ]
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to %struct.Person**
br label %5
19: ; preds = %5
%20 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeRSon to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to %struct.Person**
%23 = icmp eq %struct.Person** %22, %1
br i1 %23, label %26, label %24
24: ; preds = %19
%25 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonPersonTreeRSon to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
br label %15
26: ; preds = %19, %8, %5
ret %struct.Person** %6
}