#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 */
char getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a;
  char base[1000];
  int i = 0;
  int j;
  int tot = 0;
  a = getchar();
  while (a != '\n') {
    base[i] = a;
    a = getchar();
    i++;
  }
  a = getchar();
  i = 0;
  while (a != '\n') {
    if (a != base[i])
      tot++;
    a = getchar();
    i++;
  }
  printf("%d\n", tot);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3f4(%rbp)
movl   $0x0,-0x3fc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     118c <main+0x6c>
mov    -0x5(%rbp),%cl
movslq -0x3f4(%rbp),%rax
mov    %cl,-0x3f0(%rbp,%rax,1)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1150 <main+0x30>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movl   $0x0,-0x3f4(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     11f5 <main+0xd5>
movsbl -0x5(%rbp),%eax
movslq -0x3f4(%rbp),%rcx
movsbl -0x3f0(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     11d7 <main+0xb7>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    11a0 <main+0x80>
mov    -0x3fc(%rbp),%esi
lea    0xdfe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x3e8,%rsp
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1151 <main+0x31>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %al,(%rbx)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%al
jne    1140 <main+0x20>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1188 <main+0x68>
mov    %rsp,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    (%rbx),%al
setne  %cl
add    %ecx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%al
jne    1170 <main+0x50>
lea    0xe71(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [1000 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %6
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
br label %8
8: ; preds = %12, %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i8, i8* %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %15
store i8 %13, i8* %16
%17 = call signext i8 (...) @getchar()
store i8 %17, i8* %2
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %8
20: ; preds = %8
%21 = call signext i8 (...) @getchar()
store i8 %21, i8* %2
store i32 0, i32* %4
br label %22
22: ; preds = %38, %20
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 10
br i1 %25, label %26, label %42
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %28, %33
br i1 %34, label %35, label %38
35: ; preds = %26
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %38
38: ; preds = %35, %26
%39 = call signext i8 (...) @getchar()
store i8 %39, i8* %2
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %22
42: ; preds = %22
%43 = load i32, i32* %6
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi i64 [ %10, %5 ], [ 0, %0 ]
%7 = phi i8 [ %9, %5 ], [ %3, %0 ]
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %6
store i8 %7, i8* %8
%9 = tail call signext i8 (...) @getchar()
%10 = add nuw i64 %6, 1
%11 = icmp eq i8 %9, 10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
%13 = tail call signext i8 (...) @getchar()
%14 = icmp eq i8 %13, 10
br i1 %14, label %27, label %15
15: ; preds = %12, %15
%16 = phi i64 [ %25, %15 ], [ 0, %12 ]
%17 = phi i32 [ %23, %15 ], [ 0, %12 ]
%18 = phi i8 [ %24, %15 ], [ %13, %12 ]
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %16
%20 = load i8, i8* %19
%21 = icmp ne i8 %18, %20
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %17, %22
%24 = tail call signext i8 (...) @getchar()
%25 = add nuw i64 %16, 1
%26 = icmp eq i8 %24, 10
br i1 %26, label %27, label %15
27: ; preds = %15, %12
%28 = phi i32 [ 0, %12 ], [ %23, %15 ]
%29 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}