#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 */
scalar_t__ compareStrings(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
char *removeSpaces(char *);
int main(int argc, char const *argv[]) {
  {
    char str1[] = "";
    if (compareStrings(str1, removeSpaces(str1))) {
      printf("\nTest1 passed\n");
    } else {
      printf("Test1 Failed\n");
    }
  }
  {
    char str1[] = "123";
    if (compareStrings(str1, removeSpaces(str1))) {
      printf("Test2 passed\n");
    } else {
      printf("Test2 Failed\n");
    }
  }
  {
    char str1[] = "12 w 2e     we  2 3     ";
    if (compareStrings(removeSpaces(str1), "12w2ewe23")) {
      printf("Test3 passed\n");
    } else {
      printf("Test3 Failed\n");
      printf("Expected = %s, Actual = %s\n", "12w2ewe23", str1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x11(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x11(%rbp),%rdi
call   1040 <removeSpaces@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
call   1030 <compareStrings@plt>
cmp    $0x0,%rax
je     11a0 <main+0x60>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ae <main+0x6e>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xe69(%rip),%eax
mov    %eax,-0x15(%rbp)
lea    -0x15(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x15(%rbp),%rdi
call   1040 <removeSpaces@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1030 <compareStrings@plt>
cmp    $0x0,%rax
je     11f1 <main+0xb1>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ff <main+0xbf>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0xe7a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe72(%rip),%al
mov    %al,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <removeSpaces@plt>
mov    %rax,%rdi
lea    0xe01(%rip),%rsi
call   1030 <compareStrings@plt>
cmp    $0x0,%rax
je     125e <main+0x11e>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1285 <main+0x145>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdx
lea    0xdec(%rip),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movb   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <removeSpaces@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <compareStrings@plt>
test   %rax,%rax
lea    0xed6(%rip),%rax
lea    0xf10(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
movl   $0x333231,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <removeSpaces@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <compareStrings@plt>
test   %rax,%rax
lea    0xeac(%rip),%rax
lea    0xecc(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
movups 0xe52(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xe3d(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1050 <removeSpaces@plt>
lea    0xe43(%rip),%rsi
mov    %rax,%rdi
call   1030 <compareStrings@plt>
test   %rax,%rax
je     11f1 <main+0xb1>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
jmp    1215 <main+0xd5>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
lea    0xe1f(%rip),%rdi
lea    0xe0e(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0ATest1 passed\0A\00"
@.str.1 = [14 x i8] c"Test1 Failed\0A\00"
@__const.main.str1 = [4 x i8] c"123\00"
@.str.2 = [14 x i8] c"Test2 passed\0A\00"
@.str.3 = [14 x i8] c"Test2 Failed\0A\00"
@__const.main.str1.4 = [25 x i8] c"12 w 2e we 2 3 \00"
@.str.5 = [10 x i8] c"12w2ewe23\00"
@.str.6 = [14 x i8] c"Test3 passed\0A\00"
@.str.7 = [14 x i8] c"Test3 Failed\0A\00"
@.str.8 = [28 x i8] c"Expected = %s, Actual = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1 x i8]
%7 = alloca [4 x i8]
%8 = alloca [25 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [1 x i8]* %6 to i8*
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%12 = call i8* @removeSpaces(i8* %11)
%13 = call i64 @compareStrings(i8* %10, i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = bitcast [4 x i8]* %7 to i8*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%23 = call i8* @removeSpaces(i8* %22)
%24 = call i64 @compareStrings(i8* %21, i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %30
28: ; preds = %19
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = bitcast [25 x i8]* %8 to i8*
%32 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%33 = call i8* @removeSpaces(i8* %32)
%34 = call i64 @compareStrings(i8* %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %42
38: ; preds = %30
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%40 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %38, %36
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1.4 = [25 x i8] c"12 w 2e we 2 3 \00"
@.str.5 = [10 x i8] c"12w2ewe23\00"
@.str.8 = [28 x i8] c"Expected = %s, Actual = %s\0A\00"
@str = [13 x i8] c"Test1 Failed\00"
@str.9 = [13 x i8] c"Test2 Failed\00"
@str.10 = [13 x i8] c"Test3 Failed\00"
@str.11 = [13 x i8] c"Test3 passed\00"
@str.12 = [13 x i8] c"Test2 passed\00"
@str.13 = [14 x i8] c"\0ATest1 passed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8]
%4 = alloca i32
%5 = alloca [25 x i8]
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %6
%7 = call i8* @removeSpaces(i8* %6)
%8 = call i64 @compareStrings(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.13, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
%12 = bitcast i32* %4 to i8*
store i32 3355185, i32* %4
%13 = call i8* @removeSpaces(i8* %12)
%14 = call i64 @compareStrings(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0)
%17 = call i32 @puts(i8* dereferenceable(1) %16)
%18 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%19 = call i8* @removeSpaces(i8* %18)
%20 = call i64 @compareStrings(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %2
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
br label %27
24: ; preds = %2
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.10, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %18)
br label %27
27: ; preds = %24, %22
ret i32 0
}