LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setIsland()
void setIsland()
{
	if(cfg.mapIsland)
	 {
		 for(int i=0;i<WIDTH;i++)
		 {
			for(int j=0;j<HEIGHT;j++)
			{
				if(i<2 || j<2 || i>WIDTH-3 || j>HEIGHT-3)
				{
					map[i][j].kind = '-';
					map[i][j].origin = '-';
					map[i][j].walkable=false;
				}
			}
		 }
	 }

	 return;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x3b61(%rip), %rax      # 0x7198
cmpb $0x1, 0x44(%rax)
jne 0x368c
leaq 0x3b9c(%rip), %rax      # 0x71e0
xorl %ecx, %ecx
leal -0x4e(%rcx), %edx
movl $0xffffffee, %esi       # imm = 0xFFFFFFEE
xorl %edi, %edi
cmpl $-0x4c, %edx
setae %r8b
cmpl $-0x10, %esi
setae %r9b
testb %r9b, %r8b
jne 0x366e
movw $0x2d2d, (%rax,%rdi)    # imm = 0x2D2D
movb $0x0, 0x9(%rax,%rdi)
incl %esi
addq $0xc, %rdi
cmpq $0xf0, %rdi
jne 0x3650
incq %rcx
addq $0xf0, %rax
cmpq $0x50, %rcx
jne 0x3646
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: initPeople()
void initPeople()
{
	int x,y;
	for(int k=0;k<POPULATION;k++)
	{
		do
		{
			x = rand() % WIDTH;
			y = rand() % HEIGHT;
		} while(map[x][y].villagerHere || map[x][y].kind=='-');

		people[k].position[0]=x;
		people[k].position[1]=y;
		people[k].underMe=map[x][y].kind;
		map[x][y].villagerHere=true;
		people[k].pathCoordinates = people[k].setPath();
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %r14d, %r14d
leaq 0x3b37(%rip), %r15      # 0x71e0
leaq 0x8630(%rip), %r12      # 0xbce0
callq 0x2070
movslq %eax, %r13
imulq $0x66666667, %r13, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
shll $0x4, %eax
leal (%rax,%rax,4), %eax
subl %eax, %r13d
callq 0x2070
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rcx
addl %edx, %ecx
shll $0x2, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movslq %r13d, %rcx
movslq %eax, %rdx
imulq $0xf0, %rcx, %rcx
addq %r15, %rcx
leaq (%rdx,%rdx,2), %rdx
cmpb $0x0, 0xa(%rcx,%rdx,4)
jne 0x36b0
leaq (%rcx,%rdx,4), %rcx
movb 0x1(%rcx), %dl
cmpb $0x2d, %dl
je 0x36b0
leaq (%r14,%r14,2), %rbx
shlq $0x4, %rbx
leaq (%r12,%rbx), %rsi
movl %r13d, 0xc(%r12,%rbx)
movl %eax, 0x10(%r12,%rbx)
movb %dl, 0x14(%r12,%rbx)
movb $0x1, 0xa(%rcx)
leaq -0x40(%rbp), %rdi
callq 0x3a52
movq 0x18(%r12,%rbx), %rdi
movq 0x28(%r12,%rbx), %rsi
movq -0x40(%rbp), %rax
movq %rax, 0x18(%r12,%rbx)
movq -0x38(%rbp), %rax
movq %rax, 0x20(%r12,%rbx)
movq -0x30(%rbp), %rax
movq %rax, 0x28(%r12,%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
testq %rdi, %rdi
je 0x379d
subq %rdi, %rsi
callq 0x2190
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x379d
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
incq %r14
cmpq $0x19, %r14
jne 0x36b0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::fishing()
void Person::fishing()
{
    if(checkAround(this->position[0],this->position[1],'-'))
    {
        this->working = true;
        fish++;
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %edi
movl 0x10(%rbx), %esi
movl $0x2d, %edx
callq 0x44dc
testb %al, %al
je 0x37e6
movb $0x1, 0x15(%rbx)
leaq 0x89b4(%rip), %rax      # 0xc198
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::woodcutting()
void Person::woodcutting()
{
    if(this->underMe=='|')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        wood++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x7c, 0x14(%rdi)
jne 0x3842
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x8989(%rip), %rdx      # 0xc194
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x3799(%rip), %rcx      # 0x6fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x3841
leaq (%rcx,%rax,4), %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::farming()
void Person::farming()
{
    if(this->underMe=='.')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        food++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x2e, 0x14(%rdi)
jne 0x3898
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x893b(%rip), %rdx      # 0xc19c
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x3743(%rip), %rcx      # 0x6fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x3897
leaq (%rcx,%rax,4), %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::mining()
void Person::mining()
{
    if(this->underMe=='^')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        stone++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x5e, 0x14(%rdi)
jne 0x38ee
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x88e9(%rip), %rdx      # 0xc1a0
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x36ed(%rip), %rcx      # 0x6fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x38ed
leaq (%rcx,%rax,4), %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::move()
void Person::move()
{
    map[this->position[0]][this->position[1]].villagerHere = false;
    //move along the path
    //if we don't have a path we create it
    if(this->pathCoordinates.empty())
    {
        cout << "Arrived, looking for another path" << endl;
        this->pathCoordinates = this->setPath();
    }
    this->position[0] = get<0>(this->pathCoordinates.front());
    this->position[1] = get<1>(this->pathCoordinates.front());
    //remove first element
    this->pathCoordinates.erase (this->pathCoordinates.begin());

    this->underMe = map[this->position[0]][this->position[1]].kind;
    map[this->position[0]][this->position[1]].villagerHere = true;

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
leaq (%rcx,%rcx,2), %rcx
imulq $0xf0, %rax, %rax
addq 0x36a0(%rip), %rax      # 0x6fb8
movb $0x0, 0xa(%rax,%rcx,4)
movq 0x18(%rdi), %rcx
movq 0x20(%rdi), %rax
cmpq %rax, %rcx
jne 0x39d7
movq 0x369b(%rip), %r14      # 0x6fd0
leaq 0x17d8(%rip), %rsi      # 0x5114
movl $0x21, %edx
movq %r14, %rdi
callq 0x21c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3a52
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rsi
movq (%r14), %rax
movq %rax, 0x18(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x28(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
testq %rdi, %rdi
je 0x39cf
subq %rdi, %rsi
callq 0x2190
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x39cf
movq -0x20(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %rax
movl 0x4(%rcx), %edx
movl %edx, 0xc(%rbx)
movl (%rcx), %edi
movl %edi, 0x10(%rbx)
leaq 0x8(%rcx), %r8
cmpq %rax, %r8
je 0x3a1c
movq %rax, %rsi
subq %r8, %rsi
sarq $0x3, %rsi
testq %rsi, %rsi
jle 0x3a1c
incq %rsi
addq $0xc, %rcx
movq -0x4(%rcx), %rdx
movq %rdx, -0xc(%rcx)
decq %rsi
addq $0x8, %rcx
cmpq $0x1, %rsi
ja 0x3a01
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %edi
addq $-0x8, %rax
movq %rax, 0x20(%rbx)
movslq %edx, %rax
movslq %edi, %rcx
imulq $0xf0, %rax, %rax
addq 0x3580(%rip), %rax      # 0x6fb8
leaq (%rcx,%rcx,2), %rcx
movb 0x1(%rax,%rcx,4), %dl
movb %dl, 0x14(%rbx)
movb $0x1, 0xa(%rax,%rcx,4)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::setPath()
vector<tuple<int, int>> Person::setPath()
{
    vector<tuple<int, int> > path;
    tuple<int, int> objective = findOneFree(this->preferredTerrain);

    //at the moment, since everything is walkable, move right/left until
    //pos[x] is equal to objective one, then move straight to objective
    int x = this->position[0];
    int y = this->position[1];
    int objectiveX = get<0>(objective);
    int objectiveY = get<1>(objective);
    while(x != objectiveX)
    {
        if(x < objectiveX)
        x++;
        else
        x--;
        path.emplace_back(x,y);
    }
    while(y != objectiveY)
    {
        if(y < objectiveY)
        y++;
        else
        y--;
        path.emplace_back(x,y);
    }

    if(path.empty())
    {
        path.emplace_back(this->position[0], this->position[1]);
    }

    return path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movsbl 0x4(%rsi), %esi
leaq -0x48(%rbp), %rdi
movq %rdi, %r15
callq 0x45ec
leaq 0xc(%r14), %rax
movq %rax, -0x38(%rbp)
movl 0xc(%r14), %eax
leaq -0x30(%rbp), %r12
movl %eax, (%r12)
movl 0x10(%r14), %eax
addq $0x10, %r14
movq %r14, -0x40(%rbp)
leaq -0x2c(%rbp), %r13
movl %eax, (%r13)
movq %r15, %rax
movl (%r15), %r15d
movl 0x4(%rax), %r14d
movl -0x30(%rbp), %eax
cmpl %r14d, %eax
je 0x3adf
setl %cl
movzbl %cl, %ecx
leal (%rax,%rcx,2), %eax
decl %eax
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3bf2
jmp 0x3ab9
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
movl -0x2c(%rbp), %eax
cmpl %r15d, %eax
je 0x3b0d
setl %cl
movzbl %cl, %ecx
leal (%rax,%rcx,2), %eax
decl %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3bf2
jmp 0x3ae7
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x3b26
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x3bf2
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b3c
jmp 0x3b3c
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3b53
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::work()
void Person::work()
{
    switch(this->sector)
    {
        case 0:
        this->woodcutting();
        break;
        case 1:
        this->farming();
        break;
        case 2:
        this->fishing();
        break;
        case 3:
        this->mining();
        break;
        default:
        break;
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl (%rdi), %eax
cmpq $0x3, %rax
ja 0x3bce
movq %rdi, %rbx
leaq 0x156e(%rip), %rcx      # 0x5104
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x37ee
movl 0xc(%rbx), %edi
movl 0x10(%rbx), %esi
movl $0x2d, %edx
callq 0x44dc
testb %al, %al
je 0x3bce
movb $0x1, 0x15(%rbx)
leaq 0x85cc(%rip), %rax      # 0xc198
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x389a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3844
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/societysimulator.cpp
// Function: main
int main()
{
    srand(time(NULL));
    initMap();
    initPeople();
    while(true)
    {
        update();
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x2140
movl %eax, %edi
callq 0x2150
callq 0x3312
callq 0x368e
callq 0x306c
jmp 0x3db4
nop
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: checkAround(int, int, char)
bool checkAround(int x, int y, char check)
{
	bool isCheckAroundMe = false;

	if(map[x-1][y].kind==check||
	   map[x][y-1].kind==check||
	   map[x][y+1].kind==check||
	   map[x+1][y].kind==check)
	{
		isCheckAroundMe = true;
	}

	return isCheckAroundMe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rdi), %eax
movslq %eax, %rcx
movslq %esi, %rax
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x2abd(%rip), %rcx      # 0x6fb8
cmpb %dl, 0x1(%rcx,%rax,4)
je 0x454c
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
movslq %r8d, %r8
leaq (%r8,%r8,2), %r8
imulq $0xf0, %rcx, %rcx
addq 0x2a9b(%rip), %rcx      # 0x6fb8
cmpb %dl, 0x1(%rcx,%r8,4)
je 0x454c
incl %esi
movslq %esi, %rsi
leaq (%rsi,%rsi,2), %rsi
cmpb %dl, 0x1(%rcx,%rsi,4)
je 0x454c
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x2a72(%rip), %rcx      # 0x6fb8
cmpb %dl, 0x1(%rcx,%rax,4)
jne 0x4550
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x454e
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: checkAroundOrigin(int, int, char)
bool checkAroundOrigin(int x, int y, char check)
{
	bool isCheckAroundMe = false;

	if(map[x-1][y].origin==check||
	   map[x][y-1].origin==check||
	   map[x][y+1].origin==check||
	   map[x+1][y].origin==check)
	{
		isCheckAroundMe = true;
	}

	return isCheckAroundMe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rdi), %eax
movslq %eax, %rcx
movslq %esi, %rax
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x2a45(%rip), %rcx      # 0x6fb8
cmpb %dl, (%rcx,%rax,4)
je 0x45c0
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
movslq %r8d, %r8
leaq (%r8,%r8,2), %r8
imulq $0xf0, %rcx, %rcx
addq 0x2a24(%rip), %rcx      # 0x6fb8
cmpb %dl, (%rcx,%r8,4)
je 0x45c0
incl %esi
movslq %esi, %rsi
leaq (%rsi,%rsi,2), %rsi
cmpb %dl, (%rcx,%rsi,4)
je 0x45c0
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x29fd(%rip), %rcx      # 0x6fb8
cmpb %dl, (%rcx,%rax,4)
jne 0x45c4
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x45c2
// File: /workspace/github_cpp_makefile_star2_O3/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: findOneFree(char)
tuple<int, int> findOneFree(char kind)
{
	tuple<int, int> free;
	for(int j=0;j<HEIGHT;j++)
		{
		for(int i=0;i<WIDTH;i++)
		{
			if (map[i][j].kind == kind &&
			!map[i][j].villagerAimingHere)
			{
				free = make_tuple(i, j);
				map[i][j].villagerAimingHere = true;
				goto returnme; /*ykes, but from MISRA c++ coding standards
								 this seems to remain the last kind of place in which goto
							     it's still good to use, to exit double for loop*/
			}
		}
	}

	returnme:
	return free;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq $0x0, (%rdi)
leaq 0x2bdf(%rip), %rdx      # 0x71e0
addq $0xb, %rdx
xorl %ecx, %ecx
movq %rdx, %rdi
xorl %r8d, %r8d
cmpb %sil, -0xa(%rdi)
jne 0x4618
cmpb $0x0, (%rdi)
je 0x4637
incq %r8
addq $0xf0, %rdi
cmpq $0x50, %r8
jne 0x460d
incq %rcx
addq $0xc, %rdx
cmpq $0x14, %rcx
jne 0x4607
jmp 0x4640
movl %r8d, 0x4(%rax)
movl %ecx, (%rax)
movb $0x1, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/akw0088[P]openssl/rsa_enc.cpp
// Function: main
int main(int argc, char *argv[])
{
	unsigned char *pubkey = NULL;
	unsigned int size;

	if (argc < 3)
	{
		printf("Usage: enc public_key plaintext\r\n");
		return -1;
	}

	pubkey = (unsigned char *)get_file(argv[1], &size);
	if (pubkey == NULL)
	{
		printf("Failed to open public key\r\n");
		return -1;
	}

	unsigned char data[256] = {0};

	strcpy((char *)data, argv[2]);
	int data_len = strlen((char *)data);
	printf("plaintext %s\r\n", data); 

	unsigned char encrypted[4098]={};



	RSA *rsa = createRSA(pubkey, true);
	int encrypted_length = RSA_public_encrypt(data_len, data, encrypted, rsa, RSA_PKCS1_PADDING);
	if (encrypted_length == -1)
	{
		char err[130];

		ERR_load_crypto_strings();
		ERR_error_string(ERR_get_error(), err);
		printf("ERROR: %s\n", err);
		return -1;
	}
	RSA_free(rsa);

	printf("Encrypted Length %d\r\n", encrypted_length);
	write_file((char *)"file.enc", (char *)encrypted, encrypted_length);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1198, %rsp           # imm = 0x1198
cmpl $0x2, %edi
jg 0x1479
leaq 0xc54(%rip), %rdi       # 0x20c8
jmp 0x1554
movq %rsi, %r12
movq 0x8(%rsi), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1325
testq %rax, %rax
je 0x154d
movq %rax, %r14
leaq -0x1b0(%rbp), %r15
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x10e0
movq %r15, %rdi
callq 0x1090
movq %rax, %r13
leaq 0xb8c(%rip), %rdi       # 0x2058
movq %r15, %rsi
xorl %eax, %eax
callq 0x1050
leaq -0x11c0(%rbp), %rdi
movl $0x1002, %edx           # imm = 0x1002
xorl %esi, %esi
callq 0x10b0
movq %r14, %rdi
movl $0x1, %esi
callq 0x129c
movq %rax, %r12
movl %r13d, %edi
movq %r15, %rsi
leaq -0x11c0(%rbp), %rdx
movq %rax, %rcx
movl $0x1, %r8d
callq 0x10c0
cmpl $-0x1, %eax
je 0x1572
movl %eax, %r14d
movq %r12, %rdi
callq 0x1110
leaq 0xb47(%rip), %rdi       # 0x2072
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xb4c(%rip), %rdi       # 0x2088
leaq -0x11c0(%rbp), %rsi
movl %r14d, %edx
callq 0x13d7
jmp 0x155e
leaq 0xb59(%rip), %rdi       # 0x20ad
callq 0x1160
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x1198, %rsp           # imm = 0x1198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %edi
xorl %esi, %esi
callq 0x10a0
callq 0x1140
leaq -0xb0(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1070
leaq 0xacb(%rip), %rdi       # 0x2067
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x1559
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/main.cpp
// Function: main
int main(int argq, char* argv[]) {
	if(argq < 2) {
		cerr << "\a Not enough number of arguments!" << endl;
		cerr << "\a Command line: ./run <input.txt>" << endl;
		return -1;
	}

	char* input;
	input = argv[1];

	Scheduler sched;
	InitializeSemaphores();
	sched.readFile(input);
	sched.simulation();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
cmpl $0x1, %edi
jg 0x24e8
movq 0x5b88(%rip), %rbx      # 0x7ff0
leaq 0x2b95(%rip), %rsi      # 0x5004
movl $0x21, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x2b7c(%rip), %rsi      # 0x5026
movl $0x21, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x257e
movq 0x8(%rsi), %rbx
leaq -0x210(%rbp), %rdi
callq 0x25b8
callq 0x2e68
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
movq %rbx, %rsi
callq 0x20a0
leaq -0x210(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3b04
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x252f
callq 0x2140
leaq -0x210(%rbp), %rdi
callq 0x3dae
leaq -0x100(%rbp), %rdi
callq 0x28e0
leaq -0x150(%rbp), %rdi
callq 0x28e0
leaq -0x1a0(%rbp), %rdi
callq 0x28e0
leaq -0x1f0(%rbp), %rbx
movq %rbx, %rdi
callq 0x28e0
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x257c
callq 0x2140
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25a4
callq 0x2140
jmp 0x25a4
jmp 0x25a1
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x270a
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/process.cpp
// Function: operator<<(std::ostream&, Process const&)
ostream& operator<<(ostream& pl,const Process& punit) {
	pl << "\tPID: " << punit.pid << '\n';
	pl << "\tPriority: " << punit.priority << '\n';
	pl << "\tInitialization Time: " << punit.initTime << '\n';
	pl << "\tExecuting Time: " << punit.processTime << '\n';
	pl << "\tMemory Offset: " << punit.memoryOffset << '\n';
	pl << "\tBlocks Amount " << punit.amoutBlocks << '\n';
	pl << "\tPrinters: " << punit.usePrinter << '\n';
	pl << "\tScanners: " << punit.usescan << '\n';
	pl << "\tModems: " << punit.useModem << '\n';
	pl << "\tSATA: " << punit.useSATA;
	return pl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x26f7(%rip), %rsi      # 0x5048
movl $0x6, %edx
callq 0x2180
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2220
movb $0xa, %bpl
leaq 0x7(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x26ca(%rip), %rsi      # 0x504f
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2220
leaq 0x8(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x26a1(%rip), %rsi      # 0x505b
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2220
leaq 0x9(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x2683(%rip), %rsi      # 0x5072
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x14(%r14), %esi
movq %rbx, %rdi
callq 0x2220
leaq 0xa(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x2660(%rip), %rsi      # 0x5084
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2180
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x2220
leaq 0xb(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x263c(%rip), %rsi      # 0x5095
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x2220
leaq 0xc(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x2617(%rip), %rsi      # 0x50a5
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2180
movzbl 0x18(%r14), %esi
movq %rbx, %rdi
callq 0x2200
leaq 0xd(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x25ed(%rip), %rsi      # 0x50b1
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2180
movzbl 0x19(%r14), %esi
movq %rbx, %rdi
callq 0x2200
leaq 0xe(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x25c3(%rip), %rsi      # 0x50bd
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2180
movzbl 0x1a(%r14), %esi
movq %rbx, %rdi
callq 0x2200
leaq 0xf(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x2597(%rip), %rsi      # 0x50c7
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2180
movzbl 0x1b(%r14), %esi
movq %rbx, %rdi
callq 0x2200
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/process.cpp
// Function: Process::gives()
void Process::gives() {
	int resource, hit;

	freeResource(resource);
	resource = usesResource();
	hit = blockResource(resource);
	if(hit) {
		blockedResource = resource;
	}
	processTime -= QUANTUM;		// cálculo do tempo
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2ee0
movq %rbx, %rdi
callq 0x2be4
movl %eax, %ebp
movl %eax, %edi
callq 0x2eb6
testl %eax, %eax
je 0x2bd9
movl %ebp, 0x1c(%rbx)
decl 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::allocation(unsigned int, int)
unsigned int Memory::allocation(unsigned int qtd, int tipo_p){
	unsigned int offset = MAX_MEM;
	switch(tipo_p){
		case REAL_TIME:
			if(qtd > MAX_REAL){
				offset = 1025;
				return offset;
			}
			offset = verification(qtd,START,MAX_REAL);
		  break;
		default:
			if(qtd > USER_MAX){
				offset = 1025;
				return offset;
			}
			offset = verification(qtd,MAX_REAL,MAX_MEM);
			break;
	}

	if(offset!=MAX_MEM)
		for(int i=offset;i<qtd + offset;i++){
			memoir[i] = 1;
		}
	return offset;
}

// Assembly:
movl $0x401, %eax            # imm = 0x401
testl %edx, %edx
je 0x2d70
cmpl $0x3c0, %esi            # imm = 0x3C0
ja 0x2ddc
leal 0x1(%rsi), %r8d
movl $0x40, %eax
leal (%rax,%rsi), %edx
movl %eax, %ecx
movl %r8d, %r9d
movl $0x1, %r11d
shlq %cl, %r11
leaq 0x1(%rcx), %r10
decl %r9d
cmpl %ecx, %edx
jbe 0x2d5d
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r11
movq %r10, %rcx
je 0x2d3c
testl %r9d, %r9d
je 0x2db8
movl %r10d, %eax
cmpl $0x3ff, %r10d           # imm = 0x3FF
jbe 0x2d34
jmp 0x2db2
cmpl $0x40, %esi
ja 0x2ddc
leal 0x1(%rsi), %r8d
xorl %eax, %eax
leal (%rax,%rsi), %edx
movl %eax, %ecx
movl %r8d, %r9d
movl $0x1, %r11d
shlq %cl, %r11
leaq 0x1(%rcx), %r10
decl %r9d
cmpl %ecx, %edx
jbe 0x2da4
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r11
movq %r10, %rcx
je 0x2d83
testl %r9d, %r9d
je 0x2db8
movl %r10d, %eax
cmpl $0x3f, %r10d
jbe 0x2d7b
movl $0x400, %eax            # imm = 0x400
retq
cmpl %edx, %eax
jae 0x2ddc
movl %eax, %ecx
movl %edx, %edx
movq %rcx, %rsi
movl $0x1, %r8d
shlq %cl, %r8
shrq $0x6, %rsi
orq %r8, (%rdi,%rsi,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x2dc0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::verification(unsigned int, unsigned int, unsigned int)
unsigned int Memory::verification(unsigned int qtd, unsigned int start, unsigned int end){
	unsigned int offset = MAX_MEM;
	int j;

	for(int i = start; i < end; i++) {
		j = i;
		while (memoir[j] == 0 && j < qtd + i) j++;
		if (j == qtd + i){
			offset = i;
			break;
		}
		else i = j;
	}
	return offset;
}

// Assembly:
movl $0x400, %eax            # imm = 0x400
cmpl %ecx, %edx
jae 0x2e3f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %r8d
leal 0x1(%rsi), %r9d
leal (%rdx,%rsi), %ebx
movslq %edx, %r14
movl %r14d, %r10d
xorl %r11d, %r11d
leaq (%r14,%r11), %rcx
movl $0x1, %r15d
shlq %cl, %r15
leal (%r10,%r11), %ebp
incq %r11
cmpl %ebp, %ebx
jbe 0x2e22
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r15
je 0x2e00
cmpl %r11d, %r9d
je 0x2e37
addl %r11d, %r10d
addl %r11d, %edx
cmpl %r8d, %edx
movl %r10d, %edx
jb 0x2df4
jmp 0x2e39
movl %edx, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/memory.cpp
// Function: Memory::deallocation(unsigned int, unsigned int)
void Memory::deallocation(unsigned int offset,unsigned int qtd){
	int i = offset;
	while(i<qtd+offset) {
		memoir[i] = 0;
		i++;
	};
}

// Assembly:
addl %esi, %edx
cmpl %esi, %edx
jbe 0x2e65
movslq %esi, %rcx
movq %rcx, %rax
movq $-0x2, %rsi
rolq %cl, %rsi
shrq $0x6, %rax
andq %rsi, (%rdi,%rax,8)
incq %rcx
cmpl %ecx, %edx
ja 0x2e49
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/resource.cpp
// Function: InitializeSemaphores()
void InitializeSemaphores()
{
	// sem_init() inicializa o semáforo
	// primeiro argumento determina se o semáforo é compartilhado ou não:
	// 			0 = compartilhado entre threas de um processo; !0 = compartilhado entre pocessos
	// segundo argumento indica o valor do semáforo
	sem_init(&scanner, 0, 1);
	sem_init(&printer, 0, 2);
	sem_init(&modem, 0, 1);
	sem_init(&sata, 0, 2);
	return;
}

// Assembly:
pushq %rax
leaq 0x52d8(%rip), %rdi      # 0x8148
xorl %esi, %esi
movl $0x1, %edx
callq 0x2100
leaq 0x52e5(%rip), %rdi      # 0x8168
xorl %esi, %esi
movl $0x2, %edx
callq 0x2100
leaq 0x52f2(%rip), %rdi      # 0x8188
xorl %esi, %esi
movl $0x1, %edx
callq 0x2100
leaq 0x52ff(%rip), %rdi      # 0x81a8
xorl %esi, %esi
movl $0x2, %edx
popq %rax
jmp 0x2100
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::addEndQueue(Process)
void Scheduler::addEndQueue(Process p) {
	switch(p.getPriority()) {
		case REAL_TIME:
			realTIME.push(p);
			break;
		case USER_P1:
			userP1.push(p);
			break;
		case USER_P2:
			userP2.push(p);
			break;
		case USER_P3:
			userP3.push(p);
			break;

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rbp), %r14
movq %r14, %rdi
callq 0x2b5e
cmpl $0x3, %eax
ja 0x3025
movl %eax, %eax
leaq 0x21a0(%rip), %rcx      # 0x50d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x140(%rbx), %rax
movq 0x150(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x300d
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0x140(%rbx)
jmp 0x3025
movq 0xa0(%rbx), %rax
movq 0xb0(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x2ffe
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0xa0(%rbx)
jmp 0x3025
movq 0xf0(%rbx), %rax
movq 0x100(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x3004
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0xf0(%rbx)
jmp 0x3025
movq 0x50(%rbx), %rax
movq 0x60(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x3016
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0x50(%rbx)
jmp 0x3025
addq $0x70, %rbx
jmp 0x301a
addq $0xc0, %rbx
jmp 0x301a
addq $0x110, %rbx            # imm = 0x110
jmp 0x301a
addq $0x20, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4050
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::fillQueue()
void Scheduler::fillQueue() {
	int i = 0;
	Process p;

	while(i < (int)processes.size() && processes[i].getInitTime() < clock + 1) {
		p = processes[i];
		addEndQueue(p);
		i++;
	}

	processes.erase(processes.begin(),processes.begin()+i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %rax
subq %r14, %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x30f6
movq %rdi, %rbx
xorl %r12d, %r12d
xorl %r15d, %r15d
addq %r12, %r14
movq %r14, %rdi
callq 0x2b76
movq 0x8(%rbx), %r14
cmpl (%rbx), %eax
jg 0x30b5
movups (%r14,%r12), %xmm0
movups 0x10(%r14,%r12), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x2f08
incq %r15
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rax
subq %r14, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r12
cmpq %rax, %r15
jl 0x3059
movl %r15d, %r15d
testq %r15, %r15
je 0x30f6
shlq $0x5, %r15
addq %r14, %r15
movq 0x10(%rbx), %rdx
subq %r15, %rdx
je 0x30e1
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x10(%rbx), %rax
movq %rax, %rcx
jmp 0x30e7
movq %r15, %rax
movq %r15, %rcx
subq %r15, %rax
addq %rax, %r14
cmpq %r14, %rcx
je 0x30f6
movq %r14, 0x10(%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::executesProcess(Process&)
void Scheduler::executesProcess(Process& p) {
	switch(p.getPriority()){
		case REAL_TIME:
			clock += p.getExecutionTime();
			sleep(p.getExecutionTime()-QUANTUM);
			p.setExecutionTime(0);
			break;

		case USER_P1:
		case USER_P2:
		case USER_P3:
			p.gives();
			clock += QUANTUM;
			break;

		default:			// percorre até o final do processo
			int i = 0;
			while(!p.getBlockedResource()) {
				p.gives();
				i++;
			}
			clock += QUANTUM*i;
			sleep((QUANTUM*i - 1));
			p.setExecutionTime(p.getExecutionTime() - QUANTUM*i);
			break;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2b5e
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
jae 0x313a
movq %rbx, %rdi
callq 0x2bb6
incl (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
testl %eax, %eax
jne 0x3160
callq 0x2b7e
addl %eax, (%r14)
movq %rbx, %rdi
callq 0x2b7e
leal -0x1(%rax), %edi
callq 0x20e0
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x31a2
callq 0x2bae
xorl %r15d, %r15d
testl %eax, %eax
jne 0x3186
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2bb6
incl %r15d
movq %rbx, %rdi
callq 0x2bae
testl %eax, %eax
je 0x316f
addl %r15d, (%r14)
leal -0x1(%r15), %edi
callq 0x20e0
movq %rbx, %rdi
callq 0x2b7e
subl %r15d, %eax
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2b82
nop
// File: /workspace/github_cpp_makefile_star2_O3/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::nextProcess(Process*)
bool Scheduler::nextProcess(Process *p) {
	if(!realTIME.empty() && realTIME.front().getInitTime() <= clock) {
		*p = realTIME.front();
		realTIME.pop();	// remove o próximo elemento
		return true;
	}

	if(!userP1.empty() && userP1.front().getInitTime() <= clock) {
		*p = userP1.front();
		userP1.pop();
		return true;
	}

	if(!userP2.empty() && userP2.front().getInitTime() <= clock) {
		*p = userP2.front();
		userP2.pop();
		return true;
	}

	if(!userP3.empty() && userP3.front().getInitTime() <= clock) {
		*p = userP3.front();
		userP3.pop();
		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x120(%rdi), %rdi
cmpq %rdi, 0x140(%rbx)
je 0x323e
callq 0x2b76
cmpl (%rbx), %eax
jle 0x3287
movq 0x30(%rbx), %rdi
cmpq %rdi, 0x50(%rbx)
je 0x3251
callq 0x2b76
cmpl (%rbx), %eax
jle 0x3297
movq 0x80(%rbx), %rdi
cmpq %rdi, 0xa0(%rbx)
je 0x326a
callq 0x2b76
cmpl (%rbx), %eax
jle 0x32a1
movq 0xd0(%rbx), %rdi
cmpq %rdi, 0xf0(%rbx)
je 0x3283
callq 0x2b76
cmpl (%rbx), %eax
jle 0x32ae
xorl %eax, %eax
jmp 0x32d9
leaq 0x120(%rbx), %rax
addq $0x110, %rbx            # imm = 0x110
jmp 0x32bc
leaq 0x30(%rbx), %rax
addq $0x20, %rbx
jmp 0x32bc
leaq 0x80(%rbx), %rax
addq $0x70, %rbx
jmp 0x32bc
leaq 0xd0(%rbx), %rax
addq $0xc0, %rbx
movq (%rax), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x4c1c
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/bchu7796[P]p2p-file-sharing/client.cpp
// Function: main
int main(void){
    client client_instance;
    if(client_instance.execute()!= 0){
        perror("server execution fault");
    }
    return 0;
}

// Assembly:
pushq %rax
leaq 0x7(%rsp), %rdi
callq 0x5a12
testl %eax, %eax
jne 0x378f
xorl %eax, %eax
popq %rcx
retq
leaq 0x486e(%rip), %rdi      # 0x8004
callq 0x3250
jmp 0x378b
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, char)
void client::split(const std::string& s, std::vector<std::string>& parameters, const char delim = ' ') {
    parameters.clear();
    std::istringstream iss(s);
    std::string temp;

    while (std::getline(iss, temp, delim)) {
        parameters.emplace_back(std::move(temp));
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq (%rdx), %rsi
movq %rdx, %rdi
callq 0x6658
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x3430
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movsbl %bpl, %ebp
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x34b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ee4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5ce0
jmp 0x3ebc
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3efa
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x70c7(%rip), %rsi      # 0xafc8
leaq 0x20(%rsp), %rdi
callq 0x33a0
leaq 0x98(%rsp), %rdi
callq 0x30f0
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3f41
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x7080(%rip), %rsi      # 0xafc8
leaq 0x20(%rsp), %rdi
callq 0x33a0
leaq 0x98(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O3/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::write_log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<chunk, std::allocator<chunk>>)
int client::write_log(std::string file_name, std::vector<chunk> chunks){
    std::ofstream log;
    log.open((file_name + ".log").c_str());
    for(int i = 0; i < chunks.size(); i++){
        if(chunks[i].is_possessed == true){
            log<<chunks[i].index<<"\n";
        }
    }
    log.close();
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x20(%rsp), %rdi
callq 0x3450
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x6204
leaq 0x40cf(%rip), %rsi      # 0x809b
movq %rsp, %rdi
callq 0x34d0
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl $0x10, %edx
callq 0x3040
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3ffd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
je 0x405f
movl $0x4, %r12d
xorl %r13d, %r13d
leaq 0x20(%rsp), %r14
leaq 0x4082(%rip), %r15      # 0x80a0
cmpb $0x1, (%rax,%r12)
jne 0x4049
movl -0x4(%rax,%r12), %esi
movq %r14, %rdi
callq 0x31c0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3330
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
addq $0x20, %r12
cmpq %r13, %rdx
ja 0x401e
leaq 0x20(%rsp), %rdi
callq 0x3390
movq 0x6f50(%rip), %rax      # 0xafc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x28(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x20(%rsp,%rcx)
callq 0x3260
leaq 0x118(%rsp), %rdi
callq 0x30f0
xorl %eax, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x40cf
jmp 0x40b2
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x40d2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x40d2
jmp 0x40cf
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x33d0
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O3/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::select_chunk(std::vector<chunk, std::allocator<chunk>>)
std::vector<int> client::select_chunk(std::vector<chunk> chunks){
    std::vector<int> min;
    int min_number = INT_MAX;
    int min_index = 0;
    bool flag = false;
    for(int i = 0; i<4; i++){
        for(int j=0; j<chunks.size(); j++){
            if((chunks[j].peers.size() < min_number) && (!chunks[j].is_possessed)){
                min_number = chunks[j].peers.size();
                min_index = j;
                flag = true;
            }
        }
        if(flag){
            min.push_back(min_index);
            chunks[min_index].is_possessed = true;
            min_number = INT_MAX;
            flag = false;
        }
    }
    return min;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq (%rdx), %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
xorl %ebp, %ebp
movq 0x8(%r14), %rsi
subq %rax, %rsi
je 0x453b
sarq $0x5, %rsi
cmpq $0x1, %rsi
adcq $0x0, %rsi
leaq 0x4(%rax), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
movq 0xc(%rdi), %r10
subq 0x4(%rdi), %r10
sarq $0x3, %r10
movslq %edx, %r11
cmpq %r11, %r10
jae 0x44ef
cmpb $0x0, (%rdi)
jne 0x44ef
movl %r8d, 0x4(%rsp)
movb $0x1, %r9b
movl %r8d, %ecx
movl %r10d, %edx
incq %r8
addq $0x20, %rdi
cmpq %r8, %rsi
jne 0x44c8
testb $0x1, %r9b
je 0x453b
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4517
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x4525
movq %rbx, %rdi
movq %r15, %rdx
callq 0x68ac
movq (%r14), %rax
movslq 0x4(%rsp), %rcx
movq %rcx, %rdx
shlq $0x5, %rdx
movb $0x1, 0x4(%rax,%rdx)
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
incl %ebp
cmpl $0x4, %ebp
jne 0x44a5
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x456b
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O3/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::user_interface()
void client::user_interface(){
    char buffer[1024];
    while(1){
        std::string command;
        std::cout<<">";
        std::cin.getline(buffer, 1024);
        command = buffer;
        parse_command(command);
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
leaq 0x10(%rsp), %r14
leaq 0x30(%rsp), %r13
movq 0x578c(%rip), %r15      # 0xafe0
leaq 0x40(%rsp), %r12
leaq 0x20(%rsp), %rbp
movq %r14, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movl $0x1, %edx
movq 0x5754(%rip), %rdi      # 0xafd0
leaq 0x287c(%rip), %rsi      # 0x80ff
callq 0x3330
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %ecx
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r12, %rsi
callq 0x34e0
movq 0x8(%rsp), %rbx
movq %r12, %rdi
callq 0x3120
movq %rsp, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x33f0
movq %r13, 0x20(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x6204
movq %rbp, %rsi
callq 0x54e2
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x5907
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3300
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x585e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x585e
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x5945
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x5945
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x595b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/rlcsa_test.cpp
// Function: Pattern::Pattern(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool, unsigned int)
Pattern(const std::string& _pattern, bool ignore_tab, usint ignore) :
    pattern(_pattern), weight(1), range(EMPTY_PAIR), steps(0), docc(0)
  {
    if(ignore_tab)
    {
      usint pos = this->pattern.find('\t');
      this->weight = atoi(this->pattern.substr(0, pos).c_str());
      this->pattern = this->pattern.substr(pos + 1);
    }
    else if(ignore > 0)
    {
      this->weight = atoi(this->pattern.substr(0, ignore).c_str());
      this->pattern = this->pattern.substr(ignore);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x7ea2
movl $0x1, 0x20(%rbx)
movq $0x1, 0x24(%rbx)
movq $0x0, 0x2c(%rbx)
testl %r14d, %r14d
je 0x7df0
movq %rbx, %rdi
movl $0x9, %esi
xorl %edx, %edx
callq 0x3340
movq %rax, %r14
movl %r14d, %ecx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x32b0
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %r15
movq %r15, %rdi
callq 0x33e0
movl %eax, 0x20(%rbx)
cmpq %r13, %r15
je 0x7dd4
movq 0x18(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x32a0
incl %r14d
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x32b0
jmp 0x7e49
testl %ebp, %ebp
je 0x7e6e
movl %ebp, %r14d
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x32b0
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %r15
movq %r15, %rdi
callq 0x33e0
movl %eax, 0x20(%rbx)
cmpq %r13, %r15
je 0x7e32
movq 0x18(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x32a0
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x32b0
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x7e6e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7e83
jmp 0x7e83
jmp 0x7e83
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x7e9a
movq (%r12), %rsi
incq %rsi
callq 0x32a0
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::addSample(std::pair<unsigned int, unsigned int>)
void
AdaptiveSamples::addSample(sample_type sample)
{
  key_type i = this->hash(sample.first);
  if(this->samples[i].first >= this->index.getSize()) { this->items++; }
  else if(this->use_candidates) { this->addCandidate(this->samples[i]); }
  this->samples[i] = sample;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl %ebx, %eax
notl %eax
movl %ebx, %ecx
shll $0xf, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0xc, %eax
xorl %ecx, %eax
leal (%rax,%rax,4), %eax
movl %eax, %ecx
shrl $0x4, %ecx
xorl %eax, %ecx
imull $0x809, %ecx, %ecx      # imm = 0x809
movl %ecx, %eax
shrl $0x10, %eax
xorl %ecx, %eax
xorl %edx, %edx
divl 0x10(%rdi)
movl %edx, %r15d
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
movl (%rax,%r15,8), %edx
cmpl 0x4(%rcx), %edx
jae 0x14369
cmpb $0x1, 0x34(%r14)
jne 0x1436d
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x14e8c
movq 0x8(%r14), %rax
jmp 0x1436d
incl 0x14(%r14)
movq %rbx, %rcx
shrq $0x20, %rcx
movl %ebx, (%rax,%r15,8)
movl %ecx, 0x4(%rax,%r15,8)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::~AdaptiveSamples()
AdaptiveSamples::~AdaptiveSamples()
{
  delete[] samples; samples = 0;
  delete[] candidate_samples; candidate_samples = 0;
  delete   regular_samples; regular_samples = 0;
  delete[] window; window = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x14399
callq 0x3330
movq $0x0, 0x8(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x143af
callq 0x3330
movq $0x0, 0x18(%rbx)
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x143c8
movq %r14, %rdi
callq 0x10040
movl $0x30, %esi
movq %r14, %rdi
callq 0x32a0
movq $0x0, 0x28(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x143eb
callq 0x3330
movq $0x0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/adaptive_samples.cpp
// Function: CSA::AdaptiveSamples::reportSize() const
usint
AdaptiveSamples::reportSize() const
{
  usint temp = sizeof(*this) + this->size * sizeof(sample_type);
  if(this->use_candidates) { temp += this->size * sizeof(sample_type); }
  if(this->half_greedy) { temp += this->regular_samples->reportSize(); }
  if(this->promote_probability > 0.0) { temp += this->window_size * sizeof(key_type); }
  return temp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal (,%rax,8), %ecx
xorl %ebx, %ebx
cmpb $0x0, 0x34(%rdi)
cmovel %ebx, %ecx
leal (%rcx,%rax,8), %ebp
addl $0x60, %ebp
cmpb $0x1, 0x35(%rdi)
jne 0x1448b
movq 0x28(%r14), %rdi
callq 0x1048c
addl %eax, %ebp
movsd 0x38(%r14), %xmm0
movl 0x40(%r14), %eax
shll $0x2, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
cmoval %eax, %ebx
addl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq