#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 EXIT_SUCCESS;
scalar_t__ is_strings_equals(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  printf("================================\n");
  printf("STRINGS #1\n");
  printf("================================\n\n");
  char a[] = {'H', 'e', 'l', 'l', 'o', ',', ' ',
              'w', 'o', 'r', 'l', 'd', '!', '\0'};
  char *n = "Hello, world!", *m = a;
  printf("Array:\t%s\n", n);
  printf("String:\t%s\n\n", m);
  printf("Are the strings equal?\n- ");
  if (is_strings_equals(m, n)) {
    printf("Yes! :)\n\n");
  } else {
    printf("No... :(\n\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xeea(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xee8(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xee2(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x1e(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <is_strings_equals@plt>
cmp    $0x0,%rax
je     11ee <main+0xce>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11fc <main+0xdc>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xf02(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
movabs $0x21646c726f7720,%rax
mov    %rax,0xe(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,0x8(%rsp)
lea    0xe80(%rip),%r14
lea    0xe87(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <is_strings_equals@plt>
test   %rax,%rax
lea    0xec4(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"================================\0A\00"
@.str.1 = [12 x i8] c"STRINGS\0A\00"
@.str.2 = [35 x i8] c"================================\0A\0A\00"
@__const.main.a = [14 x i8] c"Hello, world!\00"
@.str.3 = [14 x i8] c"Hello, world!\00"
@.str.4 = [11 x i8] c"Array:\09%s\0A\00"
@.str.5 = [13 x i8] c"String:\09%s\0A\0A\00"
@.str.6 = [26 x i8] c"Are the strings equal?\0A- \00"
@.str.7 = [10 x i8] c"Yes! :)\0A\0A\00"
@.str.8 = [11 x i8] c"No... :(\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%12 = bitcast [14 x i8]* %6 to i8*
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %7
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
store i8* %13, i8** %8
%14 = load i8*, i8** %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %8
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%19 = load i8*, i8** %8
%20 = load i8*, i8** %7
%21 = call i64 @is_strings_equals(i8* %19, i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %27
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@.str.3 = [14 x i8] c"Hello, world!\00"
@.str.4 = [11 x i8] c"Array:\09%s\0A\00"
@.str.5 = [13 x i8] c"String:\09%s\0A\0A\00"
@.str.6 = [26 x i8] c"Are the strings equal?\0A- \00"
@EXIT_SUCCESS = global i32 0
@str = [33 x i8] c"================================\00"
@str.9 = [11 x i8] c"STRINGS\00"
@str.10 = [34 x i8] c"================================\0A\00"
@str.11 = [10 x i8] c"No... :(\0A\00"
@str.12 = [9 x i8] c"Yes! :)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0))
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%11 = call i64 @is_strings_equals(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0)
%14 = call i32 @puts(i8* dereferenceable(1) %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}