// Ref: https://bitcodersblog.wordpress.com/2017/05/10/win32-programming-in-nasm-part-2/
// caller.c
#if defined(_MSC_VER)
    #define MSCDECL __cdecl
    #define MSSTDCALL __stdcall
    #define MSFASTCALL __fastcall
    #define GCCCDECL
    #define GCCSTDCALL
    #define GCCFASTCALL
#elif defined(__GNUC__)
    #define MSCDECL
    #define MSSTDCALL
    #define MSFASTCALL
    #define GCCCDECL __attribute__((cdecl))
    #define GCCSTDCALL __attribute__((stdcall))
    #define GCCFASTCALL __attribute__((fastcall))
#endif
#include <stdio.h>


int MSCDECL csum(int a, int b, int c) GCCCDECL;
int MSSTDCALL ssum(int a, int b, int c) GCCSTDCALL;
int MSFASTCALL fsum(int a, int b, int c) GCCFASTCALL;

void main()
{
    int a = 2, b = 3, c = 5;
    int cs = csum(a, b, c);
    int ss = ssum(a, b, c);
    int fs = fsum(a, b, c);
    
    printf("csum says: the sum of %i, %i and %i are %i \n", a, b, c, cs);
    printf("ssum says: the sum of %i, %i and %i are %i \n", a, b, c, ss);
    printf("fsum says: the sum of %i, %i and %i are %i \n", a, b, c, fs);
}