#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long long);
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
scalar_t__ strnstr(char *, char *, int);
int main() {
  char data[4096];
  long long ofs = 0;
  while (read(0, data, 4096) > 0) {
    if (strnstr(data, "072 472 0401", 4096)) {
      printf("block %lld\n", ofs);
      break;
    }
    ofs++;
    if (ofs % (1024 * 10) == 0) {
      printf("%lld Mb\r", ofs * 4 / 1024);
      fflush(stdout);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x1018(%rbp)
lea    -0x1010(%rbp),%rsi
xor    %edi,%edi
mov    $0x1000,%edx
call   1050 <read@plt>
cmp    $0x0,%rax
jle    1218 <main+0xd8>
lea    -0x1010(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x1000,%edx
call   1040 <strnstr@plt>
cmp    $0x0,%rax
je     11b4 <main+0x74>
mov    -0x1018(%rbp),%rsi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    1218 <main+0xd8>
mov    -0x1018(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rax
mov    $0x2800,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1213 <main+0xd3>
mov    -0x1018(%rbp),%rax
shl    $0x2,%rax
mov    $0x400,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    115d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1008,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x1000,%edx
call   1050 <read@plt>
test   %rax,%rax
jle    121b <main+0xdb>
mov    $0x1,%ebx
xor    %r13d,%r13d
movabs $0xcccccccccccccccd,%r12
cc cc cc
lea    0xe7e(%rip),%r14
mov    %rsp,%r15
jmp    11ab <main+0x6b>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r15,%rsi
mov    $0x1000,%edx
call   1050 <read@plt>
add    $0x1,%rbx
mov    %rbp,%r13
test   %rax,%rax
jle    121b <main+0xdb>
mov    %rbx,%rax
mul    %r12
mov    %rdx,%rbp
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1000,%edx
call   1040 <strnstr@plt>
test   %rax,%rax
jne    120c <main+0xcc>
shr    $0xd,%rbp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
shl    $0xb,%rax
add    $0xffffffffffffffff,%rax
lea    0x1(%r13),%rbp
cmp    %r13,%rax
jne    1190 <main+0x50>
mov    %rbp,%rsi
shr    $0x8,%rsi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    1190 <main+0x50>
lea    0xdfa(%rip),%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"072 472 0401\00"
@.str.1 = [12 x i8] c"block %lld\0A\00"
@.str.2 = [9 x i8] c"%lld Mb\0D\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
%3 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
br label %4
4: ; preds = %28, %0
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%6 = call i64 @read(i32 0, i8* %5, i32 4096)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %29
8: ; preds = %4
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%10 = call i64 @strnstr(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4096)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i64, i64* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 %13)
br label %29
15: ; preds = %8
%16 = load i64, i64* %3
%17 = add nsw i64 %16, 1
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = srem i64 %18, 10240
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = load i64, i64* %3
%23 = mul nsw i64 %22, 4
%24 = sdiv i64 %23, 1024
%25 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %24)
%26 = load i32, i32* @stdout
%27 = call i32 @fflush(i32 %26)
br label %28
28: ; preds = %21, %15
br label %4
29: ; preds = %12, %4
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [13 x i8] c"072 472 0401\00"
@.str.1 = [12 x i8] c"block %lld\0A\00"
@.str.2 = [9 x i8] c"%lld Mb\0D\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i64 @read(i32 0, i8* %2, i32 4096)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %23
5: ; preds = %0, %20
%6 = phi i64 [ %12, %20 ], [ 0, %0 ]
%7 = call i64 @strnstr(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4096)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 %6)
br label %23
11: ; preds = %5
%12 = add nuw nsw i64 %6, 1
%13 = urem i64 %12, 10240
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = lshr i64 %12, 8
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %16)
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
br label %20
20: ; preds = %15, %11
%21 = call i64 @read(i32 0, i8* %2, i32 4096)
%22 = icmp sgt i64 %21, 0
br i1 %22, label %5, label %23
23: ; preds = %20, %0, %9
ret i32 0
}