slightly change this c program but make it do the same exact thing .

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>

/* Global definitions. */
#define PAGE_SIZE 256 // Page size, in bytes.
#define PAGE_ENTRIES 256 // Max page table entries.
#define PAGE_NUM_BITS 8 // Page number size, in bits.
#define FRAME_SIZE 256 // Frame size, in bytes.
#define FRAME_ENTRIES 256 // Number of frames in physical memory.
#define MEM_SIZE (FRAME_SIZE * FRAME_ENTRIES) // Mem size, in bytes.
#define TLB_ENTRIES 16 // Max TLB entries.

/* Global variables. */
int virtual; 
int page_number; 
int offset; 
int physical; 
int frame_number; 
int value;
int page_table[PAGE_ENTRIES]; 
int tlb[TLB_ENTRIES][2]; 
int tlb_front = -1; 
int tlb_back = -1; 
char memory[MEM_SIZE]; 
int mem_index = 0; 

/* Statistics variables. */
int fault_counter = 0; 
int tlb_counter = 0; 
int address_counter = 0; 
float fault_rate; 
float tlb_rate; 

/* Functions declarations. */
int get_physical(int virtual);
int get_offset(int virtual);
int get_page_number(int virtual);
void initialize_page_table(int n);
void initialize_tlb(int n);
int consult_page_table(int page_number);
int consult_tlb(int page_number);
void update_tlb(int page_number, int frame_number);
int get_frame();

int main(int argc, char *argv[]) {
/* File I/O variables. */
char* in_file; 
char* out_file; 
char* store_file; 
char* store_data; 
int store_fd; 
char line[8]; 
FILE* in_ptr; 
FILE* out_ptr; 

/* Initialize page_table, set all elements to -1. */
initialize_page_table(-1);
initialize_tlb(-1);

/* Get command line arguments. */
if (argc != 4) {
printf("Enter input, output, and store file names!");

exit(EXIT_FAILURE);
}
/* Else, proceed execution. */
else {
/* Get the file names from argv[]. */
in_file = argv[1];
out_file = argv[2];
store_file = argv[3];

/* Open the address file. */
if ((in_ptr = fopen(in_file, "r")) == NULL) {

printf("Input file could not be opened.\n");

exit(EXIT_FAILURE);
}

/* Open the output file. */
if ((out_ptr = fopen(out_file, "a")) == NULL) {
/* If fopen fails, print error and exit. */
printf("Output file could not be opened.\n");

exit(EXIT_FAILURE);
}

/* store file */
/* Map the store file to memory. */
store_fd = open(store_file, O_RDONLY);

store_data = mmap(0, MEM_SIZE, PROT_READ, MAP_SHARED, store_fd, 0);
/* Check that the mmap call succeeded. */
if (store_data == MAP_FAILED) {
close(store_fd);
printf("Error mmapping the backing store file!");
exit(EXIT_FAILURE);
}

/* Loop through the input file one line at a time. */
while (fgets(line, sizeof(line), in_ptr)) {
/* Read a single address from file, assign to virtual. */
virtual = atoi(line);
/* Increment address counter. */
address_counter++;


page_number = get_page_number(virtual);

offset = get_offset(virtual);

/* Use page_number to find frame_number in TLB, if it exists. */
frame_number = consult_tlb(page_number);


if (frame_number != -1) {
/* TLB lookup succeeded. */
/* No update to TLB required. */
physical = frame_number + offset;

/* No store file access required... */
/* Fetch the value directly from memory. */
value = memory[physical];
}
else {
/* TLB lookup failed. */
/* Look for frame_number in page table instead. */
frame_number = consult_page_table(page_number);

/* Check frame number from consult_page_table. */
if (frame_number != -1) {
/* No page fault. */
physical = frame_number + offset;

/* Update TLB. */
update_tlb(page_number, frame_number);

/* No store file access required... */
/* Fetch the value directly from memory. */
value = memory[physical];
}
else {
/* Page fault! */
/* Seek to the start of the page in store_ptr file. */
int page_address = page_number * PAGE_SIZE;

/* Check if a free frame exists. */
if (mem_index != -1) {
/* Success, a free frame exists. */
memcpy(memory + mem_index,
store_data + page_address, PAGE_SIZE);

/* Calculate physical address of specific byte. */
frame_number = mem_index;
physical = frame_number + offset;
value = memory[physical];

page_table[page_number] = mem_index;

update_tlb(page_number, frame_number);

/* Increment mem_index. */
if (mem_index < MEM_SIZE - FRAME_SIZE) {
mem_index += FRAME_SIZE;
}
else {
mem_index = -1;
}
}
else {
    /* No free frame exists. */
}
}
}


fprintf(out_ptr, "Virtual address: %d ", virtual);
fprintf(out_ptr, "Physical address: %d ", physical);
fprintf(out_ptr, "Value: %d\n", value);
}


fault_rate = (float) fault_counter / (float) address_counter;
tlb_rate = (float) tlb_counter / (float) address_counter;

fprintf(out_ptr, "Number of Translated Addresses = %d\n", address_counter);
fprintf(out_ptr, "Page Faults = %d\n", fault_counter);
fprintf(out_ptr, "Page Fault Rate = %.3f\n", fault_rate);
fprintf(out_ptr, "TLB Hits = %d\n", tlb_counter);
fprintf(out_ptr, "TLB Hit Rate = %.3f\n", tlb_rate);

/* Close all three files. */
fclose(in_ptr);
fclose(out_ptr);
close(store_fd);
}

return EXIT_SUCCESS;
}



int get_physical(int virtual) {
physical = get_page_number(virtual) + get_offset(virtual);

return physical;
}

int get_page_number(int virtual) {

return (virtual >> PAGE_NUM_BITS);
}


int get_offset(int virtual) {

int mask = 255;

return virtual & mask;
}


void initialize_page_table(int n) {
for (int i = 0; i < PAGE_ENTRIES; i++) {
page_table[i] = n;
}
}


void initialize_tlb(int n) {
for (int i = 0; i < TLB_ENTRIES; i++) {
tlb[i][0] = -1;
tlb[i][1] = -1;
}
}

int consult_page_table(int page_number) {
if (page_table[page_number] == -1) {
fault_counter++;
}

return page_table[page_number];
}


int consult_tlb(int page_number) {

for (int i = 0; i < TLB_ENTRIES; i++) {
if (tlb[i][0] == page_number) {

tlb_counter++;

return tlb[i][1];
}
}

/* If page_number doesn't exist in TLB, return -1. */
return -1;
}

void update_tlb(int page_number, int frame_number) {
/* Use FIFO */
if (tlb_front == -1) {
/* Set front and back indices. */
tlb_front = 0;
tlb_back = 0;

/* Update TLB. */
tlb[tlb_back][0] = page_number;
tlb[tlb_back][1] = frame_number;
}
else {

tlb_front = (tlb_front + 1) % TLB_ENTRIES;
tlb_back = (tlb_back + 1) % TLB_ENTRIES;

/* Insert new TLB entry in the back. */
tlb[tlb_back][0] = page_number;
tlb[tlb_back][1] = frame_number;
}

return;
}