#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 strlen(char *);
char findTheDifference(char *s, char *t) {
  char d = 0;
  int i;
  for (i = 0; i < strlen(s); i++) {
    d = d ^ s[i];
  }
  for (i = 0; i < strlen(t); i++) {
    d = d ^ t[i];
  }
  return d;
}


x86 assembly (clang, -O0):
<findTheDifference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    116a <findTheDifference+0x5a>
movsbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112b <findTheDifference+0x1b>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    11b0 <findTheDifference+0xa0>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1171 <findTheDifference+0x61>
movsbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findTheDifference>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1149 <findTheDifference+0x39>
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xor    (%r15,%rbx,1),%bpl
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <findTheDifference+0x20>
jmp    114b <findTheDifference+0x3b>
xor    %ebp,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1177 <findTheDifference+0x67>
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    (%r14,%rbx,1),%bpl
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1160 <findTheDifference+0x50>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @findTheDifference(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 0, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %26
12: ; preds = %7
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = xor i32 %14, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %5
br label %23
23: ; preds = %12
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
store i32 0, i32* %6
br label %27
27: ; preds = %43, %26
%28 = load i32, i32* %6
%29 = load i8*, i8** %4
%30 = call i32 @strlen(i8* %29)
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %46
32: ; preds = %27
%33 = load i8, i8* %5
%34 = sext i8 %33 to i32
%35 = load i8*, i8** %4
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = xor i32 %34, %40
%42 = trunc i32 %41 to i8
store i8 %42, i8* %5
br label %43
43: ; preds = %32
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %27
46: ; preds = %27
%47 = load i8, i8* %5
ret i8 %47
}

LLVM IR (-O2):
define signext i8 @findTheDifference(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %9, %2
%6 = phi i8 [ 0, %2 ], [ %14, %9 ]
%7 = tail call i32 @strlen(i8* %1)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %19, label %29
9: ; preds = %2, %9
%10 = phi i64 [ %15, %9 ], [ 0, %2 ]
%11 = phi i8 [ %14, %9 ], [ 0, %2 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = xor i8 %13, %11
%15 = add nuw nsw i64 %10, 1
%16 = tail call i32 @strlen(i8* %0)
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %9, label %5
19: ; preds = %5, %19
%20 = phi i64 [ %25, %19 ], [ 0, %5 ]
%21 = phi i8 [ %24, %19 ], [ %6, %5 ]
%22 = getelementptr inbounds i8, i8* %1, i64 %20
%23 = load i8, i8* %22
%24 = xor i8 %23, %21
%25 = add nuw nsw i64 %20, 1
%26 = tail call i32 @strlen(i8* %1)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %19, label %29
29: ; preds = %19, %5
%30 = phi i8 [ %6, %5 ], [ %24, %19 ]
ret i8 %30
}