#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 */
scalar_t__ charFix(char);
int nameEq(char *p, char *q) {
  while (*p && charFix(*p) == charFix(*q))
    ++p, ++q;
  return !*p && !*q;
}


x86 assembly (clang, -O0):
<nameEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1161 <nameEq+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <charFix@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <charFix@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1171 <nameEq+0x61>
jmp    118e <nameEq+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <nameEq+0x10>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
mov    %al,-0x21(%rbp)
jne    11af <nameEq+0x9f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameEq>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    (%rdi),%al
test   %al,%al
je     1162 <nameEq+0x52>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <charFix@plt>
mov    %rax,%r15
movsbl (%r14),%edi
call   1030 <charFix@plt>
cmp    %rax,%r15
jne    115a <nameEq+0x4a>
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <nameEq+0x20>
jmp    1162 <nameEq+0x52>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
jne    116b <nameEq+0x5b>
xor    %eax,%eax
cmpb   $0x0,(%r14)
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @nameEq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i64 @charFix(i8 signext %12)
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = call i64 @charFix(i8 signext %15)
%17 = icmp eq i64 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %34, label %29
29: ; preds = %25
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 0
%33 = xor i1 %32, true
br label %34
34: ; preds = %29, %25
%35 = phi i1 [ false, %25 ], [ %33, %29 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @nameEq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %2, %13
%6 = phi i8 [ %16, %13 ], [ %3, %2 ]
%7 = phi i8* [ %15, %13 ], [ %1, %2 ]
%8 = phi i8* [ %14, %13 ], [ %0, %2 ]
%9 = tail call i64 @charFix(i8 signext %6)
%10 = load i8, i8* %7
%11 = tail call i64 @charFix(i8 signext %10)
%12 = icmp eq i64 %9, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %21, label %5
18: ; preds = %5
%19 = load i8, i8* %8
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %13, %2, %18
%22 = phi i8* [ %7, %18 ], [ %1, %2 ], [ %15, %13 ]
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
%25 = zext i1 %24 to i32
br label %26
26: ; preds = %21, %18
%27 = phi i32 [ 0, %18 ], [ %25, %21 ]
ret i32 %27
}