arduino code works slower than arduino code generated by ldmicro

Well, from the video, it seems that the motor is actually operating more slowly when being driven by the Arduino code than when being driven by the ldmicro code. To me, that implies that somehow your loops are essentially creating some sort of PWM waveform for the motor, instead of what I assume is supposed to be "if (button1()) go_forward_until_limit(); if (button2()) go_backward_until_otherlimit()" logic.

I can't actually follow your program code, though (where are the comments and meaningful variable names!) Here's the code, merged and with some slight formatting changes (designed to make it more readable on a forum, I guess.)

/*
 * L293D_test2.ino
 */
void setup() 
{
botones_setup();
salidas_setup();
}

void loop()
{
debounce_loop();
salidas_loop();
}

/*
 * salidas.ino
 */

const byte enable = 8;
const byte input1 = 9;
const byte input2 = 10;
extern byte d;

byte condicion=0; 

void salidas_setup()
{
  pinMode (enable, OUTPUT);
  pinMode (input1, OUTPUT);
  pinMode (input2, OUTPUT);
}

void salidas_loop()
{
  if (d>=5) {
   digitalWrite(enable,HIGH);
   digitalWrite(input1,HIGH);
   digitalWrite(input2,LOW);
  }  else  {
   digitalWrite(enable,LOW);
   digitalWrite(input1,LOW);
   digitalWrite(input2,LOW);
  }

  if (e>=5)  {
   digitalWrite(enable,HIGH);
   digitalWrite(input1,LOW);
   digitalWrite(input2,HIGH);
  }  else  {
   digitalWrite(enable,LOW);
   digitalWrite(input1,LOW);
   digitalWrite(input2,LOW);
  }
}

/*
 * botones.ino
 */

unsigned long a = 0;
unsigned long b = 0;
unsigned long c = 0;
const long debounce = 41;
const long intervalo = 1000;

const byte boton_start = 2;
const byte boton_stop = 3;
const byte boton_input1 = 4;
const byte boton_input2 = 5;

byte estadoanterior_start=LOW;
byte estadoanterior_stop=LOW;
byte estadoanterior_input1=LOW;
byte estadoanterior_input2=LOW;

byte habilitado=0;

byte d = 0;
byte e = 0;

extern const byte enable;
extern const byte input1;
extern const byte input2;

void botones_setup()
{
  pinMode (boton_start,INPUT);
  pinMode (boton_stop,INPUT);
  pinMode (boton_input1,INPUT);
  pinMode (boton_input2,INPUT);
}

void debounce_loop()
{
  if(millis() - a >= debounce)  {
    a=millis();
    start_loop();
    stop_loop();
    input1_loop();
    input2_loop();
  } 
}

void start_loop()
{
  if (estadoanterior_start != digitalRead(boton_start))  {
    estadoanterior_start=digitalRead(boton_start);
    if(digitalRead(boton_start)==HIGH)
    {
      habilitado=1;
    }
  }
}

void stop_loop()
{
  if (estadoanterior_stop != digitalRead(boton_stop))  {
    estadoanterior_stop=digitalRead(boton_stop);
    if (digitalRead(boton_stop)==HIGH) {
      habilitado=0;
      d=0;
      e=0;
      digitalWrite(enable,LOW);
      digitalWrite(input1,LOW);
      digitalWrite(input2,LOW);
    }
  }
}

void input1_loop()
{
  if (digitalRead(boton_input1)==HIGH and habilitado==1)  {
    if(millis() - b >= intervalo)    {
      b=millis();
      e=0;
      d++;
    }
  }
}

void input2_loop()
{
  if (digitalRead(boton_input2)==HIGH and habilitado==1)  {
    if (millis() - c >= intervalo)  {
      c=millis();
      d=0;
      e++;
    }
  }
}