#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*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int /*<<< orphan*/ stdin;
int x_getline(char **, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 2)
    return 1;
  char *pattern = argv[1];
  char *line = NULL;
  while (x_getline(&line, stdin) != -1) {
    squeeze(line, pattern);
    printf("%s\n", line);
    free(line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11cd <main+0x8d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdi
call   1050 <x_getline@plt>
cmp    $0xffffffff,%eax
je     11c6 <main+0x86>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <squeeze@plt>
mov    -0x20(%rbp),%rsi
lea    0xe4d(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
jmp    1180 <main+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jne    11bf <main+0x7f>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x8(%rsi),%rbx
movq   $0x0,(%rsp)
mov    0x2e83(%rip),%r12
mov    (%r12),%esi
mov    %rsp,%rdi
call   1050 <x_getline@plt>
cmp    $0xffffffff,%eax
je     11b2 <main+0x72>
lea    0xe83(%rip),%r14
mov    %rsp,%r15
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1030 <squeeze@plt>
mov    (%rsp),%rsi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    (%rsp),%rdi
call   1040 <free@plt>
mov    (%r12),%esi
mov    %r15,%rdi
call   1050 <x_getline@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %28
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
store i8* null, i8** %7
br label %15
15: ; preds = %19, %11
%16 = load i32, i32* @stdin
%17 = call i32 @x_getline(i8** %7, i32 %16)
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8*, i8** %7
%21 = load i8*, i8** %6
%22 = call i32 @squeeze(i8* %20, i8* %21)
%23 = load i8*, i8** %7
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = load i8*, i8** %7
%26 = call i32 @free(i8* %25)
br label %15
27: ; preds = %15
store i32 0, i32* %3
br label %28
28: ; preds = %27, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %23
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%9 = load i32, i32* @stdin
%10 = call i32 @x_getline(i8** %3, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %22, label %12
12: ; preds = %5, %12
%13 = load i8*, i8** %3
%14 = call i32 @squeeze(i8* %13, i8* %7)
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %3
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* @stdin
%20 = call i32 @x_getline(i8** %3, i32 %19)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %12
22: ; preds = %12, %5
br label %23
23: ; preds = %2, %22
%24 = phi i32 [ 0, %22 ], [ 1, %2 ]
ret i32 %24
}