// File: afinit[P]afin/gzip.cpp
// Function: Gzip::getline[abi:cxx11]()
string Gzip::getline(){
  size_t next_pos = 0;
  string line( "" );

  // check if buffer has a full line in it, if not, fill_buffer
  while((next_pos = buffer.find( '\n' )) == string::npos && status == Z_OK ){
    fill_buffer();
  }

  // if last line in file, store results for return
  if( status == Z_STREAM_END && next_pos == string::npos ){
    line = buffer;
    buffer = "";

    (void)inflateEnd(&zs);
  }
  // protect against errors
  else if( status != Z_OK && status != Z_STREAM_END ){
    (void)inflateEnd(&zs);
    zerr();
    return "";
  }
  // parse out next line in buffer
  else{
    line = buffer.substr( 0, next_pos );
    buffer.erase( 0, next_pos+1 );
  }

  return line;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x18(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x46e0
movq -0x80(%rbp), %rdx
leaq 0x1b069(%rip), %rsi     # 0x2c1b8
leaq -0x38(%rbp), %rdi
callq 0x4530
jmp 0x1115a
leaq -0x39(%rbp), %rdi
callq 0x4420
movq -0x88(%rbp), %rdi
addq $0x10, %rdi
movl $0xa, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x44f0
movq %rax, %rcx
movq %rcx, -0x18(%rbp)
xorl %eax, %eax
cmpq $-0x1, %rcx
movb %al, -0x99(%rbp)
jne 0x111a5
movq -0x88(%rbp), %rax
cmpl $0x0, 0xc(%rax)
sete %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x111b1
jmp 0x111ec
movq -0x88(%rbp), %rdi
callq 0x10f00
jmp 0x111bf
jmp 0x11163
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x4420
jmp 0x11377
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1136e
movq -0x88(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jne 0x11246
cmpq $-0x1, -0x18(%rbp)
jne 0x11246
movq -0x88(%rbp), %rsi
addq $0x10, %rsi
leaq -0x38(%rbp), %rdi
callq 0x4060
jmp 0x11216
movq -0x88(%rbp), %rdi
addq $0x10, %rdi
leaq 0x1af90(%rip), %rsi     # 0x2c1b8
callq 0x4520
jmp 0x1122f
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
callq 0x4410
jmp 0x11241
jmp 0x1133e
movq -0x88(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x112df
movq -0x88(%rbp), %rax
cmpl $0x1, 0xc(%rax)
je 0x112df
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
callq 0x4410
jmp 0x11276
movq -0x88(%rbp), %rdi
callq 0x108e0
jmp 0x11284
leaq -0x4d(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x46e0
movq -0x98(%rbp), %rdi
movq -0xa8(%rbp), %rdx
leaq 0x1af0f(%rip), %rsi     # 0x2c1b8
callq 0x4530
jmp 0x112b0
leaq -0x4d(%rbp), %rdi
callq 0x4420
movl $0x1, -0x54(%rbp)
jmp 0x11355
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x4d(%rbp), %rdi
callq 0x4420
jmp 0x1136e
movq -0x88(%rbp), %rsi
addq $0x10, %rsi
movq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x78(%rbp), %rdi
callq 0x43e0
jmp 0x112fd
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movq %rsi, -0xb0(%rbp)
callq 0x4480
movq -0xb0(%rbp), %rdi
callq 0x4270
movq -0x88(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rdx
incq %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x40f0
jmp 0x1133a
jmp 0x1133c
jmp 0x1133e
movq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4260
movl $0x1, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4270
movq -0x90(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x4270
movq -0x48(%rbp), %rdi
callq 0x46c0