Language: C

#include<stdio.h>
#include<string.h>

void change(char data1[],char data2[],int num,int start){
    int i;
    for(i=0;i<num;i++){
        data2[i] = data1[i+start];
    }
    data2[i]='\0';
}
int Count(char data1[],char data2[]){
    int i;
    int j=0;
    int num;
    int count = 0;
    char *c;
    num = strlen(data2);
    c = (char *)malloc( sizeof(char) *num+1);

    do{
        for(i=0;i<num;i++){
            c[i] = data1[i+j];
        }
        c[i]='\0';
        if(strcmp(c,data2)==0){
            count++;
        }
    j++;
    }while(data1[j+num-1]!=NULL);
    free(c);
    return count;
}

int chack(char data[]){    
    int num;
    int i;
    char *c;
    num = strlen(data);
    c = (char *)malloc( sizeof(char) *num);
    for(i=0;i<num;i++){
        c[i]=data[num-i-1];
    }
    c[i]='\0';
    if(strcmp(c,data)==0) return 1;
    free(c);
    else return 0;
}
int main(){

    char S[50000];
    char T[50000];
    char *C;
    int s;
    int t;
    int output;
    int i,j;
    
    gets(S);
    gets(T);
    
    s=strlen(S);
    t=strlen(T);
    
    C = (char *)malloc( sizeof(char) *t);
    
    for(i=1;i<t+1;i++){
        for(j=0;j<t;j++){
            if(j+i<=t){
                change(T,C,i,j);
                if(chack(C)==1){
                    output += Count(S,C);
                }
            }
        }
    }
    printf("%d\n",output);
    free(C);
    
    return 0;
}

Compiler output:
main.c: In function 'Count':
main.c:18:17: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   18 |     c = (char *)malloc( sizeof(char) *num+1);
      |                 ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include<string.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:18:17: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   18 |     c = (char *)malloc( sizeof(char) *num+1);
      |                 ^~~~~~
main.c:18:17: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:29:26: warning: comparison between pointer and integer
   29 |     }while(data1[j+num-1]!=NULL);
      |                          ^~
main.c:30:5: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   30 |     free(c);
      |     ^~~~
main.c:30:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:30:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:30:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c: In function 'chack':
main.c:39:17: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   39 |     c = (char *)malloc( sizeof(char) *num);
      |                 ^~~~~~
main.c:39:17: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:45:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   45 |     free(c);
      |     ^~~~
main.c:45:5: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:46:5: error: 'else' without a previous 'if'
   46 |     else return 0;
      |     ^~~~
main.c: In function 'main':
main.c:58:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   58 |     gets(S);
      |     ^~~~
      |     fgets
main.c:64:17: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   64 |     C = (char *)malloc( sizeof(char) *t);
      |                 ^~~~~~
main.c:64:17: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:77:5: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   77 |     free(C);
      |     ^~~~
main.c:77:5: note: include '<stdlib.h>' or provide a declaration of 'free'