This simple code should copy the string "c" in the string "d", changing only the first char to 'x':

```
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    char c[5] = "abcd", d[5];

    __asm__(
        "leal %1, %%ebx\n"
        "leal %0, %%ecx\n"

        "movb $'x', (%%ecx)\n"
        "movb 1(%%ebx), %%al\n"
        "movb %%al, 1(%%ecx)\n"
        "movb 2(%%ebx), %%al\n"
        "movb %%al, 2(%%ecx)\n"
        "movb 3(%%ebx), %%al\n"
        "movb %%al, 3(%%ecx)\n"
        "movb $0, 4(%%ecx)\n"

        :"=m"(c)
        :"m"(d)
        :"%ebx", "%ecx", "%eax"
    );

    printf("%s\n", d);
    return 0;
}

```

But it gives a segmentation fault error. I believe my problem is with the constraints, but I can't figure how to fix this.

What is the right way, and how can I change this code to work?