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

/* Variables and functions */
long EOF;
int /*<<< orphan*/ SEEK_CUR;
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int read_line(char **, size_t *, int /*<<< orphan*/ *);
long strtol(char *, char **, int);
long set_to_subtitle_timnig(char **buf, size_t *bufSize, FILE *stream) {
  long fileIndex = 0;
  long lineNumber = 0;
  char *remainder = NULL;
  ssize_t redByte;
  while (!feof(stream)) {
    redByte = read_line(buf, bufSize, stream);
    lineNumber = strtol(*buf, &remainder, 10);
    if (remainder == *buf) {
      continue;
    }
    if (lineNumber > 0)
      ;
    {
      if (remainder[0] == ':' || remainder[0] != '\0') {
        break;
      }
    }
  }
  if (feof(stream)) {
    return EOF;
  }
  fseek(stream, -(redByte + 1), SEEK_CUR);
  fileIndex = ftell(stream);
  return fileIndex;
}


x86 assembly (clang, -O0):
<set_to_subtitle_timnig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    119b <set_to_subtitle_timnig+0x4b>
jmp    1218 <set_to_subtitle_timnig+0xc8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <read_line@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x38(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jne    11de <set_to_subtitle_timnig+0x8e>
jmp    117c <set_to_subtitle_timnig+0x2c>
cmpq   $0x0,-0x30(%rbp)
jle    11ee <set_to_subtitle_timnig+0x9e>
jmp    11ee <set_to_subtitle_timnig+0x9e>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     120e <set_to_subtitle_timnig+0xbe>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1213 <set_to_subtitle_timnig+0xc3>
jmp    1218 <set_to_subtitle_timnig+0xc8>
jmp    117c <set_to_subtitle_timnig+0x2c>
mov    -0x20(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     123e <set_to_subtitle_timnig+0xee>
mov    0x2dae(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    126f <set_to_subtitle_timnig+0x11f>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
xor    %esi,%esi
sub    %eax,%esi
mov    0x2d95(%rip),%rax
mov    (%rax),%edx
call   1060 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_to_subtitle_timnig>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rbp
movq   $0x0,0x8(%rsp)
mov    %rdx,%rdi
call   1040 <feof@plt>
test   %rax,%rax
jne    11d2 <set_to_subtitle_timnig+0x82>
lea    0x8(%rsp),%r12
jmp    119d <set_to_subtitle_timnig+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %rax,%rax
jne    11cf <set_to_subtitle_timnig+0x7f>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <read_line@plt>
mov    %eax,%r15d
mov    0x0(%rbp),%rdi
mov    %r12,%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    0x8(%rsp),%rax
cmp    0x0(%rbp),%rax
je     1190 <set_to_subtitle_timnig+0x40>
cmpb   $0x0,(%rax)
je     1190 <set_to_subtitle_timnig+0x40>
not    %r15d
mov    %rbx,%rdi
call   1040 <feof@plt>
test   %rax,%rax
je     11f6 <set_to_subtitle_timnig+0xa6>
mov    0x2dfa(%rip),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2deb(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1060 <fseek@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@EOF = global i64 0
@SEEK_CUR = global i32 0
define i64 @set_to_subtitle_timnig(i8** %0, i64* %1, i32* %2) {
%4 = alloca i64
%5 = alloca i8**
%6 = alloca i64*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i32
store i8** %0, i8*** %5
store i64* %1, i64** %6
store i32* %2, i32** %7
store i64 0, i64* %8
store i64 0, i64* %9
store i8* null, i8** %10
br label %12
12: ; preds = %47, %29, %3
%13 = load i32*, i32** %7
%14 = call i64 @feof(i32* %13)
%15 = icmp ne i64 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %48
17: ; preds = %12
%18 = load i8**, i8*** %5
%19 = load i64*, i64** %6
%20 = load i32*, i32** %7
%21 = call i32 @read_line(i8** %18, i64* %19, i32* %20)
store i32 %21, i32* %11
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = call i64 @strtol(i8* %23, i8** %10, i32 10)
store i64 %24, i64* %9
%25 = load i8*, i8** %10
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = icmp eq i8* %25, %27
br i1 %28, label %29, label %30
29: ; preds = %17
br label %12
30: ; preds = %17
%31 = load i64, i64* %9
%32 = icmp sgt i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30
br label %34
34: ; preds = %33, %30
%35 = load i8*, i8** %10
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 58
br i1 %39, label %46, label %40
40: ; preds = %34
%41 = load i8*, i8** %10
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %40, %34
br label %48
47: ; preds = %40
br label %12
48: ; preds = %46, %12
%49 = load i32*, i32** %7
%50 = call i64 @feof(i32* %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = load i64, i64* @EOF
store i64 %53, i64* %4
br label %64
54: ; preds = %48
%55 = load i32*, i32** %7
%56 = load i32, i32* %11
%57 = add nsw i32 %56, 1
%58 = sub nsw i32 0, %57
%59 = load i32, i32* @SEEK_CUR
%60 = call i32 @fseek(i32* %55, i32 %58, i32 %59)
%61 = load i32*, i32** %7
%62 = call i64 @ftell(i32* %61)
store i64 %62, i64* %8
%63 = load i64, i64* %8
store i64 %63, i64* %4
br label %64
64: ; preds = %54, %52
%65 = load i64, i64* %4
ret i64 %65
}

LLVM IR (-O2):
@EOF = global i64 0
@SEEK_CUR = global i32 0
define i64 @set_to_subtitle_timnig(i8** %0, i64* %1, i32* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%6 = tail call i64 @feof(i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %3, %15
%9 = tail call i32 @read_line(i8** %0, i64* %1, i32* %2)
%10 = load i8*, i8** %0
%11 = call i64 @strtol(i8* %10, i8** %4, i32 10)
%12 = load i8*, i8** %4
%13 = load i8*, i8** %0
%14 = icmp eq i8* %12, %13
br i1 %14, label %15, label %18
15: ; preds = %8, %18
%16 = tail call i64 @feof(i32* %2)
%17 = icmp eq i64 %16, 0
br i1 %17, label %8, label %21
18: ; preds = %8
%19 = load i8, i8* %12
%20 = icmp eq i8 %19, 0
br i1 %20, label %15, label %21
21: ; preds = %18, %15
%22 = xor i32 %9, -1
br label %23
23: ; preds = %21, %3
%24 = phi i32 [ undef, %3 ], [ %22, %21 ]
%25 = tail call i64 @feof(i32* %2)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = load i64, i64* @EOF
br label %33
29: ; preds = %23
%30 = load i32, i32* @SEEK_CUR
%31 = tail call i32 @fseek(i32* %2, i32 %24, i32 %30)
%32 = tail call i64 @ftell(i32* %2)
br label %33
33: ; preds = %29, %27
%34 = phi i64 [ %28, %27 ], [ %32, %29 ]
ret i64 %34
}