LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setWood()
void setWood()
{
	int woods = randBetween(1, cfg.maxWoods);

	for(int i=0;i<woods;i++)
	{
		/*set ray*/
		int ray = randBetween(1, cfg.maxWoodsRay);
		/*choose center*/
		int x = randBetween(ray, WIDTH-ray);
		int y = randBetween(ray, HEIGHT-ray);
		/*mapping*/
		for(int j=x-ray;j<x+ray;j++)
		{
			for(int k=y-ray;k<y+ray;k++)
			{
				map[j][k].kind='|';
				map[j][k].origin='|';
			}
		}
	 }

	 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4d33(%rip), %r12      # 0x8198
movl 0x2c(%r12), %esi
movl $0x1, %edi
callq 0x45ac
testl %eax, %eax
jle 0x3533
movl %eax, %ebx
xorl %r13d, %r13d
movl 0x38(%r12), %esi
movl $0x1, %edi
callq 0x45ac
movl %eax, %r14d
movl $0x50, %esi
subl %eax, %esi
movl %eax, %edi
callq 0x45ac
movl %eax, %r15d
movl $0x14, %esi
subl %r14d, %esi
movl %r14d, %edi
callq 0x45ac
movl %r15d, %esi
subl %r14d, %esi
leal (%r15,%r14), %ecx
cmpl %ecx, %esi
jge 0x3527
movl %eax, %edx
subl %r14d, %edx
movslq %esi, %rsi
movslq %r15d, %rdi
imulq $0xf0, %rdi, %rdi
movslq %eax, %r8
addl %r14d, %eax
leaq (%r8,%r8,2), %r8
leaq (%rdi,%r8,4), %rdi
movslq %r14d, %r8
imulq $0xfc, %r8, %r8
subq %r8, %rdi
leaq 0x4cea(%rip), %r8       # 0x81e0
addq %r8, %rdi
incq %rdi
addl %r14d, %r14d
movl %r14d, %r8d
movq %rdi, %r9
cmpl %eax, %edx
jge 0x3519
movw $0x7c7c, -0x1(%r9)      # imm = 0x7C7C
addq $0xc, %r9
decl %r8d
jne 0x3509
incq %rsi
addq $0xf0, %rdi
cmpl %esi, %ecx
jne 0x34ff
incl %r13d
cmpl %ebx, %r13d
jne 0x3481
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setMountain()
void setMountain()
{
	int mountains = randBetween(1, cfg.maxMountains);
	for(int i=0;i<mountains;i++)
	{
		/*set ray*/
		int ray = randBetween(1, cfg.maxMountainsRay);
		/*choose center*/
		int x = randBetween(ray, WIDTH-ray);
		int y = randBetween(ray, HEIGHT-ray);
		/*mapping*/
		for(int j=x-ray;j<x+ray;j++)
		{
			for(int k=y-ray;k<y+ray;k++)
			{
				map[j][k].kind='^';
				map[j][k].origin='^';
			}
		}
	 }

	 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4c41(%rip), %r12      # 0x8198
movl 0x28(%r12), %esi
movl $0x1, %edi
callq 0x45ac
testl %eax, %eax
jle 0x3625
movl %eax, %ebx
xorl %r13d, %r13d
movl 0x34(%r12), %esi
movl $0x1, %edi
callq 0x45ac
movl %eax, %r14d
movl $0x50, %esi
subl %eax, %esi
movl %eax, %edi
callq 0x45ac
movl %eax, %r15d
movl $0x14, %esi
subl %r14d, %esi
movl %r14d, %edi
callq 0x45ac
movl %r15d, %esi
subl %r14d, %esi
leal (%r15,%r14), %ecx
cmpl %ecx, %esi
jge 0x3619
movl %eax, %edx
subl %r14d, %edx
movslq %esi, %rsi
movslq %r15d, %rdi
imulq $0xf0, %rdi, %rdi
movslq %eax, %r8
addl %r14d, %eax
leaq (%r8,%r8,2), %r8
leaq (%rdi,%r8,4), %rdi
movslq %r14d, %r8
imulq $0xfc, %r8, %r8
subq %r8, %rdi
leaq 0x4bf8(%rip), %r8       # 0x81e0
addq %r8, %rdi
incq %rdi
addl %r14d, %r14d
movl %r14d, %r8d
movq %rdi, %r9
cmpl %eax, %edx
jge 0x360b
movw $0x5e5e, -0x1(%r9)      # imm = 0x5E5E
addq $0xc, %r9
decl %r8d
jne 0x35fb
incq %rsi
addq $0xf0, %rdi
cmpl %esi, %ecx
jne 0x35f1
incl %r13d
cmpl %ebx, %r13d
jne 0x3573
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4b59(%rip), %rax      # 0x8198
cmpb $0x1, 0x44(%rax)
jne 0x3694
leaq 0x4b94(%rip), %rax      # 0x81e0
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 0x3676
movw $0x2d2d, (%rax,%rdi)    # imm = 0x2D2D
movb $0x0, 0x9(%rax,%rdi)
incl %esi
addq $0xc, %rdi
cmpq $0xf0, %rdi
jne 0x3658
incq %rcx
addq $0xf0, %rax
cmpq $0x50, %rcx
jne 0x364e
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15d, %r15d
leaq 0x4b2f(%rip), %r12      # 0x81e0
leaq -0x40(%rbp), %rbx
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 %r12, %rcx
leaq (%rdx,%rdx,2), %rdx
cmpb $0x0, 0xa(%rcx,%rdx,4)
jne 0x36b5
leaq (%rcx,%rdx,4), %rcx
movb 0x1(%rcx), %dl
cmpb $0x2d, %dl
je 0x36b5
leaq (%r15,%r15,2), %rdi
shlq $0x4, %rdi
leaq 0x95ad(%rip), %r8       # 0xcce0
leaq (%r8,%rdi), %rsi
leaq (%r8,%rdi), %r14
addq $0x18, %r14
movl %r13d, -0xc(%r14)
movl %eax, -0x8(%r14)
movb %dl, -0x4(%r14)
movb $0x1, 0xa(%rcx)
movq %rbx, %rdi
callq 0x3a3e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3794
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3777
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x2190
incq %r15
cmpq $0x19, %r15
jne 0x36b5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x44c0
testb %al, %al
je 0x3806
movb $0x1, 0x15(%rbx)
leaq 0x9994(%rip), %rax      # 0xd198
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3862
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x9969(%rip), %rdx      # 0xd194
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x4779(%rip), %rcx      # 0x7fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x3861
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_O1/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 0x38b8
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x991b(%rip), %rdx      # 0xd19c
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x4723(%rip), %rcx      # 0x7fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x38b7
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_O1/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 0x390e
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rcx
movslq 0x10(%rdi), %rax
movb $0x1, 0x15(%rdi)
leaq 0x98c9(%rip), %rdx      # 0xd1a0
incl (%rdx)
leaq (%rax,%rax,2), %rax
imulq $0xf0, %rcx, %rcx
addq 0x46cd(%rip), %rcx      # 0x7fb8
movl 0x4(%rcx,%rax,4), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax,4)
cmpl $0x19, %edx
jg 0x390d
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_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
leaq (%rcx,%rcx,2), %rcx
imulq $0xf0, %rax, %rax
addq 0x467e(%rip), %rax      # 0x7fb8
movb $0x0, 0xa(%rax,%rcx,4)
movq 0x18(%rdi), %rax
cmpq 0x20(%rdi), %rax
jne 0x39bd
leaq 0x18(%rbx), %r14
movq 0x467c(%rip), %r15      # 0x7fd0
leaq 0x17a5(%rip), %rsi      # 0x5100
movl $0x21, %edx
movq %r15, %rdi
callq 0x21c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3a3e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3794
movq (%r15), %rdi
testq %rdi, %rdi
je 0x39bd
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), %edx
movl %edx, 0x10(%rbx)
leaq 0x8(%rcx), %rsi
cmpq %rax, %rsi
je 0x3a04
movq %rax, %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
testq %rdx, %rdx
jle 0x3a04
incq %rdx
addq $0xc, %rcx
movq -0x4(%rcx), %rsi
movq %rsi, -0xc(%rcx)
decq %rdx
addq $0x8, %rcx
cmpq $0x1, %rdx
jg 0x39ef
addq $-0x8, %rax
movq %rax, 0x20(%rbx)
movslq 0xc(%rbx), %rax
movslq 0x10(%rbx), %rcx
imulq $0xf0, %rax, %rax
addq 0x4596(%rip), %rax      # 0x7fb8
leaq (%rcx,%rcx,2), %rcx
movb 0x1(%rax,%rcx,4), %dl
movb %dl, 0x14(%rbx)
movb $0x1, 0xa(%rax,%rcx,4)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 -0x38(%rbp), %rdi
callq 0x45d0
leaq 0xc(%r14), %rax
movq %rax, -0x40(%rbp)
movl 0xc(%r14), %eax
leaq -0x30(%rbp), %r12
movl %eax, (%r12)
movl 0x10(%r14), %eax
addq $0x10, %r14
movq %r14, -0x48(%rbp)
leaq -0x2c(%rbp), %r13
movl %eax, (%r13)
movl -0x38(%rbp), %r15d
movl -0x34(%rbp), %r14d
movl -0x30(%rbp), %eax
cmpl %r14d, %eax
je 0x3ac6
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 0x3bda
jmp 0x3aa0
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
movl -0x2c(%rbp), %eax
cmpl %r15d, %eax
je 0x3af4
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 0x3bda
jmp 0x3ace
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x3b0d
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x3bda
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b25
jmp 0x3b25
jmp 0x3b25
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3b3c
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2190
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3bb6
movq %rdi, %rbx
leaq 0x1572(%rip), %rcx      # 0x50f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x380e
movl 0xc(%rbx), %edi
movl 0x10(%rbx), %esi
movl $0x2d, %edx
callq 0x44c0
testb %al, %al
je 0x3bb6
movb $0x1, 0x15(%rbx)
leaq 0x95e4(%rip), %rax      # 0xd198
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x38ba
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3864
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x331a
callq 0x3696
callq 0x3074
jmp 0x3d9c
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3ad9(%rip), %rcx      # 0x7fb8
cmpb %dl, 0x1(%rcx,%rax,4)
je 0x4530
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
movslq %r8d, %r8
leaq (%r8,%r8,2), %r8
imulq $0xf0, %rcx, %rcx
addq 0x3ab7(%rip), %rcx      # 0x7fb8
cmpb %dl, 0x1(%rcx,%r8,4)
je 0x4530
incl %esi
movslq %esi, %rsi
leaq (%rsi,%rsi,2), %rsi
cmpb %dl, 0x1(%rcx,%rsi,4)
je 0x4530
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x3a8e(%rip), %rcx      # 0x7fb8
cmpb %dl, 0x1(%rcx,%rax,4)
jne 0x4534
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x4532
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3a61(%rip), %rcx      # 0x7fb8
cmpb %dl, (%rcx,%rax,4)
je 0x45a4
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
movslq %r8d, %r8
leaq (%r8,%r8,2), %r8
imulq $0xf0, %rcx, %rcx
addq 0x3a40(%rip), %rcx      # 0x7fb8
cmpb %dl, (%rcx,%r8,4)
je 0x45a4
incl %esi
movslq %esi, %rsi
leaq (%rsi,%rsi,2), %rsi
cmpb %dl, (%rcx,%rsi,4)
je 0x45a4
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x3a19(%rip), %rcx      # 0x7fb8
cmpb %dl, (%rcx,%rax,4)
jne 0x45a8
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x45a6
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3bfb(%rip), %rdx      # 0x81e0
addq $0xb, %rdx
xorl %ecx, %ecx
movq %rdx, %rdi
xorl %r8d, %r8d
cmpb %sil, -0xa(%rdi)
jne 0x45fc
cmpb $0x0, (%rdi)
je 0x461b
incq %r8
addq $0xf0, %rdi
cmpq $0x50, %r8
jne 0x45f1
incq %rcx
addq $0xc, %rdx
cmpq $0x14, %rcx
jne 0x45eb
jmp 0x4624
movl %r8d, 0x4(%rax)
movl %ecx, (%rax)
movb $0x1, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1477
leaq 0xc56(%rip), %rdi       # 0x20c8
jmp 0x1552
movq %rsi, %r12
movq 0x8(%rsi), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1323
testq %rax, %rax
je 0x154b
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 0xb8e(%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 0x1570
movl %eax, %r14d
movq %r12, %rdi
callq 0x1110
leaq 0xb49(%rip), %rdi       # 0x2072
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xb4e(%rip), %rdi       # 0x2088
leaq -0x11c0(%rbp), %rsi
movl %r14d, %edx
callq 0x13d5
jmp 0x155c
leaq 0xb5b(%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 0xacd(%rip), %rdi       # 0x2067
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x1557
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e64
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
movq %rbx, %rsi
callq 0x20a0
leaq -0x210(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3af6
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x252f
callq 0x2140
leaq -0x210(%rbp), %rdi
callq 0x3da0
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_O1/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 0x2703(%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 0x26d6(%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 0x26ad(%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 0x268f(%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 0x266c(%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 0x2648(%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 0x2623(%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 0x25f9(%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 0x25cf(%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 0x25a3(%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_O1/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 0x2edc
movq %rbx, %rdi
callq 0x2bd8
movl %eax, %ebp
movl %eax, %edi
callq 0x2eb2
testl %eax, %eax
je 0x2bcd
movl %ebp, 0x1c(%rbx)
decl 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2d65
cmpl $0x3c0, %esi            # imm = 0x3C0
ja 0x2dda
leal 0x1(%rsi), %edx
movl $0x40, %eax
leal (%rax,%rsi), %r8d
movl %eax, %ecx
movl %edx, %r9d
movl $0x1, %r11d
shlq %cl, %r11
leaq 0x1(%rcx), %r10
decl %r9d
cmpl %ecx, %r8d
jbe 0x2d52
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r11
movq %r10, %rcx
je 0x2d30
testl %r9d, %r9d
je 0x2dad
movl %r10d, %eax
cmpl $0x3ff, %r10d           # imm = 0x3FF
jbe 0x2d27
jmp 0x2da8
cmpl $0x40, %esi
ja 0x2dda
leal 0x1(%rsi), %edx
xorl %eax, %eax
leal (%rax,%rsi), %r8d
movl %eax, %ecx
movl %edx, %r9d
movl $0x1, %r11d
shlq %cl, %r11
leaq 0x1(%rcx), %r10
decl %r9d
cmpl %ecx, %r8d
jbe 0x2d9a
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r11
movq %r10, %rcx
je 0x2d78
testl %r9d, %r9d
je 0x2dad
movl %r10d, %eax
cmpl $0x3f, %r10d
jbe 0x2d6f
movl $0x400, %eax            # imm = 0x400
cmpl $0x400, %eax            # imm = 0x400
je 0x2dda
addl %eax, %esi
cmpl %esi, %eax
jae 0x2dda
movl %eax, %ecx
movl %esi, %edx
movq %rcx, %rsi
movl $0x1, %r8d
shlq %cl, %r8
shrq $0x6, %rsi
orq %r8, (%rdi,%rsi,8)
incq %rcx
cmpq %rcx, %rdx
jne 0x2dbe
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e3d
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 0x2e20
shrq $0x6, %rcx
andq (%rdi,%rcx,8), %r15
je 0x2dfe
cmpl %r11d, %r9d
je 0x2e35
addl %r11d, %r10d
addl %r11d, %edx
cmpl %r8d, %edx
movl %r10d, %edx
jb 0x2df2
jmp 0x2e37
movl %edx, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e63
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 0x2e47
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x52dc(%rip), %rdi      # 0x8148
xorl %esi, %esi
movl $0x1, %edx
callq 0x2100
leaq 0x52e9(%rip), %rdi      # 0x8168
xorl %esi, %esi
movl $0x2, %edx
callq 0x2100
leaq 0x52f6(%rip), %rdi      # 0x8188
xorl %esi, %esi
movl $0x1, %edx
callq 0x2100
leaq 0x5303(%rip), %rdi      # 0x81a8
xorl %esi, %esi
movl $0x2, %edx
popq %rax
jmp 0x2100
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2b52
cmpl $0x3, %eax
ja 0x3021
movl %eax, %eax
leaq 0x21a4(%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 0x3009
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0x140(%rbx)
jmp 0x3021
movq 0xa0(%rbx), %rax
movq 0xb0(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x2ffa
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0xa0(%rbx)
jmp 0x3021
movq 0xf0(%rbx), %rax
movq 0x100(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x3000
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0xf0(%rbx)
jmp 0x3021
movq 0x50(%rbx), %rax
movq 0x60(%rbx), %rcx
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x3012
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x20, 0x50(%rbx)
jmp 0x3021
addq $0x70, %rbx
jmp 0x3016
addq $0xc0, %rbx
jmp 0x3016
addq $0x110, %rbx            # imm = 0x110
jmp 0x3016
addq $0x20, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4042
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x10(%rbx), %rax
subq %rdi, %rax
shrq $0x5, %rax
testl %eax, %eax
jle 0x30aa
xorl %r14d, %r14d
xorl %r15d, %r15d
addq %r14, %rdi
callq 0x2b6a
cmpl (%rbx), %eax
jg 0x30ad
movq 0x8(%rbx), %rax
movups (%rax,%r14), %xmm0
movups 0x10(%rax,%r14), %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 0x2f04
incq %r15
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %rax
subq %rdi, %rax
shrq $0x5, %rax
cltq
addq $0x20, %r14
cmpq %rax, %r15
jl 0x304f
jmp 0x30ad
xorl %r15d, %r15d
testl %r15d, %r15d
je 0x30ea
movq 0x8(%rbx), %r14
movl %r15d, %r15d
shlq $0x5, %r15
addq %r14, %r15
movq 0x10(%rbx), %rdx
subq %r15, %rdx
je 0x30d4
movq %r14, %rdi
movq %r15, %rsi
callq 0x21e0
movq 0x10(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x30ea
movq %r14, 0x10(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2b52
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
jae 0x312c
movq %rbx, %rdi
callq 0x2baa
incl (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
testl %eax, %eax
jne 0x3152
callq 0x2b72
addl %eax, (%r14)
movq %rbx, %rdi
callq 0x2b72
leal -0x1(%rax), %edi
callq 0x20e0
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x3194
callq 0x2ba2
xorl %r15d, %r15d
testl %eax, %eax
jne 0x3178
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2baa
incl %r15d
movq %rbx, %rdi
callq 0x2ba2
testl %eax, %eax
je 0x3161
addl %r15d, (%r14)
leal -0x1(%r15), %edi
callq 0x20e0
movq %rbx, %rdi
callq 0x2b72
subl %r15d, %eax
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2b76
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3230
callq 0x2b6a
cmpl (%rbx), %eax
jle 0x3279
movq 0x30(%rbx), %rdi
cmpq %rdi, 0x50(%rbx)
je 0x3243
callq 0x2b6a
cmpl (%rbx), %eax
jle 0x3289
movq 0x80(%rbx), %rdi
cmpq %rdi, 0xa0(%rbx)
je 0x325c
callq 0x2b6a
cmpl (%rbx), %eax
jle 0x3293
movq 0xd0(%rbx), %rdi
cmpq %rdi, 0xf0(%rbx)
je 0x3275
callq 0x2b6a
cmpl (%rbx), %eax
jle 0x32a0
xorl %eax, %eax
jmp 0x32cb
leaq 0x120(%rbx), %rax
addq $0x110, %rbx            # imm = 0x110
jmp 0x32ae
leaq 0x30(%rbx), %rax
addq $0x20, %rbx
jmp 0x32ae
leaq 0x80(%rbx), %rax
addq $0x70, %rbx
jmp 0x32ae
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 0x4c1e
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/marcellapantarotto[P]pseudoSO/scheduler.cpp
// Function: Scheduler::dispatcher(Process&)
void Scheduler::dispatcher(Process& p) {
	cout << "\n Dispatcher =>" << '\n';
	cout << p << endl;
	executesProcess(p);
	displayExecution(p);
	sleep(QUANTUM);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x47c2(%rip), %r15      # 0x7fd0
leaq 0x1977(%rip), %rsi      # 0x518c
movl $0xf, %edx
movq %r15, %rdi
callq 0x2180
leaq -0x19(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x2180
movq %r15, %rdi
movq %r14, %rsi
callq 0x2930
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30f6
movups (%r14), %xmm0
movups 0x10(%r14), %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 0x38b6
movl $0x1, %edi
callq 0x20e0
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x59fa
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_O1/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 0x66aa
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 0x3ee2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5cc6
jmp 0x3eba
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3ef8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x70c9(%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 0x3f3f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x7082(%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_O1/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 0x620c
leaq 0x40d1(%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 0x3ffb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x4057
movl $0x4, %r12d
xorl %r13d, %r13d
leaq 0x20(%rsp), %r14
leaq 0x4087(%rip), %r15      # 0x80a0
cmpb $0x1, (%rax,%r12)
jne 0x403d
movl -0x4(%rax,%r12), %esi
movq %r14, %rdi
callq 0x31c0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3330
incq %r13
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r12
cmpq %r13, %rcx
ja 0x4019
leaq 0x20(%rsp), %rdi
callq 0x3390
movq 0x6f58(%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 0x40c7
jmp 0x40aa
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x40ca
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x40ca
jmp 0x40c7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x33d0
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
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)
xorl %r12d, %r12d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movq (%r14), %rdx
movq 0x8(%r14), %rsi
subq %rdx, %rsi
je 0x44f2
sarq $0x5, %rsi
cmpq $0x1, %rsi
adcq $0x0, %rsi
addq $0x10, %rdx
xorl %edi, %edi
movq (%rdx), %r8
subq -0x8(%rdx), %r8
sarq $0x3, %r8
movslq %eax, %r9
cmpq %r9, %r8
jae 0x44e6
cmpb $0x0, -0xc(%rdx)
jne 0x44e6
movl %edi, 0x4(%rsp)
movb $0x1, %cl
movl %r8d, %eax
incq %rdi
addq $0x20, %rdx
cmpq %rdi, %rsi
jne 0x44c4
testb $0x1, %cl
je 0x4534
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x4511
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x451c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x68fe
movslq 0x4(%rsp), %rax
movq (%r14), %rcx
shlq $0x5, %rax
movb $0x1, 0x4(%rcx,%rax)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
incl %r12d
cmpl $0x4, %r12d
jne 0x44a6
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4567
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x3300
movq %r14, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x57a4(%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 0x576c(%rip), %rdi      # 0xafd0
leaq 0x2894(%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 0x620c
movq %rbp, %rsi
callq 0x54ca
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x58ef
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3300
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x5846
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x5846
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x592d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0x592d
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x5943
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O1/bchu7796[P]p2p-file-sharing/peers.cpp
// Function: client::handle_request(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void client::handle_request(int process_fd, std::string file_name, int chunk_index){
    char buffer[CHUNK_SIZE];
    std::ifstream upload_file;
    int chunk_size = CHUNK_SIZE;

    upload_file.open(file_name);
    upload_file.seekg(chunk_size * chunk_index, std::ios::beg);
    upload_file.read(buffer, sizeof(buffer));

    send(process_fd, &buffer, sizeof(buffer), 0);
    upload_file.close();
    close(process_fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x618, %rsp            # imm = 0x618
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3320
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x3270
shll $0xa, %ebp
movslq %ebp, %rsi
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x3380
leaq 0x8(%rsp), %rdi
leaq 0x210(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x3360
leaq 0x210(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x3160
leaq 0x8(%rsp), %rdi
callq 0x3060
movl %ebx, %edi
callq 0x3500
leaq 0x8(%rsp), %rdi
callq 0x3080
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3080
movq %rbx, %rdi
callq 0x3480