I am trying to figure out what is going on with my simple example programs, when I disassemble them with Ghidra. I am not sure whether this is some strange Ghidra behaviour or something that is set by default during compile time which produce a lot of assembly code, but I actively write only few LOC.
Here is my sample C program created with VS Studio 2017:
void main()
{
int x = 1;
int y = 2;
x = x + y;
}
And this is what I get when I try to disassemble it with Ghidra:
The above screenshot is from the supposed 'entry' point of the program. But why is it so complex? I did a simple program to test how local variables are presented in Assembly and I get such output. Yet it should be few simple Assembly commands instead.
I am not sure what I am missing out here, so if someone could help me to try and understand this, I would be grateful.