#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*/ printf(char *, char, char);
void character_comparison(char *character1, char *character2) {
  if (*character1 == *character2)
    printf("character1"
           " [aka '%c'] = "
           "character2"
           " [aka '%c']\n",
           *(character1), *(character2));
  else
    printf("character1"
           " [aka '%c'] != "
           "character2"
           " [aka '%c']\n",
           *(character1), *(character2));
}


x86 assembly (clang, -O0):
<character_comparison>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1157 <character_comparison+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xeb9(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
jmp    1173 <character_comparison+0x63>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xec7(%rip),%rdi
movsbl %cl,%esi
movsbl (%rax),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<character_comparison>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1129 <character_comparison+0x19>
movsbl %al,%edx
lea    0xede(%rip),%rdi
mov    %edx,%esi
jmp    1030 <printf@plt>
movsbl %al,%esi
movsbl %cl,%edx
lea    0xef9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"character1 [aka '%c'] = character2 [aka '%c']\0A\00"
@.str.1 = [48 x i8] c"character1 [aka '%c'] != character2 [aka '%c']\0A\00"
define void @character_comparison(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 signext %14, i8 signext %16)
br label %24
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8 signext %20, i8 signext %22)
br label %24
24: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"character1 [aka '%c'] = character2 [aka '%c']\0A\00"
@.str.1 = [48 x i8] c"character1 [aka '%c'] != character2 [aka '%c']\0A\00"
define void @character_comparison(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %3)
br label %10
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8 signext %3, i8 signext %4)
br label %10
10: ; preds = %8, %6
ret void
}