// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__h_prefilter
static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width)
{
   unsigned char buffer[STBTT_MAX_OVERSAMPLE];
   int safe_w = w - kernel_width;
   int j;
   STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze
   for (j=0; j < h; ++j) {
      int i;
      unsigned int total;
      STBTT_memset(buffer, 0, kernel_width);

      total = 0;

      // make kernel_width a constant in common cases so compiler can optimize out the divide
      switch (kernel_width) {
         case 2:
            for (i=0; i <= safe_w; ++i) {
               total += pixels[i] - buffer[i & STBTT__OVER_MASK];
               buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
               pixels[i] = (unsigned char) (total / 2);
            }
            break;
         case 3:
            for (i=0; i <= safe_w; ++i) {
               total += pixels[i] - buffer[i & STBTT__OVER_MASK];
               buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
               pixels[i] = (unsigned char) (total / 3);
            }
            break;
         case 4:
            for (i=0; i <= safe_w; ++i) {
               total += pixels[i] - buffer[i & STBTT__OVER_MASK];
               buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
               pixels[i] = (unsigned char) (total / 4);
            }
            break;
         case 5:
            for (i=0; i <= safe_w; ++i) {
               total += pixels[i] - buffer[i & STBTT__OVER_MASK];
               buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
               pixels[i] = (unsigned char) (total / 5);
            }
            break;
         default:
            for (i=0; i <= safe_w; ++i) {
               total += pixels[i] - buffer[i & STBTT__OVER_MASK];
               buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i];
               pixels[i] = (unsigned char) (total / kernel_width);
            }
            break;
      }

      for (; i < w; ++i) {
         STBTT_assert(pixels[i] == 0);
         total -= buffer[i & STBTT__OVER_MASK];
         pixels[i] = (unsigned char) (total / kernel_width);
      }

      pixels += stride_in_bytes;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl -0xc(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x10b0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x8a42
movl -0x18(%rbp), %eax
movl %eax, %edx
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x10b0
movl $0x0, -0x30(%rbp)
movl -0x18(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3, %eax
ja 0x8945
movq -0x38(%rbp), %rax
leaq 0xc8d4(%rip), %rcx      # 0x15050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x87ed
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl -0x20(%rbp,%rcx), %ecx
subl %ecx, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x2c(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x30(%rbp), %eax
shrl %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x878c
jmp 0x89b2
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x8861
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl -0x20(%rbp,%rcx), %ecx
subl %ecx, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x2c(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x30(%rbp), %eax
movl $0x3, %ecx
xorl %edx, %edx
divl %ecx
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x87f9
jmp 0x89b2
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x88cf
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl -0x20(%rbp,%rcx), %ecx
subl %ecx, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x2c(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x30(%rbp), %eax
shrl $0x2, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x886d
jmp 0x89b2
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x8943
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl -0x20(%rbp,%rcx), %ecx
subl %ecx, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x2c(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x30(%rbp), %eax
movl $0x5, %ecx
xorl %edx, %edx
divl %ecx
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x88db
jmp 0x89b2
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0x89b0
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
movzbl -0x20(%rbp,%rcx), %ecx
subl %ecx, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x2c(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, %eax
movb %cl, -0x20(%rbp,%rax)
movl -0x30(%rbp), %eax
xorl %edx, %edx
divl -0x18(%rbp)
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x894c
jmp 0x89b2
jmp 0x89b4
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x8a23
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x89cf
jmp 0x89ee
leaq 0xe928(%rip), %rdi      # 0x172fe
leaq 0xddda(%rip), %rsi      # 0x167b7
movl $0xf2c, %edx            # imm = 0xF2C
leaq 0xe924(%rip), %rcx      # 0x1730d
callq 0x10a0
movl -0x2c(%rbp), %eax
andl $0x7, %eax
cltq
movzbl -0x20(%rbp,%rax), %ecx
movl -0x30(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
xorl %edx, %edx
divl -0x18(%rbp)
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x89b4
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x8739
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)