LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/knetfile.c
// Function: socket_wait
static int socket_wait(int fd, int is_read)
{
	fd_set fds, *fdr = 0, *fdw = 0;
	struct timeval tv;
	int ret;
	tv.tv_sec = 5; tv.tv_usec = 0; // 5 seconds time out
	FD_ZERO(&fds);
	FD_SET(fd, &fds);
	if (is_read) fdr = &fds;
	else fdw = &fds;
	ret = select(fd+1, fdr, fdw, 0, &tv);
#ifndef _WIN32
	if (ret == -1) perror("select");
#else
	if (ret == 0)
		fprintf(stderr, "select time-out\n");
	else if (ret == SOCKET_ERROR)
		fprintf(stderr, "select: %d\n", WSAGetLastError());
#endif
	return ret;
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
movq $0x5, (%rsp)
andq $0x0, 0x8(%rsp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x40317
andq $0x0, 0x10(%rsp,%rax,8)
incq %rax
jmp 0x40306
pushq $0x40
popq %rcx
movl %edi, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %edi, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x10(%rsp,%rdx,8)
xorl %eax, %eax
testl %esi, %esi
leaq 0x10(%rsp), %rsi
movl $0x0, %edx
cmoveq %rsi, %rdx
cmoveq %rax, %rsi
incl %edi
movq %rsp, %r8
xorl %ecx, %ecx
callq 0x4500
movl %eax, %ebx
cmpl $-0x1, %eax
je 0x40368
movl %ebx, %eax
addq $0x90, %rsp
popq %rbx
retq
leaq 0x770d(%rip), %rdi      # 0x47a7c
callq 0x4440
jmp 0x4035d
nopw %cs:(%rax,%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMotion(int, int)
void GLUTMotion(int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Compute mouse movement
  int dx = x - GLUTmouse[0];
  int dy = y - GLUTmouse[1];
  
  // World in hand navigation 
  R3Point origin = grid->GridBox().Centroid();
  if (GLUTbutton[0]) viewer->RotateWorld(1.0, origin, x, y, dx, dy);
  else if (GLUTbutton[1]) viewer->ScaleWorld(1.0, origin, x, y, dx, dy);
  else if (GLUTbutton[2]) viewer->TranslateWorld(1.0, origin, x, y, dx, dy);
  if (GLUTbutton[0] || GLUTbutton[1] || GLUTbutton[2]) glutPostRedisplay();

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %edi, %ebp
movl 0xf415b(%rip), %ebx     # 0x116890
subl %esi, %ebx
movl %edi, %r14d
subl 0xf9107(%rip), %r14d    # 0x11b848
movl %ebx, %r15d
subl 0xf9101(%rip), %r15d    # 0x11b84c
movq 0xf905e(%rip), %rsi     # 0x11b7b0
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x23760
movq %rsp, %rdi
movq %r12, %rsi
callq 0x2b4c2
leaq 0x18(%rsp), %rdi
callq 0x2b9d2
cmpl $0x0, 0xf90d5(%rip)     # 0x11b850
je 0x22781
pushq $0x58
jmp 0x22799
cmpl $0x0, 0xf90cc(%rip)     # 0x11b854
je 0x2278e
pushq $0x50
jmp 0x22799
cmpl $0x0, 0xf90c3(%rip)     # 0x11b858
je 0x227bd
pushq $0x48
popq %rax
movq 0xf8fff(%rip), %rdi     # 0x11b7a0
movq (%rdi), %r10
movsd 0x92894(%rip), %xmm0    # 0xb5040
movq %rsp, %rsi
movl %ebp, %edx
movl %ebx, %ecx
movl %r14d, %r8d
movl %r15d, %r9d
callq *(%r10,%rax)
cmpl $0x0, 0xf908c(%rip)     # 0x11b850
jne 0x227d8
cmpl $0x0, 0xf9087(%rip)     # 0x11b854
jne 0x227d8
cmpl $0x0, 0xf9082(%rip)     # 0x11b858
je 0x227dd
callq 0x7dc80
movl %ebp, 0xf9065(%rip)     # 0x11b848
movl %ebx, 0xf9063(%rip)     # 0x11b84c
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2b9d2
movq %rbx, %rdi
callq 0x1fe60
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMouse(int, int, int, int)
void GLUTMouse(int button, int state, int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;
  
  // Process mouse button event

  // Remember button state 
  int b = (button == GLUT_LEFT_BUTTON) ? 0 : ((button == GLUT_MIDDLE_BUTTON) ? 1 : 2);
  GLUTbutton[b] = (state == GLUT_DOWN) ? 1 : 0;

  // Remember modifiers 
  GLUTmodifiers = glutGetModifiers();

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;

  // Redraw
  glutPostRedisplay();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl 0xf407a(%rip), %ebp     # 0x116890
xorl %eax, %eax
cmpl $0x1, %edi
setne %al
incl %eax
subl %ecx, %ebp
xorl %ecx, %ecx
testl %esi, %esi
sete %cl
testl %edi, %edi
cmovel %edi, %eax
leaq 0xf901b(%rip), %rdx     # 0x11b850
movl %ecx, (%rdx,%rax,4)
callq 0x8271e
movl %ebx, 0xf9005(%rip)     # 0x11b848
movl %ebp, 0xf9003(%rip)     # 0x11b84c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7dc80
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/grdview/grdview.cpp
// Function: GLUTMainLoop()
void GLUTMainLoop(void)
{
  // Set default values
  if (grid_threshold == -98765) {
    RNScalar max_threshold = grid->Maximum() - 1.0E-20;
    grid_threshold = grid->Mean() + 3 * grid->StandardDeviation();
    if (grid_threshold > max_threshold) grid_threshold = max_threshold;
  }

  // Set slice coords to middle of grid
  grid_slice_coords[RN_X] = grid->XResolution()/2;
  grid_slice_coords[RN_Y] = grid->YResolution()/2;
  grid_slice_coords[RN_Z] = grid->ZResolution()/2;

  // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
subq $0x18, %rsp
movss 0xf3a4f(%rip), %xmm0    # 0x116880
ucomiss 0x921dc(%rip), %xmm0    # 0xb5014
jne 0x22ea2
jp 0x22ea2
movq 0xf896d(%rip), %rdi     # 0x11b7b0
callq 0x237b8
addsd 0x92220(%rip), %xmm0    # 0xb5070
movsd %xmm0, 0x10(%rsp)
movq 0xf8953(%rip), %rdi     # 0x11b7b0
callq 0x236fc
movsd %xmm0, 0x8(%rsp)
movq 0xf8941(%rip), %rdi     # 0x11b7b0
callq 0x2379c
mulsd 0x921fc(%rip), %xmm0    # 0xb5078
addsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x22e9a
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0xf39de(%rip)    # 0x116880
movq 0xf8907(%rip), %rcx     # 0x11b7b0
movl 0x238(%rcx), %eax
pushq $0x2
popq %rsi
cltd
idivl %esi
movl %eax, 0xf890d(%rip)     # 0x11b7c8
movl 0x23c(%rcx), %eax
cltd
idivl %esi
movl %eax, 0xf8902(%rip)     # 0x11b7cc
movl 0x240(%rcx), %eax
cltd
idivl %esi
movl %eax, 0xf88f7(%rip)     # 0x11b7d0
addq $0x18, %rsp
jmp 0x80c73
// File: /workspace/github_cpp_makefile_star2_O2/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPClient::parseURI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
static struct uri parseURI(std::string uri)
    {
        struct uri toReturn;
        toReturn.port = -1;
        int index = 0;
        while(uri[index] != ':')
        {
            toReturn.protocol += uri[index];
            index++;
        }
        index += 3;
        while(uri[index] != ':' && uri[index] != '/' && index < uri.size())
        {
            toReturn.domain += uri[index];
            index++;
        }
        if(uri[index] == ':')
        {
            index++;
            std::string portTemp;
            while(uri[index] != '/' && index < uri.size())
            {
                portTemp += uri[index];
                index++;
            }
            toReturn.port = std::stoi(portTemp);
        }
        else
        {
            if(toReturn.protocol == "http")
            {
                toReturn.port = 80;
            }
            else if(toReturn.protocol == "https")
            {
                toReturn.port = 443;
            }
        }
        while(index < uri.size())
        {
            toReturn.path += uri[index];
            index++;
        }
        return toReturn;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3698
orl $-0x1, 0x60(%rbx)
pushq $0x3
popq %r12
movq (%r14), %rax
movb -0x3(%rax,%r12), %cl
cmpb $0x3a, %cl
je 0x2b99
movsbl %cl, %esi
movq %rbx, %rdi
callq 0x21b0
incq %r12
jmp 0x2b7c
leaq 0x20(%rbx), %r15
movzbl (%rax,%r12), %eax
cmpl $0x2f, %eax
je 0x2bc5
cmpl $0x3a, %eax
je 0x2be1
cmpq %r12, 0x8(%r14)
jbe 0x2bc5
movsbl %al, %esi
movq %r15, %rdi
callq 0x21b0
incq %r12
movq (%r14), %rax
jmp 0x2b9d
leaq 0x2475(%rip), %rsi      # 0x5041
movq %rbx, %rdi
callq 0x2d72
testb %al, %al
je 0x2c35
movl $0x50, 0x60(%rbx)
jmp 0x2c4f
leaq -0x30(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
incq %r12
leaq -0x40(%rbp), %r15
movq (%r14), %rax
movb (%rax,%r12), %al
cmpb $0x2f, %al
je 0x2c19
cmpq %r12, 0x8(%r14)
jbe 0x2c19
incq %r12
movsbl %al, %esi
movq %r15, %rdi
callq 0x21b0
jmp 0x2bf8
leaq -0x40(%rbp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x36cf
movl %eax, 0x60(%rbx)
leaq -0x40(%rbp), %rdi
callq 0x20f0
jmp 0x2c4f
leaq 0x23ff(%rip), %rsi      # 0x503b
movq %rbx, %rdi
callq 0x2d72
testb %al, %al
je 0x2c4f
movl $0x1bb, 0x60(%rbx)      # imm = 0x1BB
leaq 0x40(%rbx), %r15
movslq %r12d, %r12
cmpq %r12, 0x8(%r14)
jbe 0x2c71
movq (%r14), %rax
movsbl (%rax,%r12), %esi
movq %r15, %rdi
callq 0x21b0
incq %r12
jmp 0x2c56
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c83
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x20f0
jmp 0x2c98
jmp 0x2c95
jmp 0x2c95
movq %rax, %r14
movq %rbx, %rdi
callq 0x366e
movq %r14, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPClient::initalizeSocket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
static int initalizeSocket(std::string address, int port)
    {
        int sockfd;

        struct addrinfo hints;
        struct addrinfo* servinfo;
        struct addrinfo* p;

        memset(&hints, 0, sizeof(hints));
        hints.ai_family = AF_UNSPEC;
        hints.ai_socktype = SOCK_STREAM;

        getaddrinfo(address.c_str(), std::to_string(port).c_str(), &hints, &servinfo);

        for(p = servinfo; p != NULL; p = p->ai_next)
        {
            if((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
            {
                continue;
            }
            if(connect(sockfd, p->ai_addr, p->ai_addrlen) == -1)
            {
                close(sockfd);
                continue;
            }
            break;
        }

        if(p == NULL)
        {
            return -1;
        }

        freeaddrinfo(servinfo);

        return sockfd;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, 0x20(%r14)
movl $0x1, 0x8(%r14)
movq (%rdi), %r15
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x37d4
movq (%rbx), %rsi
leaq -0x20(%rbp), %rbx
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2240
leaq -0x40(%rbp), %rdi
callq 0x20f0
pushq $-0x1
popq %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x2d42
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x2070
cmpl $-0x1, %eax
je 0x2d3c
movl %eax, %r14d
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %eax, %edi
callq 0x21a0
cmpl $-0x1, %eax
jne 0x2d47
movl %r14d, %edi
callq 0x2350
addq $0x28, %rbx
jmp 0x2d03
movl %r15d, %r14d
jmp 0x2d50
movq -0x20(%rbp), %rdi
callq 0x2260
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPHeader::HTTPHeader(bool)
HTTPHeader(bool isRequest_ = false)
    {
        bufferIndex = 0;
        parsingFieldName = true;
        isRequest = isRequest_;
        parsingHeader = true;
        isDone = false;
        currentChunkLength = 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x8(%rdi), %rax
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
leaq 0x48(%rdi), %rax
movq %rax, 0x38(%rdi)
andq $0x0, 0x40(%rdi)
xorl %eax, %eax
movb %al, 0x48(%rdi)
leaq 0x68(%rdi), %rcx
movq %rcx, 0x58(%rdi)
andq $0x0, 0x60(%rdi)
movb %al, 0x68(%rdi)
leaq 0x88(%rdi), %rcx
movq %rcx, 0x78(%rdi)
andq $0x0, 0x80(%rdi)
movb %al, 0x88(%rdi)
leaq 0xa8(%rdi), %rcx
movq %rcx, 0x98(%rdi)
andq $0x0, 0xa0(%rdi)
movb %al, 0xa8(%rdi)
leaq 0xc8(%rdi), %rcx
movq %rcx, 0xb8(%rdi)
andq $0x0, 0xc0(%rdi)
movb %al, 0xc8(%rdi)
leaq 0xf0(%rdi), %rcx
movq %rcx, 0xe0(%rdi)
andq $0x0, 0xe8(%rdi)
movb %al, 0xf0(%rdi)
leaq 0x110(%rdi), %rcx
movq %rcx, 0x100(%rdi)
andq $0x0, 0x108(%rdi)
movb %al, 0x110(%rdi)
leaq 0x138(%rdi), %rcx
movq %rcx, 0x128(%rdi)
andq $0x0, 0x130(%rdi)
movb %al, 0x138(%rdi)
andl $0x0, 0xd8(%rdi)
movb $0x1, 0x120(%rdi)
movb %sil, 0x30(%rdi)
movw $0x1, 0x121(%rdi)
andl $0x0, 0x124(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPHeader::parseData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void parseData(const std::string& input)
    {
        if(headers.find("transfer-encoding") != headers.end() && headers.find("transfer-encoding")->second == "chunked")
        {
            parseChunk(input);
        }
        else
        {
            body += input;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1466(%rip), %rsi      # 0x508a
leaq -0x60(%rbp), %r15
leaq -0x1a(%rbp), %rdx
movq %r15, %rdi
callq 0x2ab0
movq %r14, %rdi
movq %r15, %rsi
callq 0x3fee
leaq 0x8(%r14), %rcx
cmpq %rcx, %rax
je 0x3ca2
leaq 0x143b(%rip), %rsi      # 0x508a
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x2ab0
leaq -0x40(%rbp), %rsi
movq %r14, %rdi
callq 0x3fee
addq $0x40, %rax
leaq 0x1429(%rip), %rsi      # 0x509c
movq %rax, %rdi
callq 0x2d72
movl %eax, %r15d
leaq -0x40(%rbp), %rdi
callq 0x20f0
leaq -0x60(%rbp), %rdi
callq 0x20f0
testb %r15b, %r15b
je 0x3cab
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3cec
jmp 0x3cbd
leaq -0x60(%rbp), %rdi
callq 0x20f0
addq $0x98, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2340
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x20f0
jmp 0x3cdb
jmp 0x3cd8
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/include/tinyopt/tinyopt.h
// Function: to::sink to::action<void (*)(char const*), to::keyword_parser<char const*>>(void (*)(char const*), to::keyword_parser<char const*>)
sink action(F f, P parser) {
    return sink(sink::action,
        [f = std::move(f), parser = std::move(parser)](const char* arg) -> bool {
            return static_cast<bool>(f << parser(arg));
        });
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rbx
movq %rsi, -0x8(%rbx)
movups (%rdx), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rdx), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x8(%rsp), %rsi
callq 0x3656
movq %rbx, %rdi
callq 0x2f62
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f62
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU1::ALU1(Latch<std::tuple<Instruction, int, int>>*, Latch<std::tuple<Instruction, int>>*, bool*, ALU2*, ALU3*, Flusher*, int*, int*)
ALU1::ALU1(	Latch< std::tuple<Instruction, int, int> >* in, 
			Latch< std::tuple<Instruction, int> >* out, bool* b,
			ALU2 *a, ALU3* a3, Flusher *f, int* p, int* pa){
	this->in = in; this->out = out; this->b = b; this->a = a; this->f = f;
	this->predict = p; this->predict_addr = pa; this->a3 = a3;
	// store latencies of operations
	latencies[FUNCT["add"]] = LATENCY_ADD;
	latencies[FUNCT["sub"]] = LATENCY_SUB;
	latencies[0] = 1;
	// set stall cycles to zero
	stall_cycles = 0;
	read = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1349d(%rip), %rax     # 0x16bb0
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x6dd2
leaq 0x88(%rbx), %rax
andl $0x0, 0x88(%rbx)
andq $0x0, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
andq $0x0, 0xa8(%rbx)
leaq 0x80(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %r14, 0xc8(%rbx)
movq %rbp, 0xd0(%rbx)
movq %r13, 0xd8(%rbx)
movq %r12, 0xe0(%rbx)
movaps 0x70(%rsp), %xmm0
movups %xmm0, 0xf0(%rbx)
movq 0x80(%rsp), %rax
movq %rax, 0x100(%rbx)
movq %r15, 0xe8(%rbx)
leaq 0xc868(%rip), %rsi      # 0x10004
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x13a86(%rip), %rdi     # 0x17238
leaq 0x18(%rsp), %rsi
movq 0x10(%rsp), %r15
callq 0x47fa
movq %r15, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x3100
leaq 0xc825(%rip), %rsi      # 0x10008
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x13a3f(%rip), %rdi     # 0x17238
leaq 0x18(%rsp), %rsi
callq 0x47fa
movq %r15, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x3100
andl $0x0, (%r14)
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x489c
movl $0x1, (%rax)
andl $0x0, 0xb0(%rbx)
movb $0x1, 0xc0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3859
jmp 0x3859
movq %rax, %r15
jmp 0x386d
jmp 0x3860
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0x3100
movq 0x10(%rsp), %rdi
callq 0x4954
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x3100
movq %r15, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU1::tick()
void ALU1::tick(void){
	if(stall_cycles == 0){
		if(i.is_valid()){	
			operate();
			in->read();
		}
		if(in->valid() && read){
			auto inp = in->read();
			in->write(inp);
			i = std::get<0>(inp);
			if(i.is_valid())
				read = false;
			in1 = std::get<1>(inp);
			in2 = std::get<2>(inp);
			i.EXEC = CLOCK;
			i.MEM = CLOCK + 1;
			if(i.is_valid() && latencies[std::get<1>(i.type())] == 1){
				operate();
				in->read();
			}else{
				stall_cycles = latencies[std::get<1>(i.type())] - 1;	
			}
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
cmpl $0x0, 0xb0(%rdi)
jne 0x3ce4
movq %rdi, %rbx
cmpl $-0x1, 0xc(%rdi)
je 0x3bdb
cmpl $-0x1, 0x8(%rbx)
je 0x3bdb
movq %rbx, %rdi
callq 0x388c
movq 0xc8(%rbx), %rsi
leaq 0x108(%rsp), %rdi
callq 0x48ea
leaq 0x160(%rsp), %rdi
callq 0x3100
movq 0xc8(%rbx), %rsi
cmpb $0x1, 0x80(%rsi)
jne 0x3ce4
cmpb $0x1, 0xc0(%rbx)
jne 0x3ce4
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x48ea
movq 0xc8(%rbx), %rdi
movq %r14, %rsi
callq 0x4900
leaq 0x8(%rbx), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x490c
cmpl $-0x1, 0xc(%rbx)
setne %cl
cmpl $-0x1, 0x8(%rbx)
setne %al
andb %cl, %al
cmpb $0x1, %al
jne 0x3c44
movb $0x0, 0xc0(%rbx)
movq 0x8(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0xb4(%rbx)
leaq 0x1359e(%rip), %rcx     # 0x171fc
movl (%rcx), %ecx
movl %ecx, 0x48(%rbx)
incl %ecx
movl %ecx, 0x50(%rbx)
testb %al, %al
je 0x3cb6
movq %rsp, %rdi
movq %r14, %rsi
callq 0x7c7c
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x489c
cmpl $0x1, (%rax)
jne 0x3cb6
movq %rbx, %rdi
callq 0x388c
movq 0xc8(%rbx), %rsi
leaq 0x88(%rsp), %rdi
callq 0x48ea
leaq 0xe0(%rsp), %rdi
callq 0x3100
jmp 0x3cda
movq %rsp, %rdi
movq %r14, %rsi
callq 0x7c7c
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x489c
movl (%rax), %eax
decl %eax
movl %eax, 0xb0(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x3100
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
retq
jmp 0x3cf3
jmp 0x3cf3
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU1::tock()
void ALU1::tock(void){
	if(stall_cycles > 0)
		stall_cycles--;
	else {
		if(i.is_valid()){
			if(out->valid()){
				read = false;	// previous data has not been read; stall
			}else{
				read = true;
				out->write(std::make_tuple(i, res));
				Instruction reset; i = reset;
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rdx
movl 0xb0(%rdi), %eax
testl %eax, %eax
jle 0x3d36
decl %eax
movl %eax, 0xb0(%rdx)
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $-0x1, 0xc(%rdx)
je 0x3d29
cmpl $-0x1, 0x8(%rdx)
je 0x3d29
movq 0xd0(%rdx), %r14
cmpb $0x1, 0x80(%r14)
jne 0x3d5c
movb $0x0, 0xc0(%rdx)
jmp 0x3d29
leaq 0x8(%rdx), %rbx
movb $0x1, 0xc0(%rdx)
addq $0xbc, %rdx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x49ac
movq %r14, %rdi
movq %r15, %rsi
callq 0x493c
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rsp, %r14
movq %r14, %rdi
callq 0x6dd2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x490c
leaq 0x50(%rsp), %rdi
callq 0x3100
jmp 0x3d29
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x3dc8
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU2::ALU2(Latch<std::tuple<Instruction, int, int>>*, Latch<std::tuple<Instruction, int, int>>*, bool*)
ALU2::ALU2(	Latch< std::tuple<Instruction, int, int> >* in, 
			Latch< std::tuple<Instruction, int, int> >* out, bool* b){
	this->in = in; this->out = out; this->b = b;
	// store latencies of operations
	latencies[FUNCT["add"]] = LATENCY_ADD;
	latencies[FUNCT["sub"]] = LATENCY_SUB;
	latencies[FUNCT["mult"]] = LATENCY_MULT;
	latencies[FUNCT["div"]] = LATENCY_DIV;
	// set stall cycles to zero
	stall_cycles = 0;
	read = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x12de2(%rip), %rax     # 0x16bd8
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x6dd2
leaq 0x88(%rbx), %rax
andl $0x0, 0x88(%rbx)
andq $0x0, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
andq $0x0, 0xa8(%rbx)
leaq 0x80(%rbx), %r14
movq %r13, 0xc8(%rbx)
movq %r12, 0xd0(%rbx)
movq %r15, 0xd8(%rbx)
leaq 0xc1b3(%rip), %rsi      # 0x10004
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x133d1(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0xc175(%rip), %rsi      # 0x10008
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x1338f(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0xc13f(%rip), %rsi      # 0x10014
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x1334d(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x6, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0xc102(%rip), %rsi      # 0x10019
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x1330b(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x23, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
andl $0x0, 0xb0(%rbx)
movb $0x1, 0xc4(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3f74
jmp 0x3f74
jmp 0x3f74
movq %rax, %r15
jmp 0x3f8c
jmp 0x3f7f
jmp 0x3f7f
jmp 0x3f7f
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x3100
movq %r14, %rdi
callq 0x4954
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x3100
movq %r15, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU2::operate()
void ALU2::operate(void){
	int funct = std::get<1>(i.type());
	if(funct == FUNCT["add"]){
		lo = in1 + in2; hi = 0;
	}else if(funct == FUNCT["sub"]){
		lo = in1 - in2; hi = 0;
	}else if(funct == FUNCT["mult"]){
		lo = (long)((long)in1 * (long)in2) % (long)pow(2, 32); 
		hi = (long)(((long)in1 * (long)in2) / (long)pow(2, 32)); 
	}else if(funct == FUNCT["div"]){
		lo = in1 % in2; hi = (long)(in1 / in2);
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x7c7c
movl (%r14), %ebp
leaq 0xc036(%rip), %rsi      # 0x10004
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x13254(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movl (%rax), %r14d
leaq 0x10(%rsp), %rdi
callq 0x3100
cmpl %r14d, %ebp
jne 0x400e
movl 0xb8(%rbx), %eax
addl 0xb4(%rbx), %eax
jmp 0x4053
leaq 0xbff3(%rip), %rsi      # 0x10008
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x1320d(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movl (%rax), %r14d
leaq 0x10(%rsp), %rdi
callq 0x3100
cmpl %r14d, %ebp
jne 0x406a
movl 0xb4(%rbx), %eax
subl 0xb8(%rbx), %eax
movl %eax, 0xc0(%rbx)
xorl %eax, %eax
movl %eax, 0xbc(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xbfa3(%rip), %rsi      # 0x10014
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x131b1(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movl (%rax), %r14d
leaq 0x10(%rsp), %rdi
callq 0x3100
cmpl %r14d, %ebp
jne 0x40cc
movslq 0xb4(%rbx), %rcx
movslq 0xb8(%rbx), %rax
imulq %rcx, %rax
movl %eax, 0xc0(%rbx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
cqto
idivq %rcx
jmp 0x405b
leaq 0xbf46(%rip), %rsi      # 0x10019
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x1314f(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movl (%rax), %r14d
leaq 0x10(%rsp), %rdi
callq 0x3100
cmpl %r14d, %ebp
jne 0x4061
movl 0xb4(%rbx), %eax
cltd
idivl 0xb8(%rbx)
movl %edx, 0xc0(%rbx)
jmp 0x405b
jmp 0x412d
jmp 0x413c
jmp 0x412d
jmp 0x413c
jmp 0x412d
jmp 0x413c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3100
jmp 0x413f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU2::tock()
void ALU2::tock(void){
	if(stall_cycles > 0)
		stall_cycles--;
	else {
		if(i.is_valid()){
			if(out->valid()){
				read = false;	// previous data has not been read; stall
			}else{
				read = true;
				out->write(std::make_tuple(i, lo, hi));
				Instruction reset; i = reset;
			}
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rcx
movl 0xb0(%rdi), %eax
testl %eax, %eax
jle 0x42f2
decl %eax
movl %eax, 0xb0(%rcx)
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
cmpl $-0x1, 0xc(%rcx)
je 0x42e5
cmpl $-0x1, 0x8(%rcx)
je 0x42e5
movq 0xd0(%rcx), %r14
cmpb $0x1, 0x80(%r14)
jne 0x4318
movb $0x0, 0xc4(%rcx)
jmp 0x42e5
leaq 0x8(%rcx), %rbx
movb $0x1, 0xc4(%rcx)
leaq 0xc0(%rcx), %rdx
addq $0xbc, %rcx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x49e8
movq %r14, %rdi
movq %r15, %rsi
callq 0x4900
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rsp, %r14
movq %r14, %rdi
callq 0x6dd2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x490c
leaq 0x50(%rsp), %rdi
callq 0x3100
jmp 0x42e5
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x438b
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU2::flush(int)
void ALU2::flush(int id){
	if(i.get_id() > id){
		Instruction reset;
		i = reset;
		stall_cycles = 0;
		read = true;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
cmpl %esi, 0x8(%rdi)
jle 0x43e0
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6dd2
movq %r14, %rdi
movq %r15, %rsi
callq 0x490c
andl $0x0, 0xb0(%rbx)
movb $0x1, 0xc4(%rbx)
leaq 0x58(%rsp), %rdi
callq 0x3100
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU3::ALU3(Latch<std::tuple<Instruction, int, int>>*, Latch<std::tuple<Instruction, int>>*, bool*)
ALU3::ALU3(	Latch< std::tuple<Instruction, int, int> >* in, 
			Latch< std::tuple<Instruction, int> >* out, bool* b){
	this->in = in; this->out = out; this->b = b;
	// store latencies of operations
	latencies[FUNCT["add"]] = LATENCY_ADD;
	latencies[FUNCT["sw"]] = LATENCY_SW;
	// set stall cycles to zero
	stall_cycles = 0;
	read = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x127de(%rip), %rax     # 0x16c00
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x6dd2
leaq 0x88(%rbx), %rax
andl $0x0, 0x88(%rbx)
andq $0x0, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movq %rax, 0xa0(%rbx)
andq $0x0, 0xa8(%rbx)
leaq 0x80(%rbx), %r14
movq %r13, 0xc8(%rbx)
movq %r12, 0xd0(%rbx)
movq %r15, 0xd8(%rbx)
leaq 0xbb87(%rip), %rsi      # 0x10004
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x12da5(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
leaq 0xbb5e(%rip), %rsi      # 0x1001d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4860
leaq 0x12d63(%rip), %rdi     # 0x17238
leaq 0x10(%rsp), %rsi
callq 0x47fa
movq %r14, %rdi
movq %rax, %rsi
callq 0x47ac
movl $0x1, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3100
andl $0x0, 0xb0(%rbx)
movb $0x1, 0xc0(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x4518
movq %rax, %r15
jmp 0x452c
jmp 0x451f
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x3100
movq %r14, %rdi
callq 0x4954
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x3100
movq %r15, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU3::tick()
void ALU3::tick(void){
	if(in->valid() && read){
		auto inp = in->read();
		in->write(inp);
		i = std::get<0>(inp);
		if(i.is_valid())
			read = false;
		in1 = std::get<1>(inp);
		in2 = std::get<2>(inp);
		i.EXEC = CLOCK;
		i.RF2 = CLOCK + 1;
		if(i.is_valid() && latencies[std::get<1>(i.type())] == 1){
			res = in1 + in2;
			in->read();
		}
		else{
			stall_cycles = latencies[std::get<1>(i.type())] - 1;	
		}
	} 
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq 0xc8(%rdi), %rsi
cmpb $0x1, 0x80(%rsi)
jne 0x4668
movq %rdi, %rbx
cmpb $0x1, 0xc0(%rdi)
jne 0x4668
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x48ea
movq 0xc8(%rbx), %rdi
movq %r14, %rsi
callq 0x4900
leaq 0x10(%rsp), %rsi
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x490c
cmpl $-0x1, 0xc(%rbx)
setne %cl
cmpl $-0x1, 0x8(%rbx)
setne %al
andb %cl, %al
cmpb $0x1, %al
jne 0x45be
movb $0x0, 0xc0(%rbx)
movq 0x8(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0xb4(%rbx)
leaq 0x12c24(%rip), %rcx     # 0x171fc
movl (%rcx), %ecx
movl %ecx, 0x48(%rbx)
incl %ecx
movl %ecx, 0x4c(%rbx)
testb %al, %al
je 0x463a
movq %rsp, %rdi
movq %r14, %rsi
callq 0x7c7c
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x489c
cmpl $0x1, (%rax)
jne 0x463a
movl 0xb8(%rbx), %eax
addl 0xb4(%rbx), %eax
movl %eax, 0xbc(%rbx)
movq 0xc8(%rbx), %rsi
leaq 0x88(%rsp), %rdi
callq 0x48ea
leaq 0xe0(%rsp), %rdi
callq 0x3100
jmp 0x465e
movq %rsp, %rdi
movq %r14, %rsi
callq 0x7c7c
leaq 0x80(%rbx), %rdi
movq %rsp, %rsi
callq 0x489c
movl (%rax), %eax
decl %eax
movl %eax, 0xb0(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x3100
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
jmp 0x4677
jmp 0x4677
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/alu.cpp
// Function: ALU3::flush(int)
void ALU3::flush(int id){
	if(i.get_id() > id){
		Instruction reset;
		i = reset;
		stall_cycles = 0;
		read = true;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
cmpl %esi, 0x8(%rdi)
jle 0x478a
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x6dd2
movq %r14, %rdi
movq %r15, %rsi
callq 0x490c
andl $0x0, 0xb0(%rbx)
movb $0x1, 0xc0(%rbx)
leaq 0x58(%rsp), %rdi
callq 0x3100
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/decoder.cpp
// Function: Decoder::Decoder(std::deque<Instruction, std::allocator<Instruction>>*, FreeList*, ActiveList*, int*, bool*, IntegerQueue*, AddressQueue*, int*, int*, Fetcher*)
Decoder::Decoder(Buffer<Instruction>* d, FreeList *f, ActiveList *a, int *r, 
				bool *b, IntegerQueue *iq, AddressQueue *aq, int *p, int *pa,
				Fetcher *ft){
	this->d = d; this->f = f; this->a = a;
	this->r = r; this->b = b; this->iq = iq;
	this->aq = aq; this->predict = p; this->predict_addr = pa;
	this->ft = ft;
	decode_signal = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x11a84(%rip), %rax     # 0x16c80
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x59f8
movq %r13, 0x58(%rbp)
movq %r12, 0x60(%rbp)
movq %r15, 0x68(%rbp)
movq %r14, 0x70(%rbp)
movq %rbx, 0x78(%rbp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, 0x80(%rbp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, 0x98(%rbp)
movq 0x60(%rsp), %rax
movq %rax, 0xa8(%rbp)
movb $0x1, 0x90(%rbp)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/decoder.cpp
// Function: Decoder::tock()
void Decoder::tock(void){
	int cnt = 0;
	size_t i = 0; 
	while(!_q.empty() && cnt < INSTR_DECODED_PER_CYCLE && i < _q.size()){
		int ret = decode_instr(_q[i]);
		if(ret < 0){
			++i;
		}else if(ret == 0){
			_q.erase(_q.begin() + i);
			cnt++;
		}else{
			_q.clear();
			d->clear();
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %r15
leaq 0x18(%rdi), %r12
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x38(%r14), %rax
cmpq 0x18(%r14), %rax
je 0x589b
cmpl $0x1, %ebp
jg 0x589b
movq %r15, %rdi
callq 0x5968
cmpq %rax, %r13
jae 0x589b
movq %r12, %rdi
movq %r13, %rsi
callq 0x5e92
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x49ba
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5256
movl %eax, %ebx
leaq 0xd0(%rsp), %rdi
callq 0x3100
testl %ebx, %ebx
js 0x5846
je 0x584b
movq %r15, %rdi
callq 0x59d0
movq 0x58(%r14), %rdi
callq 0x59d0
jmp 0x57cd
incq %r13
jmp 0x57cd
movups 0x18(%r14), %xmm0
movaps %xmm0, (%rsp)
movups 0x28(%r14), %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movq %r13, %rdx
callq 0x59b0
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x50(%rsp)
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
callq 0x5978
incl %ebp
jmp 0x57cd
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/decoder.cpp
// Function: Decoder::flush(int)
void Decoder::flush(int id){
	// clean eveerything, no check needed
	_q.clear();
	d->clear();
	a->flush(id);
	iq->flush(id);
	aq->flush(id);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addq $0x8, %rdi
callq 0x59d0
movq 0x58(%r14), %rdi
callq 0x59d0
movq 0x68(%r14), %rdi
movl %ebx, %esi
callq 0x8f9c
movq 0x80(%r14), %rdi
movl %ebx, %esi
callq 0xcfde
movq 0x88(%r14), %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd95a
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/fetcher.cpp
// Function: Fetcher::tock()
void Fetcher::tock(void){
	for(int i = 0; i < INSTR_FETCHED_PER_CYCLE; ++i){
		if((unsigned int)_PC < cache->size() && (*cache)[_PC].is_valid() && dest->size() < FETCH_QUEUE_SIZE){
			Instruction temp = (*cache)[_PC++];
			temp.IF = CLOCK;
			dest->push_back(temp);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r14
pushq $0x2
popq %rbp
leaq 0x50(%rsp), %rbx
movq %rsp, %r15
leaq 0x10915(%rip), %r12     # 0x171fc
subl $0x1, %ebp
jb 0x6971
movl 0x8(%r14), %r13d
movq 0x10(%r14), %rdi
callq 0x5968
cmpq %r13, %rax
jbe 0x68e7
movq 0x10(%r14), %rdi
movslq 0x8(%r14), %rsi
addq $0x10, %rdi
callq 0x5e92
cmpl $-0x1, 0x4(%rax)
je 0x68e7
cmpl $-0x1, (%rax)
je 0x68e7
movq 0x18(%r14), %rdi
callq 0x5968
cmpq $0x1f, %rax
ja 0x68e7
movq 0x10(%r14), %rdi
movslq 0x8(%r14), %rsi
leal 0x1(%rsi), %eax
movl %eax, 0x8(%r14)
addq $0x10, %rdi
callq 0x5e92
movq %r15, %rdi
movq %rax, %rsi
callq 0x49ba
movl (%r12), %eax
movl %eax, 0x34(%rsp)
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x5910
movq %rbx, %rdi
callq 0x3100
jmp 0x68e7
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/flusher.cpp
// Function: Flusher::flush(int, int)
void Flusher::flush(int id, int PC){
	is->flush(id);
	d->flush(id);
	f->update_PC(PC);
	w->flush(id);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x10(%r14), %rdi
movq (%rdi), %rax
movl %ebp, %esi
callq *0x10(%rax)
movq 0x8(%r14), %rdi
movl %ebx, %esi
callq 0x6994
movq 0x18(%r14), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::attach_latch(int, Latch<std::tuple<Instruction, int, int>>*, int)
void Issuer::attach_latch(int idx, Latch< std::tuple<Instruction, int, int> > *l,int type){
	this->l[idx] = l;
	if(type == 2)
		addrescal_latch =idx;
	if(type == 3)
		memory_latch = idx;
}

// Assembly:
movslq %esi, %rax
movq %rdx, 0x1e8(%rdi,%rax,8)
cmpl $0x3, %ecx
je 0x8178
cmpl $0x2, %ecx
jne 0x817e
movl %esi, 0x220(%rdi)
retq
movl %esi, 0x224(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::tick()
void Issuer::tick(void){
	if(outer_latch->valid()){
		auto temp = outer_latch->read();
		if (last_index_issued >= 0 && last_index_issued < 1e8){
			aq->_addr[last_index_issued] = std::get<1>(temp);
			aq->_q[last_index_issued] = std::get<0>(temp); 
		}
	}

	for(int j=0; j < NUM_ALU; ++j){
		if(!l[j]->valid()){
			if(j == addrescal_latch){
				auto temp = aq->ALUissue();				
				i[j] = std::get<0>(temp);
				last_index_issued = present_index_issued;
				present_index_issued = std::get<1>(temp);
			}else if(j == memory_latch){
				auto temp = aq->MEMissue();
				i[j] = std::get<0>(temp);
				mem_address = std::get<1>(temp);
				int temp_index = std::get<2>(temp);
				if(i[j].is_valid()){
					if(temp_index <= last_index_issued)
						--last_index_issued;
					if(temp_index <= present_index_issued)
						--present_index_issued;
				}
			}else{
				i[j] = iq->issue(j);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x238(%rdi), %rsi
cmpb $0x1, 0x80(%rsi)
jne 0x820c
leaq 0x8(%rsp), %rdi
callq 0x86f0
movl 0x228(%rbx), %esi
cmpq $0x5f5e0ff, %rsi        # imm = 0x5F5E0FF
ja 0x8202
leaq 0x10(%rsp), %r14
movl -0x8(%r14), %ebp
movq 0x210(%rbx), %rdi
addq $0x68, %rdi
callq 0x872a
movl %ebp, (%rax)
movq 0x210(%rbx), %rdi
movslq 0x228(%rbx), %rsi
addq $0x10, %rdi
callq 0x5e92
movq %rax, %rdi
movq %r14, %rsi
callq 0x490c
leaq 0x60(%rsp), %rdi
callq 0x3100
leaq 0x8(%rbx), %r12
leaq 0x10(%rsp), %r14
leaq 0x60(%rsp), %r15
xorl %r13d, %r13d
leaq 0x8(%rsp), %rbp
cmpq $0x4, %r13
je 0x8326
movq 0x1e8(%rbx,%r13,8), %rax
cmpb $0x0, 0x80(%rax)
jne 0x831a
movl 0x220(%rbx), %eax
cmpq %rax, %r13
jne 0x8284
movq 0x210(%rbx), %rsi
movq %rbp, %rdi
callq 0xd806
movq %r12, %rdi
movq %r14, %rsi
callq 0x490c
movl 0x22c(%rbx), %eax
movl %eax, 0x228(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x22c(%rbx)
movq %r15, %rdi
jmp 0x8315
movl 0x224(%rbx), %eax
cmpq %rax, %r13
jne 0x82f3
movq 0x210(%rbx), %rsi
movq %rbp, %rdi
callq 0xd106
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x490c
movl 0xc(%rsp), %eax
movl %eax, 0x230(%rbx)
cmpl $-0x1, 0x4(%r12)
je 0x82ec
cmpl $-0x1, (%r12)
je 0x82ec
movl 0x8(%rsp), %eax
movl 0x228(%rbx), %ecx
cmpl %ecx, %eax
jg 0x82da
decl %ecx
movl %ecx, 0x228(%rbx)
movl 0x22c(%rbx), %ecx
cmpl %ecx, %eax
jg 0x82ec
decl %ecx
movl %ecx, 0x22c(%rbx)
leaq 0x60(%rsp), %rdi
jmp 0x8315
movq 0x208(%rbx), %rsi
movq %rbp, %rdi
movl %r13d, %edx
callq 0xc884
movq %r12, %rdi
movq %rbp, %rsi
callq 0x646c
leaq 0x58(%rsp), %rdi
callq 0x3100
incq %r13
addq $0x78, %r12
jmp 0x8222
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x833a
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x834a
movq %rax, %rbx
movq %r15, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::tock()
void Issuer::tock(void){
	for(int j=0; j < NUM_ALU; ++j){
		if(!l[j]->valid() && i[j].is_valid()){		// write only when previous data has been read
			auto regs = i[j].physical_regs();
			if(j == addrescal_latch){
				int immediate = i[j].get_immediate();
				l[j]->write(std::make_tuple(i[j], immediate, rf->read(std::get<1>(regs))));
				i[j] = Instruction();
			}else if(j == memory_latch){
				l[j]->write(std::make_tuple(i[j], mem_address, rf->read(std::get<0>(regs))));
				i[j] = Instruction();
			}else{
				l[j]->write(std::make_tuple(i[j], rf->read(std::get<0>(regs)), rf->read(std::get<1>(regs))));
				i[j] = Instruction();
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %r14
leaq 0x8(%rdi), %r12
leaq 0x230(%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
leaq 0x10(%rsp), %rbp
leaq 0x28(%rsp), %rbx
cmpq $0x4, %r15
je 0x84cd
movq 0x1e8(%r14,%r15,8), %rax
cmpb $0x0, 0x80(%rax)
jne 0x84c1
cmpl $-0x1, 0x4(%r12)
je 0x84c1
cmpl $-0x1, (%r12)
je 0x84c1
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7c52
movl 0x220(%r14), %eax
cmpq %rax, %r15
jne 0x8417
movl 0x30(%r12), %eax
movq 0x1e8(%r14,%r15,8), %r13
movq 0x218(%r14), %rcx
movslq 0x18(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x28(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x49ba
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4900
jmp 0x8497
movl 0x224(%r14), %eax
movq 0x1e8(%r14,%r15,8), %r13
cmpq %rax, %r15
jne 0x8460
movq 0x218(%r14), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x8706
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4900
jmp 0x8497
movq 0x218(%r14), %rax
movslq 0x1c(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movslq 0x18(%rsp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, 0x28(%rsp)
movl %ecx, 0x2c(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x49ba
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4900
leaq 0x80(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x6dd2
movq %r12, %rdi
movq %rbx, %rsi
callq 0x646c
leaq 0x78(%rsp), %rdi
callq 0x3100
incq %r15
addq $0x78, %r12
jmp 0x8389
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x84e3
jmp 0x84e3
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::flush(int)
void Issuer::flush(int id){
	iq->flush(id);

	for(int j=0; j < NUM_ALU; ++j){
		if(i[j].is_valid() && i[j].get_id() > id){
			i[j] = Instruction();
		}
	}

	for(int j=0; j < NUM_ALU; ++j){
		if(l[j]->valid()){
			auto inp = l[j]->read();
			auto iRead = std::get<0>(inp);
			auto in1 = std::get<1>(inp);
			auto in2 = std::get<2>(inp);
			if(iRead.get_id() < id){
				l[j]->write(std::make_tuple(iRead, in1, in2 ));
			}
		}
	}
	if(outer_latch->valid()){
			auto inp = outer_latch->read();
			auto iRead = std::get<0>(inp);
			auto in1 = std::get<1>(inp);
			if(iRead.get_id() < id){
				outer_latch->write(std::make_tuple(iRead, in1));
			}
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %esi, %ebp
movq %rdi, %rbx
movq 0x208(%rdi), %rdi
callq 0xcfde
leaq 0x8(%rbx), %r13
xorl %r14d, %r14d
movq %rsp, %r15
cmpq $0x1e0, %r14            # imm = 0x1E0
je 0x856e
cmpl $-0x1, 0x4(%r13,%r14)
je 0x8568
movl (%r13,%r14), %eax
cmpl $-0x1, %eax
je 0x8568
cmpl %ebp, %eax
jle 0x8568
leaq (%r14,%r13), %r12
movq %r15, %rdi
callq 0x6dd2
movq %r12, %rdi
movq %r15, %rsi
callq 0x646c
leaq 0x50(%rsp), %rdi
callq 0x3100
addq $0x78, %r14
jmp 0x8528
xorl %r13d, %r13d
movq %rsp, %r12
leaq 0x80(%rsp), %r14
cmpq $0x4, %r13
je 0x8615
movq 0x1e8(%rbx,%r13,8), %rsi
cmpb $0x1, 0x80(%rsi)
jne 0x860d
movq %r12, %rdi
callq 0x48ea
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x49ba
cmpl %ebp, 0x80(%rsp)
jge 0x85f6
movq 0x1e8(%rbx,%r13,8), %r15
movq (%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x100(%rsp), %rdi
movq %r14, %rsi
callq 0x49ba
movq %r15, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x4900
leaq 0x150(%rsp), %rdi
callq 0x3100
leaq 0xd0(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
incq %r13
jmp 0x857c
movq 0x238(%rbx), %rsi
cmpb $0x0, 0x80(%rsi)
je 0x869e
movq %rsp, %rdi
callq 0x86f0
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x49ba
cmpl %ebp, 0x80(%rsp)
jge 0x8687
movl (%rsp), %eax
movq 0x238(%rbx), %rbx
leaq 0x100(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x80(%rsp), %rsi
callq 0x49ba
leaq 0xf8(%rsp), %rsi
movq %rbx, %rdi
callq 0x493c
leaq 0x150(%rsp), %rdi
callq 0x3100
leaq 0xd0(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x86b6
jmp 0x86c8
jmp 0x86da
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x3100
jmp 0x86cb
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x3100
jmp 0x86dd
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/lists.cpp
// Function: FreeList::find()
int FreeList::find(){
	for(int i = 0; i < NUM_PHY_REGS; i++) {
		if(free[i]) 
			return i;
	}
	return -1;
}

// Assembly:
xorl %ecx, %ecx
pushq $-0x1
popq %rax
cmpq $0x40, %rcx
je 0x8dea
cmpb $0x0, (%rdi,%rcx)
jne 0x8de8
incq %rcx
jmp 0x8dd7
movl %ecx, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/lists.cpp
// Function: ActiveList::push(Instruction)
int ActiveList::push(Instruction instr){
	if(_q.size() < ACTIVE_LIST_SIZE){
		_q.push_back({instr, false});
		return 0;
	}else{
		return -1;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x90b2
cmpq $0x3f, %rax
ja 0x8e6d
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x49ba
movb $0x0, 0x78(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9388
leaq 0x50(%rsp), %rdi
callq 0x3100
xorl %eax, %eax
jmp 0x8e70
pushq $-0x1
popq %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O2/ys1998[P]spsim/src/lists.cpp
// Function: ActiveList::graduate(Instruction&)
void ActiveList::graduate(Instruction& instr){
	for(auto& p : _q){
		if(p.first.get_id() == instr.get_id()){
			p.second = true;
			// update the clock times
			p.first.IF = instr.IF;
			p.first.DE = instr.DE;
			p.first.RF1 = instr.RF1;
			p.first.EXEC = instr.EXEC;
			p.first.RF2 = instr.RF2;
			p.first.MEM = instr.MEM;
			p.first.WB = instr.WB;
			break;
		}
	}

	while(!_q.empty() && _q.front().second){
		Instruction temp = _q.front().first;
		std::tuple<int, int, int, int> t = temp.physical_regs();
		if(std::get<3>(t) != -1){
			f->add(std::get<3>(t));
		}
		o->push_back(temp);
		_q.pop_front();
		if(_q.empty())
			terminate = true;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
movq 0x20(%rdi), %r9
movq 0x28(%rdi), %rdi
movq 0x30(%rbx), %rcx
movl (%rax), %r8d
movq %rsi, %rdx
cmpq %rcx, %rdx
je 0x8efc
cmpl %r8d, (%rdx)
je 0x8ee2
subq $-0x80, %rdx
cmpq %r9, %rdx
jne 0x8ebe
movq 0x8(%rdi), %rdx
addq $0x8, %rdi
leaq 0x200(%rdx), %r9
jmp 0x8ebe
movb $0x1, 0x78(%rdx)
movups 0x34(%rax), %xmm0
movups %xmm0, 0x34(%rdx)
movq 0x44(%rax), %rdi
movq %rdi, 0x44(%rdx)
movl 0x4c(%rax), %eax
movl %eax, 0x4c(%rdx)
leaq 0x68(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0xe2ee(%rip), %r13      # 0x17200
cmpq %rsi, %rcx
je 0x8f77
cmpb $0x1, 0x78(%rsi)
jne 0x8f77
movq %r15, %rdi
callq 0x49ba
movq %r12, %rdi
movq %r15, %rsi
callq 0x7c52
movl 0x8(%rsp), %esi
cmpl $-0x1, %esi
je 0x8f42
movq 0x58(%rbx), %rdi
callq 0x87da
movq 0x50(%rbx), %rdi
movq %r15, %rsi
callq 0x5910
movq %rbx, %rdi
callq 0x90c2
movq 0x30(%rbx), %rax
cmpq 0x10(%rbx), %rax
jne 0x8f65
movb $0x1, (%r13)
movq %r14, %rdi
callq 0x3100
movq 0x10(%rbx), %rsi
movq 0x30(%rbx), %rcx
jmp 0x8f12
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3320
nop