#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 *);
int string_compare(char *, char *);
int main() {
  char a[100] = "Hello!";
  char b[100] = "Hello!";
  char c[100] = "Hello World!";
  int compare_a_b = string_compare(a, b);
  int compare_a_c = string_compare(a, c);
  if (compare_a_b == 1) {
    printf("'%s' and '%s' are equal.\n", a, b);
  } else {
    printf("'%s' and '%s' are not equal.\n", a, b);
  }
  if (compare_a_c == 1) {
    printf("'%s' and '%s' are equal.\n", a, c);
  } else {
    printf("'%s' and '%s' are not equal.\n", a, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x48,-0x70(%rbp)
movb   $0x65,-0x6f(%rbp)
movb   $0x6c,-0x6e(%rbp)
movb   $0x6c,-0x6d(%rbp)
movb   $0x6f,-0x6c(%rbp)
movb   $0x21,-0x6b(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x48,-0xe0(%rbp)
movb   $0x65,-0xdf(%rbp)
movb   $0x6c,-0xde(%rbp)
movb   $0x6c,-0xdd(%rbp)
movb   $0x6f,-0xdc(%rbp)
movb   $0x21,-0xdb(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xe3b(%rip),%rsi
mov    $0x64,%edx
call   1060 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <string_compare@plt>
mov    %eax,-0x154(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1030 <string_compare@plt>
mov    %eax,-0x158(%rbp)
cmpl   $0x1,-0x154(%rbp)
jne    1224 <main+0xe4>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
jmp    123b <main+0xfb>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x1,-0x158(%rbp)
jne    1264 <main+0x124>
lea    -0x70(%rbp),%rsi
lea    -0x150(%rbp),%rdx
lea    0xe0a(%rip),%rdi
call   1040 <printf@plt>
jmp    127b <main+0x13b>
lea    -0x70(%rbp),%rsi
lea    -0x150(%rbp),%rdx
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xd0(%rsp)
movl   $0x6c6c6548,0x70(%rsp)
6c
movw   $0x216f,0x74(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x6c6c6548,(%rsp)
movw   $0x216f,0x4(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe7c(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe5d(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xe3e(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xe1f(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xe00(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movl   $0x0,0x140(%rsp)
lea    0x70(%rsp),%r12
mov    %rsp,%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <string_compare@plt>
mov    %eax,%ebp
lea    0xe0(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <string_compare@plt>
mov    %eax,%ebx
cmp    $0x1,%ebp
lea    0xe1d(%rip),%r13
lea    0xe30(%rip),%rbp
mov    %rbp,%rdi
cmove  %r13,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
cmp    $0x1,%ebx
cmove  %r13,%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.c = [100 x i8] c"Hello World!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [26 x i8] c"'%s' and '%s' are equal.\0A\00"
@.str.1 = [30 x i8] c"'%s' and '%s' are not equal.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [100 x i8]* %2 to i8*
%8 = bitcast i8* %7 to [100 x i8]*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 0
store i8 72, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 1
store i8 101, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 2
store i8 108, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 3
store i8 108, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 4
store i8 111, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i32 0, i32 5
store i8 33, i8* %14
%15 = bitcast [100 x i8]* %3 to i8*
%16 = bitcast i8* %15 to [100 x i8]*
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 0
store i8 72, i8* %17
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 1
store i8 101, i8* %18
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 2
store i8 108, i8* %19
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 3
store i8 108, i8* %20
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 4
store i8 111, i8* %21
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i32 0, i32 5
store i8 33, i8* %22
%23 = bitcast [100 x i8]* %4 to i8*
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%26 = call i32 @string_compare(i8* %24, i8* %25)
store i32 %26, i32* %5
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%29 = call i32 @string_compare(i8* %27, i8* %28)
store i32 %29, i32* %6
%30 = load i32, i32* %5
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %36
32: ; preds = %0
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %33, i8* %34)
br label %40
36: ; preds = %0
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %37, i8* %38)
br label %40
40: ; preds = %36, %32
%41 = load i32, i32* %6
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%46 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %44, i8* %45)
br label %51
47: ; preds = %40
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%50 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %48, i8* %49)
br label %51
51: ; preds = %47, %43
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [100 x i8] c"Hello World!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [26 x i8] c"'%s' and '%s' are equal.\0A\00"
@.str.1 = [30 x i8] c"'%s' and '%s' are not equal.\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 72, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 101, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 108, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 108, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 4
store i8 111, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 5
store i8 33, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 72, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 101, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 108, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
store i8 108, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
store i8 111, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 5
store i8 33, i8* %15
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @string_compare(i8* %4, i8* %10)
%18 = call i32 @string_compare(i8* %4, i8* %16)
%19 = icmp eq i32 %17, 1
%20 = select i1 %19, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0)
%21 = call i32 @printf(i8* %20, i8* %4, i8* %10)
%22 = icmp eq i32 %18, 1
%23 = select i1 %22, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0)
%24 = call i32 @printf(i8* %23, i8* %4, i8* %16)
ret i32 0
}