#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*/ deleteBlank(char *, int);
int getLine(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getLine(line, 1000)) > 0) {
    if (len > 1) {
      if (line[len - 1] == '\n') {
        deleteBlank(line, len);
      }
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getLine@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11a9 <main+0x79>
cmpl   $0x1,-0x8(%rbp)
jle    11a4 <main+0x74>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1191 <main+0x61>
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <deleteBlank@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getLine@plt>
test   %eax,%eax
jle    1196 <main+0x66>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
jmp    117c <main+0x4c>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getLine@plt>
test   %eax,%eax
jle    1196 <main+0x66>
cmp    $0x1,%eax
je     116b <main+0x3b>
lea    -0x1(%rax),%ecx
cmpb   $0xa,(%rsp,%rcx,1)
jne    1160 <main+0x30>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <deleteBlank@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %26, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getLine(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %23
19: ; preds = %11
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%21 = load i32, i32* %2
%22 = call i32 @deleteBlank(i8* %20, i32 %21)
br label %23
23: ; preds = %19, %11
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %8
br label %4
27: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getLine(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %21
5: ; preds = %0, %18
%6 = phi i32 [ %19, %18 ], [ %3, %0 ]
%7 = icmp eq i32 %6, 1
br i1 %7, label %18, label %8
8: ; preds = %5
%9 = add nsw i32 %6, -1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 10
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 @deleteBlank(i8* %2, i32 %6)
br label %16
16: ; preds = %14, %8
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %18
18: ; preds = %16, %5
%19 = call i32 @getLine(i8* %2, i32 1000)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %5, label %21
21: ; preds = %18, %0
ret i32 0
}