// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %rcx, 0x48(%rsp)
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x18(%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
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb540
movq (%r15), %rax
movq -0x18(%rax), %rdi
testb $0x2, 0x20(%r15,%rdi)
je 0x12df06
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
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0xb540
movq 0x8(%rsp), %r13
callq 0xb050
movq %rax, %r15
movl (%rax), %ebx
movl $0x0, (%rax)
leaq 0x28(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movl $0xa, %edx
callq 0xb120
movq (%rbp), %rdx
subq %r13, %rdx
je 0x12e0b0
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x12e0bc
testl %ecx, %ecx
jne 0x12df50
movl %ebx, (%r15)
movq %rax, (%r12)
incq %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movl $0x20, %esi
callq 0xb2a0
movq %rax, %r12
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x28(%rsp), %r13
movl (%r15), %ebx
movl $0x0, (%r15)
leaq 0x50(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xb120
movq (%rbp), %rbp
cmpq %r13, %rbp
je 0x12e0c8
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x12e0d4
testl %ecx, %ecx
jne 0x12dfc4
movl %ebx, (%r15)
movq %rax, (%r14)
leaq 0x38(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x12dfe2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
subq %r13, %r12
addq %rbp, %r12
leaq 0x8(%rsp), %rdi
movl $0x20, %esi
movq %r12, %rdx
callq 0xb2a0
xorl %ebx, %ebx
cmpq $-0x1, %rax
je 0x12e07c
movq %rax, %r14
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x28(%rsp), %rdi
movb (%rdi), %bpl
cmpq %r15, %rdi
je 0x12e038
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
cmpb $0x52, %bpl
je 0x12e07c
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0xb310
movq 0x28(%rsp), %rdi
movb (%rdi), %bpl
cmpq %r15, %rdi
je 0x12e071
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
movl $0x1, %ebx
cmpb $0x57, %bpl
jne 0x12e0e0
movq 0x48(%rsp), %rax
movl %ebx, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x12e09f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
movb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cec3(%rip), %rdi     # 0x15af7a
callq 0xb1f0
leaq 0x2ceb7(%rip), %rdi     # 0x15af7a
callq 0xb3d0
leaq 0x2ceab(%rip), %rdi     # 0x15af7a
callq 0xb1f0
leaq 0x2ce9f(%rip), %rdi     # 0x15af7a
callq 0xb3d0
leaq 0x1c2b2(%rip), %rdi     # 0x14a399
leaq 0x2ca26(%rip), %rsi     # 0x15ab14
leaq 0x2cde1(%rip), %rcx     # 0x15aed6
movl $0x196, %edx            # imm = 0x196
callq 0xb200
jmp 0x12e13c
jmp 0x12e13c
jmp 0x12e13c
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x12e111
movl %ebx, (%r15)
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12e13f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x12e13f
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x12e13f
movl %ebx, (%r15)
jmp 0x12e13f
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x12e15b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq %r14, %rdi
callq 0xb510
nop