#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*/ compress(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  const int bufsize = 1024;
  char s[bufsize];
  while (scanf("%s", s)) {
    if (*s == '0' && !*(s + 1)) {
      return 0;
    }
    compress(s);
    fprintf(stderr, "\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x400,-0x14(%rbp)
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
lea    0xea2(%rip),%rdi
lea    -0x430(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
je     11ca <main+0x9a>
movsbl -0x430(%rbp),%eax
cmp    $0x30,%eax
jne    11a4 <main+0x74>
cmpb   $0x0,-0x42f(%rbp)
jne    11a4 <main+0x74>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    11d1 <main+0xa1>
lea    -0x430(%rbp),%rdi
call   1030 <compress@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
lea    0xe43(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1157 <main+0x27>
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
lea    0xebb(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     11a1 <main+0x71>
mov    %rsp,%rbx
mov    0x2e84(%rip),%r12
lea    0xea0(%rip),%r14
lea    0xe96(%rip),%r15
jmp    1194 <main+0x64>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <compress@plt>
mov    (%r12),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     11a1 <main+0x71>
cmpb   $0x30,(%rsp)
jne    1170 <main+0x40>
cmpb   $0x0,0x1(%rsp)
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1024, i32* %6
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %7
%10 = alloca i8, i64 1024
br label %11
11: ; preds = %23, %2
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load i8, i8* %10
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 48
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %10, i64 1
%20 = load i8, i8* %19
%21 = icmp ne i8 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i32 0, i32* %3
store i32 1, i32* %8
br label %28
23: ; preds = %18, %14
%24 = call i32 @compress(i8* %10)
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
27: ; preds = %11
store i32 0, i32* %8
br label %28
28: ; preds = %27, %22
%29 = load i8*, i8** %7
%30 = load i32, i32* %8
switch i32 %30, label %33 [
i32 0, label %31
i32 1, label %31
]
31: ; preds = %28, %28
%32 = load i32, i32* %3
ret i32 %32
33: ; preds = %28
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stderr = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %21, label %7
7: ; preds = %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1
br label %9
9: ; preds = %7, %15
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 48
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = call i32 @compress(i8* %4)
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %9
21: ; preds = %9, %15, %2
ret i32 0
}