#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*/ assert(int);
int edit_distn(char *, int, char *, int);
void examples() {
  assert(edit_distn("123", 3, "1234", 4) == 1);
  assert(edit_distn("2034", 4, "234", 3) == 1);
  assert(edit_distn("kiss", 4, "miss", 4) == 2);
  assert(edit_distn("kitten", 6, "sitting", 7) == 5);
}


x86 assembly (clang, -O0):
<examples>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x3,%esi
lea    0xecd(%rip),%rdx
mov    $0x4,%ecx
call   1030 <edit_distn@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb1(%rip),%rdi
mov    $0x4,%esi
lea    0xea1(%rip),%rdx
mov    $0x3,%ecx
call   1030 <edit_distn@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe89(%rip),%rdi
mov    $0x4,%ecx
lea    0xe82(%rip),%rdx
mov    %ecx,%esi
call   1030 <edit_distn@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe69(%rip),%rdi
mov    $0x6,%esi
lea    0xe64(%rip),%rdx
mov    $0x7,%ecx
call   1030 <edit_distn@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<examples>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0x4,%ecx
call   1030 <edit_distn@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb6(%rip),%rdi
lea    0xeab(%rip),%rdx
mov    $0x4,%esi
mov    $0x3,%ecx
call   1030 <edit_distn@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe90(%rip),%rdi
lea    0xe8e(%rip),%rdx
mov    $0x4,%esi
mov    $0x4,%ecx
call   1030 <edit_distn@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe6f(%rip),%rdi
lea    0xe6f(%rip),%rdx
mov    $0x6,%esi
mov    $0x7,%ecx
call   1030 <edit_distn@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [5 x i8] c"1234\00"
@.str.2 = [5 x i8] c"2034\00"
@.str.3 = [4 x i8] c"234\00"
@.str.4 = [5 x i8] c"kiss\00"
@.str.5 = [5 x i8] c"miss\00"
@.str.6 = [7 x i8] c"kitten\00"
@.str.7 = [8 x i8] c"sitting\00"
define void @examples() {
%1 = call i32 @edit_distn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @edit_distn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @edit_distn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%10 = icmp eq i32 %9, 2
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @edit_distn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 7)
%14 = icmp eq i32 %13, 5
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [5 x i8] c"1234\00"
@.str.2 = [5 x i8] c"2034\00"
@.str.3 = [4 x i8] c"234\00"
@.str.4 = [5 x i8] c"kiss\00"
@.str.5 = [5 x i8] c"miss\00"
@.str.6 = [7 x i8] c"kitten\00"
@.str.7 = [8 x i8] c"sitting\00"
define void @examples() {
%1 = tail call i32 @edit_distn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @edit_distn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @edit_distn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%10 = icmp eq i32 %9, 2
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @edit_distn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 7)
%14 = icmp eq i32 %13, 5
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}