#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int strlen(char *);
void voidline(FILE *master) {
  char buff[512], ch;
  unsigned long start;
  start = ftell(master);
  fputc('\t', master);
  fflush(master);
  fgets(buff, 512, master);
  if (fgets(buff, 512, master))
    if (buff[0] == '\t' || buff[0] == '\n') {
      fseek(master, -(strlen(buff) + 1), SEEK_CUR);
      fputc('\t', master);
    }
  fflush(master);
  fseek(master, start - 2, SEEK_SET);
  while (fgetc(master) != '\n') {
    if (ftell(master) < 2)
      break;
    fseek(master, -2, SEEK_CUR);
  }
  ch = fgetc(master);
  if (ch == '\t' || ch == '\n') {
    fseek(master, -1, SEEK_CUR);
    fgets(buff, 512, master);
    fseek(master, -1, SEEK_CUR);
    fputc('\t', master);
  }
  fflush(master);
  fseek(master, start, SEEK_SET);
}


x86 assembly (clang, -O0):
<voidline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <ftell@plt>
cltq
mov    %rax,-0x220(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1050 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1080 <fflush@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1247 <voidline+0xd7>
movsbl -0x210(%rbp),%eax
cmp    $0x9,%eax
je     11fc <voidline+0x8c>
movsbl -0x210(%rbp),%eax
cmp    $0xa,%eax
jne    1242 <voidline+0xd2>
mov    -0x8(%rbp),%rax
mov    %rax,-0x228(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x228(%rbp),%rdi
mov    %eax,%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
movslq %eax,%rsi
mov    0x2dbb(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1050 <fputc@plt>
jmp    1247 <voidline+0xd7>
mov    -0x8(%rbp),%rdi
call   1080 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0x220(%rbp),%rsi
sub    $0x2,%rsi
mov    0x2d72(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     12b7 <voidline+0x147>
mov    -0x8(%rbp),%rdi
call   1070 <ftell@plt>
cmp    $0x2,%eax
jge    1299 <voidline+0x129>
jmp    12b7 <voidline+0x147>
mov    -0x8(%rbp),%rdi
mov    0x2d44(%rip),%rax
mov    (%rax),%edx
mov    $0xfffffffffffffffe,%rsi
call   1090 <fseek@plt>
jmp    126d <voidline+0xfd>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x211(%rbp)
movsbl -0x211(%rbp),%eax
cmp    $0x9,%eax
je     12e6 <voidline+0x176>
movsbl -0x211(%rbp),%eax
cmp    $0xa,%eax
jne    133b <voidline+0x1cb>
mov    -0x8(%rbp),%rdi
mov    0x2cf7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffffffffffff,%rsi
call   1090 <fseek@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1060 <fgets@plt>
mov    -0x8(%rbp),%rdi
mov    0x2cc9(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffffffffffff,%rsi
call   1090 <fseek@plt>
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1050 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1080 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0x220(%rbp),%rsi
mov    0x2c82(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voidline>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
call   1070 <ftell@plt>
movslq %eax,%r14
mov    $0x9,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1080 <fflush@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    %r15,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     11fa <voidline+0x8a>
mov    (%rsp),%al
add    $0xf7,%al
cmp    $0x1,%al
ja     11fa <voidline+0x8a>
mov    %rsp,%rdi
call   1030 <strlen@plt>
not    %eax
movslq %eax,%rsi
mov    0x2e05(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1090 <fseek@plt>
mov    $0x9,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1080 <fflush@plt>
lea    -0x2(%r14),%rsi
mov    0x2dcb(%rip),%r15
mov    (%r15),%edx
mov    %rbx,%rdi
call   1090 <fseek@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0xa,%al
je     125c <voidline+0xec>
mov    0x2dbd(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <ftell@plt>
cmp    $0x2,%eax
jl     125c <voidline+0xec>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0xfffffffffffffffe,%rsi
call   1090 <fseek@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0xa,%al
jne    1230 <voidline+0xc0>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
add    $0xf7,%al
cmp    $0x1,%al
ja     12b4 <voidline+0x144>
mov    0x2d77(%rip),%r12
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0xffffffffffffffff,%rsi
call   1090 <fseek@plt>
mov    %rsp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0xffffffffffffffff,%rsi
call   1090 <fseek@plt>
mov    $0x9,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1080 <fflush@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <fseek@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@SEEK_SET = global i32 0
define void @voidline(i32* %0) {
%2 = alloca i32*
%3 = alloca [512 x i8]
%4 = alloca i8
%5 = alloca i64
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @ftell(i32* %6)
%8 = sext i32 %7 to i64
store i64 %8, i64* %5
%9 = load i32*, i32** %2
%10 = call i32 @fputc(i8 signext 9, i32* %9)
%11 = load i32*, i32** %2
%12 = call i32 @fflush(i32* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%14 = load i32*, i32** %2
%15 = call i64 @fgets(i8* %13, i32 512, i32* %14)
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%17 = load i32*, i32** %2
%18 = call i64 @fgets(i8* %16, i32 512, i32* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %42
20: ; preds = %1
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 9
br i1 %24, label %30, label %25
25: ; preds = %20
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 10
br i1 %29, label %30, label %41
30: ; preds = %25, %20
%31 = load i32*, i32** %2
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%33 = call i32 @strlen(i8* %32)
%34 = add nsw i32 %33, 1
%35 = sub nsw i32 0, %34
%36 = sext i32 %35 to i64
%37 = load i32, i32* @SEEK_CUR
%38 = call i32 @fseek(i32* %31, i64 %36, i32 %37)
%39 = load i32*, i32** %2
%40 = call i32 @fputc(i8 signext 9, i32* %39)
br label %41
41: ; preds = %30, %25
br label %42
42: ; preds = %41, %1
%43 = load i32*, i32** %2
%44 = call i32 @fflush(i32* %43)
%45 = load i32*, i32** %2
%46 = load i64, i64* %5
%47 = sub i64 %46, 2
%48 = load i32, i32* @SEEK_SET
%49 = call i32 @fseek(i32* %45, i64 %47, i32 %48)
br label %50
50: ; preds = %60, %42
%51 = load i32*, i32** %2
%52 = call signext i8 @fgetc(i32* %51)
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %64
55: ; preds = %50
%56 = load i32*, i32** %2
%57 = call i32 @ftell(i32* %56)
%58 = icmp slt i32 %57, 2
br i1 %58, label %59, label %60
59: ; preds = %55
br label %64
60: ; preds = %55
%61 = load i32*, i32** %2
%62 = load i32, i32* @SEEK_CUR
%63 = call i32 @fseek(i32* %61, i64 -2, i32 %62)
br label %50
64: ; preds = %59, %50
%65 = load i32*, i32** %2
%66 = call signext i8 @fgetc(i32* %65)
store i8 %66, i8* %4
%67 = load i8, i8* %4
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 9
br i1 %69, label %74, label %70
70: ; preds = %64
%71 = load i8, i8* %4
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 10
br i1 %73, label %74, label %86
74: ; preds = %70, %64
%75 = load i32*, i32** %2
%76 = load i32, i32* @SEEK_CUR
%77 = call i32 @fseek(i32* %75, i64 -1, i32 %76)
%78 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%79 = load i32*, i32** %2
%80 = call i64 @fgets(i8* %78, i32 512, i32* %79)
%81 = load i32*, i32** %2
%82 = load i32, i32* @SEEK_CUR
%83 = call i32 @fseek(i32* %81, i64 -1, i32 %82)
%84 = load i32*, i32** %2
%85 = call i32 @fputc(i8 signext 9, i32* %84)
br label %86
86: ; preds = %74, %70
%87 = load i32*, i32** %2
%88 = call i32 @fflush(i32* %87)
%89 = load i32*, i32** %2
%90 = load i64, i64* %5
%91 = load i32, i32* @SEEK_SET
%92 = call i32 @fseek(i32* %89, i64 %90, i32 %91)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@SEEK_SET = global i32 0
define void @voidline(i32* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @ftell(i32* %0)
%5 = sext i32 %4 to i64
%6 = tail call i32 @fputc(i8 signext 9, i32* %0)
%7 = tail call i32 @fflush(i32* %0)
%8 = call i64 @fgets(i8* %3, i32 512, i32* %0)
%9 = call i64 @fgets(i8* %3, i32 512, i32* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %22, label %11
11: ; preds = %1
%12 = load i8, i8* %3
%13 = add i8 %12, -9
%14 = icmp ult i8 %13, 2
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = call i32 @strlen(i8* %3)
%17 = xor i32 %16, -1
%18 = sext i32 %17 to i64
%19 = load i32, i32* @SEEK_CUR
%20 = call i32 @fseek(i32* %0, i64 %18, i32 %19)
%21 = call i32 @fputc(i8 signext 9, i32* %0)
br label %22
22: ; preds = %15, %11, %1
%23 = call i32 @fflush(i32* %0)
%24 = add nsw i64 %5, -2
%25 = load i32, i32* @SEEK_SET
%26 = call i32 @fseek(i32* %0, i64 %24, i32 %25)
%27 = call signext i8 @fgetc(i32* %0)
%28 = icmp eq i8 %27, 10
br i1 %28, label %37, label %29
29: ; preds = %22, %32
%30 = call i32 @ftell(i32* %0)
%31 = icmp slt i32 %30, 2
br i1 %31, label %37, label %32
32: ; preds = %29
%33 = load i32, i32* @SEEK_CUR
%34 = call i32 @fseek(i32* %0, i64 -2, i32 %33)
%35 = call signext i8 @fgetc(i32* %0)
%36 = icmp eq i8 %35, 10
br i1 %36, label %37, label %29
37: ; preds = %32, %29, %22
%38 = call signext i8 @fgetc(i32* %0)
%39 = add i8 %38, -9
%40 = icmp ult i8 %39, 2
br i1 %40, label %41, label %48
41: ; preds = %37
%42 = load i32, i32* @SEEK_CUR
%43 = call i32 @fseek(i32* %0, i64 -1, i32 %42)
%44 = call i64 @fgets(i8* %3, i32 512, i32* %0)
%45 = load i32, i32* @SEEK_CUR
%46 = call i32 @fseek(i32* %0, i64 -1, i32 %45)
%47 = call i32 @fputc(i8 signext 9, i32* %0)
br label %48
48: ; preds = %37, %41
%49 = call i32 @fflush(i32* %0)
%50 = load i32, i32* @SEEK_SET
%51 = call i32 @fseek(i32* %0, i64 %5, i32 %50)
ret void
}