#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 */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_orreq_imm(int, int, int);
int /*<<< orphan*/ emit_testimm(int, int);
int /*<<< orphan*/ emit_xor(int, int, int);
void emit_cmpstr(int s1, int s2, int sr, int temp) {
  emit_xor(s1, s2, 14);
  emit_andimm(sr, ~1, sr);
  emit_testimm(14, 0xFF);
  emit_orreq_imm(sr, 1, sr);
  emit_testimm(14, 0xFF00);
  emit_orreq_imm(sr, 1, sr);
  emit_testimm(14, 0xFF0000);
  emit_orreq_imm(sr, 1, sr);
  emit_testimm(14, 0xFF000000);
  emit_orreq_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_cmpstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xe,%edx
call   1030 <emit_xor@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1060 <emit_andimm@plt>
mov    $0xe,%edi
mov    $0xff,%esi
call   1040 <emit_testimm@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff00,%esi
call   1040 <emit_testimm@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff0000,%esi
call   1040 <emit_testimm@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff000000,%esi
call   1040 <emit_testimm@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1050 <emit_orreq_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmpstr>:
push   %rbx
mov    %edx,%ebx
mov    $0xe,%edx
call   1030 <emit_xor@plt>
mov    %ebx,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1060 <emit_andimm@plt>
mov    $0xe,%edi
mov    $0xff,%esi
call   1040 <emit_testimm@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff00,%esi
call   1040 <emit_testimm@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff0000,%esi
call   1040 <emit_testimm@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1050 <emit_orreq_imm@plt>
mov    $0xe,%edi
mov    $0xff000000,%esi
call   1040 <emit_testimm@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1050 <emit_orreq_imm@plt>

LLVM IR (-O0):
define void @emit_cmpstr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @emit_xor(i32 %9, i32 %10, i32 14)
%12 = load i32, i32* %7
%13 = load i32, i32* %7
%14 = call i32 @emit_andimm(i32 %12, i32 -2, i32 %13)
%15 = call i32 @emit_testimm(i32 14, i32 255)
%16 = load i32, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @emit_orreq_imm(i32 %16, i32 1, i32 %17)
%19 = call i32 @emit_testimm(i32 14, i32 65280)
%20 = load i32, i32* %7
%21 = load i32, i32* %7
%22 = call i32 @emit_orreq_imm(i32 %20, i32 1, i32 %21)
%23 = call i32 @emit_testimm(i32 14, i32 16711680)
%24 = load i32, i32* %7
%25 = load i32, i32* %7
%26 = call i32 @emit_orreq_imm(i32 %24, i32 1, i32 %25)
%27 = call i32 @emit_testimm(i32 14, i32 -16777216)
%28 = load i32, i32* %7
%29 = load i32, i32* %7
%30 = call i32 @emit_orreq_imm(i32 %28, i32 1, i32 %29)
ret void
}

LLVM IR (-O2):
define void @emit_cmpstr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_xor(i32 %0, i32 %1, i32 14)
%6 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%7 = tail call i32 @emit_testimm(i32 14, i32 255)
%8 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
%9 = tail call i32 @emit_testimm(i32 14, i32 65280)
%10 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
%11 = tail call i32 @emit_testimm(i32 14, i32 16711680)
%12 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
%13 = tail call i32 @emit_testimm(i32 14, i32 -16777216)
%14 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
ret void
}