// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Processor.cpp
// Function: ramulator::Trace::get_unfiltered_request(long&, long&, ramulator::Request::Type&)
bool Trace::get_unfiltered_request(long& bubble_cnt, long& req_addr, Request::Type& req_type)
{
    string line;
    getline(file, line);
    if (file.eof()) {
      file.clear();
      file.seekg(0, file.beg);
      getline(file, line);
      //return false;
    }
    size_t pos, end;
    bubble_cnt = std::stoul(line, &pos, 10);
    pos = line.find_first_not_of(' ', pos+1);
    req_addr = std::stoul(line.substr(pos), &end, 0);

    pos = line.find_first_not_of(' ', pos+end);

    if (pos == string::npos || line.substr(pos)[0] == 'R')
        req_type = Request::Type::READ;
    else if (line.substr(pos)[0] == 'W')
        req_type = Request::Type::WRITE;
    else assert(false);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x40(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x8(%rdi), %rax
addq $0x8, %r15
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %edx
movq %rsp, %rsi
movq %r15, %rdi
callq 0xb540
movq (%r15), %rax
movq -0x18(%rax), %rdi
testb $0x2, 0x20(%r15,%rdi)
je 0x1310f0
addq %r15, %rdi
xorl %esi, %esi
callq 0xb4d0
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xb380
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2c0
movsbl %al, %edx
movq %rsp, %rsi
movq %r15, %rdi
callq 0xb540
movq (%rsp), %r13
callq 0xb050
movq %rax, %r15
movl (%rax), %ebx
movl $0x0, (%rax)
leaq 0x20(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0xb120
movq (%rbp), %rdx
subq %r13, %rdx
je 0x1312a2
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x1312ae
testl %ecx, %ecx
jne 0x131139
movl %ebx, (%r15)
movq %rax, (%r12)
incq %rdx
movq %rsp, %r13
movq %r13, %rdi
movl $0x20, %esi
callq 0xb2a0
movq %rax, %r12
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x20(%rsp), %r13
movl (%r15), %ebx
movl $0x0, (%r15)
leaq 0x48(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xb120
movq (%rbp), %rbp
cmpq %r13, %rbp
je 0x1312ba
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x1312c6
testl %ecx, %ecx
jne 0x1311ab
movl %ebx, (%r15)
movq %rax, (%r14)
leaq 0x30(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x1311c9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb2f0
subq %r13, %r12
addq %rbp, %r12
movq %rsp, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq 0xb2a0
movq %rax, %r14
cmpq $-0x1, %rax
je 0x13120c
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x20(%rsp), %rax
cmpb $0x52, (%rax)
sete %bl
jmp 0x13120e
movb $0x1, %bl
cmpq $-0x1, %r14
je 0x13122b
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x13122b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb2f0
xorl %eax, %eax
testb %bl, %bl
jne 0x13126f
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
movb (%rdi), %bl
cmpq %rax, %rdi
je 0x131265
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb2f0
movl $0x1, %eax
cmpb $0x57, %bl
jne 0x1312d2
movq 0x40(%rsp), %rcx
movl %eax, (%rcx)
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x131291
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb2f0
movb $0x1, %al
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cc71(%rip), %rdi     # 0x15df1a
callq 0xb1f0
leaq 0x2cc65(%rip), %rdi     # 0x15df1a
callq 0xb3d0
leaq 0x2cc59(%rip), %rdi     # 0x15df1a
callq 0xb1f0
leaq 0x2cc4d(%rip), %rdi     # 0x15df1a
callq 0xb3d0
leaq 0x1c080(%rip), %rdi     # 0x14d359
leaq 0x2c7d4(%rip), %rsi     # 0x15dab4
leaq 0x2cb8f(%rip), %rcx     # 0x15de76
movl $0x196, %edx            # imm = 0x196
callq 0xb200
jmp 0x13132e
jmp 0x13132e
jmp 0x13132e
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x131303
movl %ebx, (%r15)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x131331
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x131331
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x131331
movl %ebx, (%r15)
jmp 0x131331
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x13134c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq %r14, %rdi
callq 0xb510