#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 *, ...);
scalar_t__ processString(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strlen(char *);
int main(void) {
  char istring[1024], ostring[1024];
  scanf("%[^\n]s", istring);
  if (0 == processString(istring, ostring)) {
    if (strlen(ostring) < strlen(istring)) {
      printf("\nafter compression : %s\n", ostring);
      return 0;
    } else {
      printf("\nBetter not to compress\n");
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1060 <processString@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ee <main+0xae>
lea    -0x810(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x818(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x818(%rbp),%rax
cmp    %rcx,%rax
jge    11d9 <main+0x99>
lea    -0x810(%rbp),%rsi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ee <main+0xae>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x800,%rsp
lea    0xea1(%rip),%rdi
lea    0x400(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1070 <processString@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    11c4 <main+0x74>
mov    %rsp,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0x400(%rsp),%rdi
call   1040 <strlen@plt>
cmp    %rax,%rbx
jge    11b3 <main+0x63>
lea    0xe62(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11c4 <main+0x74>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [25 x i8] c"\0Aafter compression : %s\0A\00"
@.str.2 = [25 x i8] c"\0ABetter not to compress\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i64 @processString(i8* %6, i8* %7)
%9 = icmp eq i64 0, %8
br i1 %9, label %10, label %21
10: ; preds = %0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i64 @strlen(i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%14 = call i64 @strlen(i8* %13)
%15 = icmp slt i64 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %17)
store i32 0, i32* %1
br label %21
19: ; preds = %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %21
21: ; preds = %16, %19, %0
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [25 x i8] c"\0Aafter compression : %s\0A\00"
@str = [24 x i8] c"\0ABetter not to compress\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i64 @processString(i8* %3, i8* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = call i64 @strlen(i8* %4)
%10 = call i64 @strlen(i8* %3)
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %16
14: ; preds = %8
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %0, %14, %12
%17 = phi i32 [ 0, %12 ], [ 1, %14 ], [ 0, %0 ]
ret i32 %17
}