The difference between amd64 and i386 is that amd64 is 64-bit while i386 is 32-bit. This is the width (in bits) of registers available in the core.
Basically the largest number that a 32-bit CPU core can handle in one go is a little over 4.29 billion while a 64-bit core can handle a number of a bit over 18.44 billion, billion.
The cores in modern PCs are capable of behaving as either a 64-bit or a 32-bit processor depending on which version of the operating system you have installed.
64-bit code tends to run faster than 32-bit code either because it can deal with bigger numbers in on go or because the 64-bit cores have more registers so can store more things without needing to put things in external memory. Though there is no guarantee that 64-bit code will run faster if the code has not been written to take advantage of the extra features of the processor.
Compiling on a 32-bit system will produce different code than a 64-bit system. You can prove this by compiling to assembly code on the two systems. Assuming your C file is myfile.c try
gcc -S myfile.c on both systems and compare myfile.s
Well written code for a 32-bit system should compile and run on a 64-bit system but not all code is well written. Many programmers make assumptions about the system that may not be true: such as register width or byte order.
Without access to your source code it's difficult to see what the problem is but a
segmenation fault indicates that an attempt has been made to access memory that does not belong to the program. This may, for example, indicate that mem_ptr is a 32-bit pointer which is fine on a 32-bit system but needs to be a 64-bit pointer on a 64-bit system.