#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 int32_t;
typedef int /*<<< orphan*/ char32_t;

/* Variables and functions */
int INT32_MAX;
int /*<<< orphan*/ assert(int);
scalar_t__ memcmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *, int);
int32_t fc_lev_bounded0(const char32_t *seq1, int32_t len1,
                        const char32_t *seq2, int32_t len2) {
  assert((len1 >= 0 && len1 <= 4096) && (len2 >= 0 && len2 <= 4096));
  if (len1 == len2)
    return memcmp(seq1, seq2, len1 * sizeof *seq1) != 0;
  return INT32_MAX;
}


x86 assembly (clang, -O0):
<fc_lev_bounded0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x25(%rbp)
jl     1179 <fc_lev_bounded0+0x59>
xor    %eax,%eax
cmpl   $0x1000,-0x14(%rbp)
mov    %al,-0x25(%rbp)
jg     1179 <fc_lev_bounded0+0x59>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x26(%rbp)
jl     1173 <fc_lev_bounded0+0x53>
cmpl   $0x1000,-0x24(%rbp)
setle  %al
mov    %al,-0x26(%rbp)
mov    -0x26(%rbp),%al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    11bd <fc_lev_bounded0+0x9d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11c9 <fc_lev_bounded0+0xa9>
mov    0x2e1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_lev_bounded0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
cmp    $0x1001,%esi
setb   %al
cmp    $0x1001,%ecx
setb   %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
cmp    %ebx,%ebp
jne    116e <fc_lev_bounded0+0x4e>
shl    $0x2,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1177 <fc_lev_bounded0+0x57>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@INT32_MAX = global i32 0
define i32 @fc_lev_bounded0(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %4
%13 = load i32, i32* %7
%14 = icmp sle i32 %13, 4096
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %9
%20 = icmp sle i32 %19, 4096
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ false, %15 ], [ %20, %18 ]
br label %23
23: ; preds = %21, %12, %4
%24 = phi i1 [ false, %12 ], [ false, %4 ], [ %22, %21 ]
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %40
30: ; preds = %23
%31 = load i32*, i32** %6
%32 = load i32*, i32** %8
%33 = load i32, i32* %7
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 4
%36 = trunc i64 %35 to i32
%37 = call i64 @memcmp(i32* %31, i32* %32, i32 %36)
%38 = icmp ne i64 %37, 0
%39 = zext i1 %38 to i32
store i32 %39, i32* %5
br label %42
40: ; preds = %23
%41 = load i32, i32* @INT32_MAX
store i32 %41, i32* %5
br label %42
42: ; preds = %40, %30
%43 = load i32, i32* %5
ret i32 %43
}

LLVM IR (-O2):
@INT32_MAX = global i32 0
define i32 @fc_lev_bounded0(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = icmp ult i32 %1, 4097
%6 = icmp ult i32 %3, 4097
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i32 %1, %3
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = shl i32 %1, 2
%13 = tail call i64 @memcmp(i32* %0, i32* %2, i32 %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %18
16: ; preds = %4
%17 = load i32, i32* @INT32_MAX
br label %18
18: ; preds = %16, %11
%19 = phi i32 [ %15, %11 ], [ %17, %16 ]
ret i32 %19
}