int ciequal(ap, bp)
register const char *ap;
register const char *bp;
{
  while (lowerit(*ap) == lowerit(*bp++))
    if (*ap++ == '\0')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ciequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <lowerit@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <lowerit@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    1183 <ciequal+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117e <ciequal+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    118a <ciequal+0x7a>
jmp    1120 <ciequal+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ciequal>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r12
xor    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%r12,%rbx,1),%edi
xor    %eax,%eax
call   1030 <lowerit@plt>
mov    %eax,%ebp
movsbl (%r15,%rbx,1),%edi
xor    %eax,%eax
call   1030 <lowerit@plt>
cmp    %eax,%ebp
jne    115f <ciequal+0x4f>
cmpb   $0x0,(%r12,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1130 <ciequal+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ciequal(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %24, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @lowerit to i32 (i32, ...)*)(i32 %9)
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %5
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = call i32 (i32, ...) bitcast (i32 (...)* @lowerit to i32 (i32, ...)*)(i32 %14)
%16 = icmp eq i32 %10, %15
br i1 %16, label %17, label %25
17: ; preds = %6
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %3
br label %26
24: ; preds = %17
br label %6
25: ; preds = %6
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ciequal(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i8* [ %0, %2 ], [ %15, %13 ]
%5 = phi i8* [ %1, %2 ], [ %14, %13 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @lowerit to i32 (i32, ...)*)(i32 %7)
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @lowerit to i32 (i32, ...)*)(i32 %10)
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = getelementptr inbounds i8, i8* %4, i64 1
%16 = load i8, i8* %4
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %3
18: ; preds = %3, %13
%19 = phi i32 [ 1, %13 ], [ 0, %3 ]
ret i32 %19
}