<commit_before>#ifndef SAVE_STATE_H
# define SAVE_STATE_H
# pragma once

struct statebuf
{
  void* sp;
  void* label;
};

#if defined(__GNUC__)
static inline bool __attribute__((always_inline)) savestate(
  statebuf& ssb) noexcept
{
  bool r;

#if defined(i386) || defined(__i386) || defined(__i386__)
  asm volatile (
    "push %%ebp\n\t"
    "movl %%esp, %0\n\t" // store sp
    "movl $1f, %1\n\t" // store label
    "movb $0, %2\n\t" // return false
    "jmp 2f\n\t"
    "1:pop %%ebp\n\t"
    "movb $1, %2\n\t" // return true
    "2:"
    : "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "memory"
  );
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
  asm volatile (
    "movq %%rsp, %0\n\t" // store sp
    "movq $1f, %1\n\t" // store label
    "movb $0, %2\n\t" // return false
    "jmp 2f\n\t"
    "1:movb $1, %2\n\t" // return true
    "2:"
    : "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "memory"
  );
#elif defined(__arm__)
  asm volatile (
    "push {fp}\n\t" // push fp
    "str sp, %0\n\t" // store sp
    "ldr r3, =1f\n\t" // load label into r0
    "str r3, %1\n\t" // store r0 into label
    "mov %2, $0\n\t" // store 0 into result
    "b 2f\n\t"
    "1:pop {fp}\n\t" // restore fp
    "mov %2, $1\n\t" // store 1 into result
    "2:"
    : "=r3", "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "memory"
  );
#endif

  return r;
}
#elif defined(_MSC_VER)
__forceinline bool savestate(statebuf& ssb) noexcept
{
  bool r;

  __asm {
    push ebp
    mov ebx, ssb
    mov [ebx]ssb.sp, esp
    mov [ebx]ssb.label, offset _1f
    mov r, 0x0
    jmp _2f
    _1f: pop ebp
       mov r, 0x1
    _2f:
  }

  return r;
}
#else
# error "unsupported compiler"
#endif<commit_msg>some fixes<commit_after>#ifndef SAVE_STATE_H
# define SAVE_STATE_H
# pragma once

struct statebuf
{
  void* sp;
  void* label;
};

#if defined(__GNUC__)
static inline bool __attribute__((always_inline)) savestate(
  statebuf& ssb) noexcept
{
  bool r;

#if defined(i386) || defined(__i386) || defined(__i386__)
  asm volatile (
    "push %%ebp\n\t"
    "movl %%esp, %0\n\t" // store sp
    "movl $1f, %1\n\t" // store label
    "movb $0, %2\n\t" // return false
    "jmp 2f\n\t"
    "1:pop %%ebp\n\t"
    "movb $1, %2\n\t" // return true
    "2:"
    : "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "memory"
  );
#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
  asm volatile (
    "movq %%rsp, %0\n\t" // store sp
    "movq $1f, %1\n\t" // store label
    "movb $0, %2\n\t" // return false
    "jmp 2f\n\t"
    "1:movb $1, %2\n\t" // return true
    "2:"
    : "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "memory"
  );
#elif defined(__arm__)
  asm volatile (
    "push {fp}\n\t" // push fp
    "str sp, %0\n\t" // store sp
    "ldr r3, =1f\n\t" // load label into r0
    "str r3, %1\n\t" // store r0 into label
    "mov %2, $0\n\t" // store 0 into result
    "b 2f\n\t"
    "1:pop {fp}\n\t" // restore fp
    "mov %2, $1\n\t" // store 1 into result
    "2:"
    : "=m" (ssb.sp), "=m" (ssb.label), "=r" (r)
    :
    : "r3, ""memory"
  );
#endif

  return r;
}
#elif defined(_MSC_VER)
__forceinline bool savestate(statebuf& ssb) noexcept
{
  bool r;

  __asm {
    push ebp
    mov ebx, ssb
    mov [ebx]ssb.sp, esp
    mov [ebx]ssb.label, offset _1f
    mov r, 0x0
    jmp _2f
    _1f: pop ebp
       mov r, 0x1
    _2f:
  }

  return r;
}
#else
# error "unsupported compiler"
#endif
{'fraction_non_alphanumeric': 0.19455587392550144, 'fraction_numerical': 0.03782234957020057, 'mean_word_length': 2.305871212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1401114', 'n_tokens_mistral': 1662, 'n_tokens_neox': 1600, 'n_words': 402}