#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 *, ...);
int main(void) {
  printf("\nstringequality started\n\n");
  bool equalStr(const char s1[], const char s2[]);
  const char strA[] = "abcdefghi";
  const char strB[] = "1234567890";
  printf("%i\n", equalStr(strA, strB));
  printf("%i\n", equalStr(strA, strA));
  printf("%i\n", equalStr(strB, "1234567890"));
  printf("\nstringequality ended\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xed6(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x11(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0xf(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1030 <equalStr@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1030 <equalStr@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x19(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1030 <equalStr@plt>
mov    %eax,%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,0x8(%rsp)
movw   $0x69,0x10(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,0x18(%rsp)
movl   $0x303938,0x1f(%rsp)
lea    0xe93(%rip),%r14
lea    0x8(%rsp),%rbx
lea    0x18(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <equalStr@plt>
lea    0xe73(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <equalStr@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <equalStr@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0Astringequality started\0A\0A\00"
@__const.main.strA = [10 x i8] c"abcdefghi\00"
@__const.main.strB = [11 x i8] c"1234567890\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [11 x i8] c"1234567890\00"
@.str.3 = [24 x i8] c"\0Astringequality ended\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [11 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = bitcast [10 x i8]* %2 to i8*
%6 = bitcast [11 x i8]* %3 to i8*
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%9 = call i32 @equalStr(i8* %7, i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%13 = call i32 @equalStr(i8* %11, i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%16 = call i32 @equalStr(i8* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.strA = [10 x i8] c"abcdefghi\00"
@.str.1 = [4 x i8] c"%i\0A\00"
@.str.2 = [11 x i8] c"1234567890\00"
@str = [25 x i8] c"\0Astringequality started\0A\00"
@str.4 = [23 x i8] c"\0Astringequality ended\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [11 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = call i32 @equalStr(i8* %4, i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @equalStr(i8* %4, i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @equalStr(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}