checkrevpair(num1, num2) char *num1, *num2;
{
  int length;
  if ((length = countnumflds(num1)) != countnumflds(num2)) {
    error(" Invalid branch or revision pair %s : %s", num1, num2);
    return 0;
  }
  if (length > 2)
    if (compartial(num1, num2, length - 1) != 0) {
      error("Invalid branch or revision pair %s : %s", num1, num2);
      return 0;
    }
  return 1;
}


x86 assembly (clang, -O0):
<checkrevpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <countnumflds@plt>
mov    %eax,-0x20(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <countnumflds@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     118b <checkrevpair+0x5b>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <checkrevpair+0xb1>
cmpl   $0x2,-0x1c(%rbp)
jle    11da <checkrevpair+0xaa>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
mov    $0x0,%al
call   1050 <compartial@plt>
cmp    $0x0,%eax
je     11d5 <checkrevpair+0xa5>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e1 <checkrevpair+0xb1>
jmp    11da <checkrevpair+0xaa>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkrevpair>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <countnumflds@plt>
mov    %eax,%ebx
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <countnumflds@plt>
cmp    %eax,%ebx
jne    117d <checkrevpair+0x4d>
mov    $0x1,%ebp
cmp    $0x3,%ebx
jl     1193 <checkrevpair+0x63>
add    $0xffffffff,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <compartial@plt>
test   %eax,%eax
je     1193 <checkrevpair+0x63>
lea    0xe86(%rip),%rdi
jmp    1184 <checkrevpair+0x54>
lea    0xe7c(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <error@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c" Invalid branch or revision pair %s : %s\00"
@.str.1 = [40 x i8] c"Invalid branch or revision pair %s : %s\00"
define i32 @checkrevpair(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @countnumflds to i32 (i8*, ...)*)(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @countnumflds to i32 (i8*, ...)*)(i8* %9)
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
store i32 0, i32* %3
br label %32
16: ; preds = %2
%17 = load i32, i32* %6
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %31
19: ; preds = %16
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = sub nsw i32 %22, 1
%24 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @compartial to i32 (i8*, i8*, i32, ...)*)(i8* %20, i8* %21, i32 %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %19
%27 = load i8*, i8** %4
%28 = load i8*, i8** %5
%29 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28)
store i32 0, i32* %3
br label %32
30: ; preds = %19
br label %31
31: ; preds = %30, %16
store i32 1, i32* %3
br label %32
32: ; preds = %31, %26, %12
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [41 x i8] c" Invalid branch or revision pair %s : %s\00"
@.str.1 = [40 x i8] c"Invalid branch or revision pair %s : %s\00"
define i32 @checkrevpair(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @countnumflds to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @countnumflds to i32 (i8*, ...)*)(i8* %1)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = icmp sgt i32 %3, 2
br i1 %7, label %8, label %15
8: ; preds = %6
%9 = add nsw i32 %3, -1
%10 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @compartial to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8, %2
%13 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), %8 ]
%14 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i8*, ...)*)(i8* %13, i8* %0, i8* %1)
br label %15
15: ; preds = %12, %6, %8
%16 = phi i32 [ 1, %8 ], [ 1, %6 ], [ 0, %12 ]
ret i32 %16
}