#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int strlen(char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("need two strings as arguments.\n");
    exit(EXIT_FAILURE);
  }
  int i;
  for (i = 0; i < strlen(argv[1]); ++i)
    if (argv[1][i] != argv[2][i])
      putchar(argv[1][i]);
  putchar('\n');
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     117a <main+0x3a>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11f1 <main+0xb1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     11de <main+0x9e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
jmp    11e3 <main+0xa3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x41>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    118f <main+0x4f>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11a9 <main+0x69>
xor    %ebx,%ebx
jmp    1170 <main+0x30>
nopl   (%rax)
add    $0x1,%rbx
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11a9 <main+0x69>
mov    0x8(%r14),%rdi
mov    0x10(%r14),%rcx
movzbl (%rdi,%rbx,1),%eax
cmp    (%rcx,%rbx,1),%al
je     1160 <main+0x20>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x8(%r14),%rdi
jmp    1160 <main+0x20>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"need two strings as arguments.\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
store i32 0, i32* %6
br label %14
14: ; preds = %49, %13
%15 = load i32, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
%20 = icmp slt i32 %15, %19
br i1 %20, label %21, label %52
21: ; preds = %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %29, %37
br i1 %38, label %39, label %48
39: ; preds = %21
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = call i32 @putchar(i8 signext %46)
br label %48
48: ; preds = %39, %21
br label %49
49: ; preds = %48
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
br label %14
52: ; preds = %14
%53 = call i32 @putchar(i8 signext 10)
%54 = load i32, i32* @EXIT_SUCCESS
%55 = call i32 @exit(i32 %54)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"need two strings as arguments.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %33
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
br label %15
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %9, %27
%16 = phi i64 [ 0, %9 ], [ %29, %27 ]
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 %16
%19 = load i8, i8* %18
%20 = load i8*, i8** %10
%21 = getelementptr inbounds i8, i8* %20, i64 %16
%22 = load i8, i8* %21
%23 = icmp eq i8 %19, %22
br i1 %23, label %27, label %24
24: ; preds = %15
%25 = tail call i32 @putchar(i8 signext %19)
%26 = load i8*, i8** %5
br label %27
27: ; preds = %15, %24
%28 = phi i8* [ %17, %15 ], [ %26, %24 ]
%29 = add nuw nsw i64 %16, 1
%30 = tail call i32 @strlen(i8* %28)
%31 = sext i32 %30 to i64
%32 = icmp slt i64 %29, %31
br i1 %32, label %15, label %33
33: ; preds = %27, %4
%34 = tail call i32 @putchar(i8 signext 10)
%35 = load i32, i32* @EXIT_SUCCESS
%36 = tail call i32 @exit(i32 %35)
unreachable
}