#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*/ any(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
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) {
    printf("%ld\n", any(line, pattern));
    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    11cb <main+0x8b>
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   1040 <x_getline@plt>
cmp    $0xffffffff,%eax
je     11c4 <main+0x84>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <any@plt>
mov    %eax,%esi
lea    0xe4f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <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    11bd <main+0x7d>
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   1040 <x_getline@plt>
cmp    $0xffffffff,%eax
je     11b0 <main+0x70>
lea    0xe83(%rip),%r14
mov    %rsp,%r15
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1060 <any@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    (%r12),%esi
mov    %r15,%rdi
call   1040 <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 = [5 x i8] c"%ld\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 %27
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 %26
19: ; preds = %15
%20 = load i8*, i8** %7
%21 = load i8*, i8** %6
%22 = call i32 @any(i8* %20, i8* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load i8*, i8** %7
%25 = call i32 @free(i8* %24)
br label %15
26: ; preds = %15
store i32 0, i32* %3
br label %27
27: ; preds = %26, %10
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"%ld\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 %22
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 %21, label %12
12: ; preds = %5, %12
%13 = load i8*, i8** %3
%14 = call i32 @any(i8* %13, i8* %7)
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
%18 = load i32, i32* @stdin
%19 = call i32 @x_getline(i8** %3, i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %12
21: ; preds = %12, %5
br label %22
22: ; preds = %2, %21
%23 = phi i32 [ 0, %21 ], [ 1, %2 ]
ret i32 %23
}