#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 */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long, char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char line[240 + 1];
  long offset = 0;
  while (fgets(line, sizeof(line), stdin) != NULL) {
    if ((line[0] == '&' || line[0] == '#') && line[1])
      printf("%ld%s", offset, line);
    offset = ftell(stdin);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x118(%rbp)
lea    -0x110(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
mov    $0xf1,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11dc <main+0xac>
movsbl -0x110(%rbp),%eax
cmp    $0x26,%eax
je     1198 <main+0x68>
movsbl -0x110(%rbp),%eax
cmp    $0x23,%eax
jne    11c2 <main+0x92>
movsbl -0x10f(%rbp),%eax
cmp    $0x0,%eax
je     11c2 <main+0x92>
mov    -0x118(%rbp),%rsi
lea    -0x110(%rbp),%rdx
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1050 <ftell@plt>
mov    %rax,-0x118(%rbp)
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    0x2ea3(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rdi
mov    $0xf1,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11bb <main+0x8b>
xor    %ebx,%ebx
lea    0xe9c(%rip),%r14
mov    %rsp,%r15
jmp    1192 <main+0x62>
nopl   0x0(%rax)
mov    (%r12),%edi
call   1050 <ftell@plt>
mov    %rax,%rbx
mov    (%r12),%edx
mov    %r15,%rdi
mov    $0xf1,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11bb <main+0x8b>
movzbl (%rsp),%eax
cmp    $0x26,%al
setne  %cl
cmp    $0x23,%al
setne  %al
test   %al,%cl
jne    1170 <main+0x40>
cmpb   $0x0,0x1(%rsp)
je     1170 <main+0x40>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%ld%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [241 x i8]
%4 = getelementptr inbounds [241 x i8], [241 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 241, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %27, label %8
8: ; preds = %2
%9 = getelementptr inbounds [241 x i8], [241 x i8]* %3, i64 0, i64 1
br label %10
10: ; preds = %8, %21
%11 = phi i64 [ 0, %8 ], [ %23, %21 ]
%12 = load i8, i8* %4
%13 = icmp eq i8 %12, 38
%14 = icmp eq i8 %12, 35
%15 = or i1 %13, %14
%16 = load i8, i8* %9
%17 = icmp ne i8 %16, 0
%18 = select i1 %15, i1 %17, i1 false
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %11, i8* %4)
br label %21
21: ; preds = %10, %19
%22 = load i32, i32* @stdin
%23 = call i64 @ftell(i32 %22)
%24 = load i32, i32* @stdin
%25 = call i32* @fgets(i8* %4, i32 241, i32 %24)
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %10
27: ; preds = %21, %2
ret i32 0
}