#if 0
    #include "spall.h"

static SpallProfile spall_ctx;
static SpallBuffer  spall_buffer;
double              GetTimeMicros(void);

void BeginProfiler() {
    spall_ctx = spall_init_file("hello_world.spall", 1);

    int            buffer_size = 1 * 1024 * 1024;
    unsigned char *buffer      = (unsigned char *)malloc(buffer_size);
    spall_buffer               = {buffer, (size_t)buffer_size};

    spall_buffer_init(&spall_ctx, &spall_buffer);
}

void EndProfiler() {
    spall_buffer_quit(&spall_ctx, &spall_buffer);
    free(spall_buffer.data);
    spall_quit(&spall_ctx);
}

void _BeginProfileScope(const char *name, int len) {
    spall_buffer_begin(&spall_ctx, &spall_buffer,
                       name,                // name of your name
                       len,                 // name len minus the null terminator
                       GetTimeMicros() // timestamp in microseconds -- start of your timing block
    );
}
    #define BeginProfileScope(name) _BeginProfileScope(#name, sizeof(#name) - 1)

void EndProfileScope() {
    spall_buffer_end(&spall_ctx, &spall_buffer,
                     GetTimeMicros() // timestamp in microseconds -- end of your timing block
    );
}
    #define ProfileScope(name) ProfileScope_ PROFILE_SCOPE_VAR_##name(#name, sizeof(#name) - 1)
    #define ProfileFunction() ProfileScope_ PROFILE_SCOPE_FUNCTION(__FUNCTION__, sizeof(__FUNCTION__) - 1)
struct ProfileScope_ {
    ProfileScope_(const char *name, int len) { _BeginProfileScope(name, len); }
    ~ProfileScope_() { EndProfileScope(); }
};
#else
    #define ProfileScope(name)
    #define ProfileFunction()
    #define BeginProfiler()
    #define EndProfiler()
    #define BeginProfileScope(name)
    #define EndProfileScope()
#endif