                int make_friends(const char *name1, const char *name2, User *head) {
                  
                 
                 // Case 4: If at least one user does not exist, Return 4
        
           
                
                 User *friend2 = head;
                 User *friend1 = head;
                 int exist = 0;
                 User *curr = head;
                 while (curr != NULL) {
                        char *curr_name = curr->name;
                        if(strcmp(name1, curr_name) == 0) {
                        friend1 = curr;
                        exist++;
                        }
                        if(strcmp(name2, curr_name) == 0) {
                        friend2 = curr;
                        exist++;
                        }
                        curr = curr->next;
                 }
                 if (exist != 2) {
                    return 4;   
                 }
                 
 // Case 3: Same user is passed in twice, Return 3
   
                 if(strcmp(name1, name2) == 0){
                   return 3;
                 }
                 
                 // Case 1: If already friends
        
           
                User friends1[MAX_FRIENDS] = friend1->friends;
                int length1 = sizeof(friends1);
                for (int i = 0; i < length1; i++) {
                    char *friend_name11 = friends1[i]->name;
                    if(strcmp(friend_name11, name2) == 0){
                       exist++;
                    }
                }
                        
                User friends2[MAX_FRIENDS] = friend2->friends;
                int length2 = sizeof(friends2);
                for (int i = 0; i < length2; i++) {
                    char *friend_name22 = friends1[i]->name;
                    if(strcmp(friend_name22, name1) == 0){
                       exist++;
                    }
                }
                    
                if (exist == 4){
                   return 1;
                }
   
                //Case 2: If the users are not already friends, but at least one already has MAX_FRIENDS friends
                   
                if((length1 == MAX_FRIENDS) | (length2 == MAX_FRIENDS)) {
                  return 2;
                }
        
                //Case 0: Make two users friends with each other
                
                
                for (int i = 0; i < length1; i++) {
                    char *friend_name1 = friends1[i]->name;
                    if(strcmp(friend_name1, NULL) == 0){  
                      friends1[i] = friend2;
                    }
                }
                        
                for (int i = 0; i < length2; i++) {
                    char *friend_name2 = friends2[i]->name;
                    if(strcmp(friend_name2, NULL) == 0){
                      friends2[i] = friend1;
                    }
                }
                     
                return 0;
}                   

Make friends function,