int main(int argc, char *argv[]) {
  char str1[100];
  char a[256] = {"Five Spaces In One Sentence "};
  printf("Enter String to Compress:\n");
  scanf("%[^\t\n]s", str1);
  printf("you entered : %s, len %ld\n", str1, strlen(str1));
  compressWithCount(str1);
  printf("Compressed string with count : str2 = %s\n", str1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x180(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
lea    0xf7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xf88(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x188(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x188(%rbp),%rsi
mov    %rax,%rdx
lea    0xf64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1070 <compressWithCount@plt>
lea    -0x80(%rbp),%rsi
lea    0xf62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe84(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <compressWithCount@plt>
lea    0xe81(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [256 x i8] c"Five Spaces In One Sentence \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\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\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 = [27 x i8] c"Enter String to Compress:\0A\00"
@.str.1 = [8 x i8] c"%[^\09\0A]s\00"
@.str.2 = [27 x i8] c"you entered : %s, len %ld\0A\00"
@.str.3 = [42 x i8] c"Compressed string with count : str2 = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i8]
%6 = alloca [256 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [256 x i8]* %6 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i64 @strlen(i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %11, i64 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @compressWithCount to i32 (i8*, ...)*)(i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%[^\09\0A]s\00"
@.str.2 = [27 x i8] c"you entered : %s, len %ld\0A\00"
@.str.3 = [42 x i8] c"Compressed string with count : str2 = %s\0A\00"
@str = [26 x i8] c"Enter String to Compress:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i64 @strlen(i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %4, i64 %7)
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @compressWithCount to i32 (i8*, ...)*)(i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %4)
ret i32 0
}