#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 compare(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main(int argc, char **argv) {
  assert(argc == 3);
  char *first = argv[1];
  char *second = argv[2];
  int res = compare(first, second);
  printf("Are \"%s\" and \"%s\" one edit away?\n%s\n", first, second,
         res ? "YES" : "NO");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <compare@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%edi
lea    0xe9f(%rip),%rcx
lea    0xe94(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x3,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <compare@plt>
test   %eax,%eax
lea    0xec7(%rip),%rax
lea    0xebc(%rip),%rcx
cmove  %rax,%rcx
lea    0xe8c(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Are \22%s\22 and \22%s\22 one edit away?\0A%s\0A\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %5
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i32 @compare(i8* %18, i8* %19)
store i32 %20, i32* %7
%21 = load i8*, i8** %5
%22 = load i8*, i8** %6
%23 = load i32, i32* %7
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, 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)
%27 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %22, i8* %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Are \22%s\22 and \22%s\22 one edit away?\0A%s\0A\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @compare(i8* %7, i8* %9)
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9, i8* %12)
ret i32 0
}