#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void strEqual(FILE *out, char str1[], char str2[]) {
  for (; *str1 == *str2 && *str1 != '\0'; str1++, str2++)
    ;
  if (*str2 == *str1) {
    fprintf(out, "%s\n", "yes");
  } else {
    fprintf(out, "%s\n", "no");
  }
}


x86 assembly (clang, -O0):
<strEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jne    114f <strEqual+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115f <strEqual+0x4f>
jmp    1181 <strEqual+0x71>
jmp    1164 <strEqual+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <strEqual+0x14>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    11b3 <strEqual+0xa3>
mov    -0x8(%rbp),%rdi
lea    0xe5e(%rip),%rsi
lea    0xe5b(%rip),%rdx
call   1030 <fprintf@plt>
jmp    11ca <strEqual+0xba>
mov    -0x8(%rbp),%rdi
lea    0xe42(%rip),%rsi
lea    0xe43(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strEqual>:
mov    (%rsi),%al
mov    (%rdx),%r8b
test   %al,%al
je     1146 <strEqual+0x36>
cmp    %r8b,%al
jne    1146 <strEqual+0x36>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi,%rcx,1),%eax
movzbl (%rdx,%rcx,1),%r8d
test   %al,%al
je     1146 <strEqual+0x36>
add    $0x1,%rcx
cmp    %r8b,%al
je     1130 <strEqual+0x20>
cmp    %al,%r8b
lea    0xeb4(%rip),%rax
lea    0xeb1(%rip),%rdx
cmove  %rax,%rdx
lea    0xe9e(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define void @strEqual(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %23, %3
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %10, %13
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %15, %7
%21 = phi i1 [ false, %7 ], [ %19, %15 ]
br i1 %21, label %22, label %28
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
br label %7
28: ; preds = %20
%29 = load i8*, i8** %6
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = load i8*, i8** %5
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %31, %34
br i1 %35, label %36, label %39
36: ; preds = %28
%37 = load i32*, i32** %4
%38 = call i32 @fprintf(i32* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %42
39: ; preds = %28
%40 = load i32*, i32** %4
%41 = call i32 @fprintf(i32* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %39, %36
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define void @strEqual(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %1
%5 = load i8, i8* %2
%6 = icmp ne i8 %4, %5
%7 = icmp eq i8 %4, 0
%8 = or i1 %7, %6
br i1 %8, label %19, label %9
9: ; preds = %3, %9
%10 = phi i8* [ %13, %9 ], [ %2, %3 ]
%11 = phi i8* [ %12, %9 ], [ %1, %3 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp ne i8 %14, %15
%17 = icmp eq i8 %14, 0
%18 = or i1 %17, %16
br i1 %18, label %19, label %9
19: ; preds = %9, %3
%20 = phi i8 [ %4, %3 ], [ %14, %9 ]
%21 = phi i8 [ %5, %3 ], [ %15, %9 ]
%22 = icmp eq i8 %21, %20
%23 = select i1 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%24 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
ret void
}