#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__ charsequalcaseless(char const, char const);
int MHD_str_equal_caseless_bin_n_(const char *const str1,
                                  const char *const str2, size_t len) {
  size_t i;
  for (i = 0; i < len; ++i) {
    const char c1 = str1[i];
    const char c2 = str2[i];
    if (charsequalcaseless(c1, c2))
      continue;
    else
      return 0;
  }
  return !0;
}


x86 assembly (clang, -O0):
<MHD_str_equal_caseless_bin_n_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1191 <MHD_str_equal_caseless_bin_n_+0x81>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x29(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x2a(%rbp)
mov    -0x29(%rbp),%al
movsbl %al,%edi
movsbl -0x2a(%rbp),%esi
call   1030 <charsequalcaseless@plt>
cmp    $0x0,%rax
je     1174 <MHD_str_equal_caseless_bin_n_+0x64>
jmp    1180 <MHD_str_equal_caseless_bin_n_+0x70>
movl   $0x0,-0x4(%rbp)
jmp    1198 <MHD_str_equal_caseless_bin_n_+0x88>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    112c <MHD_str_equal_caseless_bin_n_+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MHD_str_equal_caseless_bin_n_>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r14d
test   %rdx,%rdx
je     1152 <MHD_str_equal_caseless_bin_n_+0x42>
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebp,%ebp
xchg   %ax,%ax
movsbl (%r12,%rbp,1),%edi
movsbl (%r15,%rbp,1),%esi
call   1030 <charsequalcaseless@plt>
test   %rax,%rax
je     114f <MHD_str_equal_caseless_bin_n_+0x3f>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <MHD_str_equal_caseless_bin_n_+0x20>
jmp    1152 <MHD_str_equal_caseless_bin_n_+0x42>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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