LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: px_create_texture
static void px_create_texture(lua_State *L, int width, int height) {
  SDL_DisplayMode display_mode;

  // create new texture
  if (texture) SDL_DestroyTexture(texture);
  texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, width, height);
  if (!texture) luaL_error(L, "SDL_CreateTexture() failed: %s", SDL_GetError());
  if (SDL_RenderSetLogicalSize(renderer, width, height)) luaL_error(L, "SDL_RenderSetLogicalSize() failed: %s", SDL_GetError());
  screen_width = width; screen_height = height;

  // determine the best window size and center it
  if (SDL_GetDesktopDisplayMode(0, &display_mode)) luaL_error(L, "SDL_GetDesktopDisplayMode() failed: %s", SDL_GetError());
  width = (display_mode.w - PX_WINDOW_PADDING) / screen_width;
  height = (display_mode.h - PX_WINDOW_PADDING) / screen_height;
  if (width < height) {
    height = screen_height * width;
    width = screen_width * width;
  } 
  else {
    width = screen_width * height;
    height = screen_height * height;
  }
  SDL_SetWindowSize(window, width, height);
  SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x13bc1(%rip), %rdi     # 0x3b4e0
testq %rdi, %rdi
je 0x27929
callq 0x6370
movq 0x13ba8(%rip), %rdi     # 0x3b4d8
pushq $0x1
popq %rdx
movl $0x16462004, %esi       # imm = 0x16462004
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x6830
movq %rax, 0x13b96(%rip)     # 0x3b4e0
testq %rax, %rax
jne 0x27968
callq 0x6380
leaq 0x4c78(%rip), %rsi      # 0x2c5d3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xaa53
movq 0x13b69(%rip), %rdi     # 0x3b4d8
movl %r14d, %esi
movl %ebp, %edx
callq 0x61e0
testl %eax, %eax
je 0x27996
callq 0x6380
leaq 0x4c69(%rip), %rsi      # 0x2c5f2
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xaa53
movl %r14d, 0x113b6b(%rip)   # 0x13b508
movl %ebp, 0x113b69(%rip)    # 0x13b50c
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0x6710
testl %eax, %eax
je 0x279cc
callq 0x6380
leaq 0x4c59(%rip), %rsi      # 0x2c618
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xaa53
movl 0xc(%rsp), %eax
movl 0x10(%rsp), %ecx
addl $-0x20, %eax
movl 0x113b2b(%rip), %edi    # 0x13b508
cltd
idivl %edi
movl %eax, %esi
addl $-0x20, %ecx
movl 0x113b20(%rip), %r8d    # 0x13b50c
movl %ecx, %eax
cltd
idivl %r8d
cmpl %eax, %esi
cmovgel %eax, %esi
imull %esi, %r8d
imull %edi, %esi
movq 0x13acb(%rip), %rdi     # 0x3b4d0
movl %r8d, %edx
callq 0x6750
movq 0x13abc(%rip), %rdi     # 0x3b4d0
movl $0x2fff0000, %esi       # imm = 0x2FFF0000
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
callq 0x6080
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: px_open_controllers
static void px_open_controllers(lua_State *L) {
  int i;
  SDL_GameController *controller;
  for (i = 0; i < SDL_NumJoysticks(); ++i) {
    if (SDL_IsGameController(i)) {
      controller = SDL_GameControllerOpen(i);
      if (!controller) luaL_error(L, "SDL_GameControllerOpen() failed: %s", SDL_GetError());
    }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x49d1(%rip), %r14      # 0x2c7c2
xorl %ebp, %ebp
callq 0x6330
cmpl %eax, %ebp
jge 0x27e2c
movl %ebp, %edi
callq 0x6800
testl %eax, %eax
je 0x27e28
movl %ebp, %edi
callq 0x6450
testq %rax, %rax
jne 0x27e28
callq 0x6380
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xaa53
incl %ebp
jmp 0x27df3
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: mml_parse_number
static int mml_parse_number(AudioChannel *channel) {
  int value = 0;
  mml_skip_spaces(channel);
  while (SDL_isdigit(*channel->in)) {
    value *= 10;
    value += *channel->in++ - '0';
  }
  return value;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x27e31
movq 0x8(%rbx), %rax
xorl %ebp, %ebp
movsbl (%rax), %edi
callq 0x61c0
testl %eax, %eax
je 0x27e8b
imull $0xa, %ebp, %ecx
movq 0x8(%rbx), %rdx
leaq 0x1(%rdx), %rax
movq %rax, 0x8(%rbx)
movsbl (%rdx), %edx
leal (%rcx,%rdx), %ebp
addl $-0x30, %ebp
jmp 0x27e65
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: mml_parse_duration
static void mml_parse_duration(AudioChannel *channel) {
  float duration = (float)mml_parse_number(channel);
  if (duration == 0.0f) duration = (float)channel->default_length;
  duration = mixing_frequency / ((float)channel->tempo * 0.25f / 60.0f) * (1.0f / duration);
  if (mml_is_next(channel, '.')) duration *= 1.5f;
  channel->duration = (int)duration;
  if (mml_is_next(channel, '&')) channel->silence = 0;
  else channel->silence = (int)(duration * (1.0f / 8.0f));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0x27e54
testl %eax, %eax
jne 0x27ea8
movl 0x30(%rbx), %eax
cvtsi2ss %eax, %xmm0
movss 0x113c1c(%rip), %xmm1   # 0x13bad0
cvtsi2ssl 0x28(%rbx), %xmm2
mulss 0x4553(%rip), %xmm2     # 0x2c414
divss 0x4573(%rip), %xmm2     # 0x2c43c
divss %xmm2, %xmm1
movss 0x4537(%rip), %xmm2     # 0x2c40c
divss %xmm0, %xmm2
mulss %xmm1, %xmm2
movss %xmm2, 0xc(%rsp)
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x27fc9
testl %eax, %eax
je 0x27f02
movss 0xc(%rsp), %xmm0
mulss 0x4540(%rip), %xmm0     # 0x2c440
jmp 0x27f08
movss 0xc(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
cvttss2si %xmm0, %eax
movl %eax, 0x20(%rbx)
pushq $0x26
popq %rsi
movq %rbx, %rdi
callq 0x27fc9
xorl %ecx, %ecx
movss 0xc(%rsp), %xmm0
mulss 0x4508(%rip), %xmm0     # 0x2c438
cvttss2si %xmm0, %edx
testl %eax, %eax
cmovnel %ecx, %edx
movl %edx, 0x24(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: mml_parse_note
static void mml_parse_note(AudioChannel *channel, int key) {
  if (mml_is_next(channel, '#')) ++key;
  else if (mml_is_next(channel, '+')) ++key;
  else if (mml_is_next(channel, '-')) --key;
  key += (channel->octave - 1) * 12;
  channel->frequency = (float)SDL_pow(2.0, ((double)key - 49.0) / 12.0) * 440.0f;
  channel->t = 0.0f;
  mml_parse_duration(channel);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
pushq $0x23
popq %rsi
callq 0x27fc9
testl %eax, %eax
jne 0x27f67
pushq $0x2b
popq %rsi
movq %rbx, %rdi
callq 0x27fc9
testl %eax, %eax
je 0x27fb9
incl %r14d
imull $0xc, 0x2c(%rbx), %eax
addl %r14d, %eax
addl $-0xc, %eax
cvtsi2sd %eax, %xmm1
addsd 0x3e50(%rip), %xmm1     # 0x2bdd0
divsd 0x3e50(%rip), %xmm1     # 0x2bdd8
movsd 0x1e40(%rip), %xmm0     # 0x29dd0
callq 0x6550
cvtsd2ss %xmm0, %xmm0
mulss 0x44a3(%rip), %xmm0     # 0x2c444
movss %xmm0, 0x18(%rbx)
andl $0x0, 0x14(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x27e94
pushq $0x2d
popq %rsi
movq %rbx, %rdi
callq 0x27fc9
subl %eax, %r14d
jmp 0x27f6a
// File: /workspace/github_c_makefile_star2_O2/kieselsteini[P]PiXL-old/pixl.c
// Function: px_set_button
static void px_set_button(int player, int button, int down) {
  if (player >= 0 && player < PX_NUM_CONTROLLERS) {
    button = 1 << button;
    if (down) {
      inputs[player].down |= button;
      inputs[player].pressed |= button;
    }
    else {
      inputs[player].down &= ~button;
    }
  }
}

// Assembly:
cmpl $0x7, %edi
ja 0x28028
pushq $0x1
popq %rax
movl %esi, %ecx
shll %cl, %eax
movl %edi, %ecx
imulq $0xc, %rcx, %rsi
leaq 0x113ad5(%rip), %rdi    # 0x13bae0
leaq (%rdi,%rsi), %rcx
movzwl (%rsi,%rdi), %esi
testl %edx, %edx
je 0x28021
orl %eax, %esi
movw %si, (%rcx)
orw %ax, 0x2(%rcx)
retq
notl %eax
andl %eax, %esi
movw %si, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/nh13[P]ksw/src/parasail/tests/test_verify_tables.c
// Function: diff_array
static inline int diff_array(
        unsigned long s1Len,
        unsigned long s2Len,
        int *a,
        int *b)
{
    unsigned long i = 0;
    unsigned long size = s1Len * s2Len;
    for (i=0; i<size; ++i) {
        if (a[i] != b[i]) return 1;
    }
    return 0;
}

// Assembly:
imulq %rsi, %rdi
xorl %eax, %eax
pushq $0x1
popq %rsi
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x14b206
movl (%rdx,%r8,4), %r9d
leaq 0x1(%r8), %r10
cmpl (%rcx,%r8,4), %r9d
movq %r10, %r8
je 0x14b1ee
movl %esi, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/codeniko[P]CS214-Malloc-Free/mymalloc.c
// Function: myfree
void myfree(void *p, char *file, int line)
{
	struct MemEntry *ptr;
	struct MemEntry *prev;
	struct MemEntry *next;

	if (p == NULL) {
		fprintf(stderr, "Pointer is NULL in file, free failed in FILE: '%s' on LINE: '%d'\n", file, line);
		return;
	}

	ptr = (struct MemEntry*)((char*)p - sizeof(struct MemEntry));
	
	//check if valid memEntry ptr
	int i;
	int valid = 0;
	for (i = 0; i < entriesSize; i++) {
		if (ptr == memEntries[i] && !ptr->isfree) {
			valid = 1; //memEntry is valid
			break;
		}
	}
	if (!valid) {
		fprintf(stderr, "Attempting to free memory that was not malloced in FILE: '%s' on LINE: '%d'\n", file, line);
		return;
	}

	if((prev = ptr->prev) != 0 && prev->isfree)
	{
		// the previous chunk is free, so
		// merge this chunk with the previous chunk
		prev->size += sizeof(struct MemEntry) + ptr->size;
		memEntries[i] = 0; //merged with previous, so removing free memEntry
	}
	else
	{ //not setting memEntry to null b/c not necessarily removing it, just isfree=1
		ptr->isfree = 1;
		prev = ptr;	// used for the step below
	}
	if((next = ptr->next) != 0 && next->isfree)
	{
		// the next chunk is free, merge with it
		prev->size += sizeof(struct MemEntry) + next->size;
		prev->next = next->next;
		//prev->isfree = 1;
		for (i = 0; i < entriesSize; i++) {
			if (next == memEntries[i]) {
				memEntries[i] = 0; //merged with next, so removing free memEntry
				break;
			}
		}
	}
}

// Assembly:
movl %edx, %ecx
movq %rsi, %rdx
testq %rdi, %rdi
je 0x1378
leaq -0x18(%rdi), %rsi
xorl %r8d, %r8d
leaq 0x8f2b(%rip), %rax      # 0xa200
cmpq (%r8,%rax), %rsi
jne 0x12e1
cmpl $0x0, -0x8(%rdi)
je 0x1304
addq $0x8, %r8
cmpq $0x2090, %r8            # imm = 0x2090
jne 0x12d5
movq 0x2d03(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xdd3(%rip), %rsi       # 0x20d2
jmp 0x1389
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x132d
cmpl $0x0, 0x10(%rcx)
je 0x132d
movl -0x4(%rdi), %edx
movl 0x14(%rcx), %esi
addl %esi, %edx
addl $0x18, %edx
movl %edx, 0x14(%rcx)
movq $0x0, (%r8,%rax)
movq %rcx, %rsi
jmp 0x1334
movl $0x1, -0x8(%rdi)
movq -0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x136e
cmpl $0x0, 0x10(%rcx)
je 0x136e
movl 0x14(%rcx), %edx
movl 0x14(%rsi), %edi
addl %edi, %edx
addl $0x18, %edx
movl %edx, 0x14(%rsi)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsi)
xorl %edx, %edx
cmpq (%rdx,%rax), %rcx
je 0x136f
addq $0x8, %rdx
cmpq $0x2090, %rdx           # imm = 0x2090
jne 0x135b
retq
movq $0x0, (%rdx,%rax)
retq
movq 0x2c79(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd07(%rip), %rsi       # 0x2090
xorl %eax, %eax
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_tga
STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
   stbi__write_context s;
   if (stbi__start_write_file(&s,filename)) {
      int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
      stbi__end_write_file(&s);
      return r;
   } else
      return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r13d
leaq 0xd3fe(%rip), %rsi      # 0xec65
callq 0x11c0
movq %rax, %r12
leaq 0x880e(%rip), %rax      # 0xa084
movq %rax, -0x38(%rbp)
movq %r12, -0x30(%rbp)
testq %r12, %r12
je 0x18a4
leaq -0x38(%rbp), %rdi
movl %r13d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movq %rbx, %r8
callq 0x1462
movl %eax, %ebx
movq %r12, %rdi
callq 0x1080
jmp 0x18a6
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_hdr
STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
{
   stbi__write_context s;
   if (stbi__start_write_file(&s,filename)) {
      int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data);
      stbi__end_write_file(&s);
      return r;
   } else
      return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r13d
leaq 0xcf1c(%rip), %rsi      # 0xec65
callq 0x11c0
movq %rax, %r12
leaq 0x832c(%rip), %rax      # 0xa084
movq %rax, -0x38(%rbp)
movq %r12, -0x30(%rbp)
testq %r12, %r12
je 0x1d86
leaq -0x38(%rbp), %rdi
movl %r13d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movq %rbx, %r8
callq 0x18e2
movl %eax, %ebx
movq %r12, %rdi
callq 0x1080
jmp 0x1d88
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbiw__sbgrowf
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
{
   int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
   void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2);
   STBIW_ASSERT(p);
   if (p) {
      if (!*arr) ((int *) p)[1] = 0;
      *arr = (void *) ((int *) p + 2);
      stbiw__sbm(*arr) = m;
   }
   return *arr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x25a4
movl -0x8(%rax), %ecx
leal 0x1(,%rcx,2), %r14d
jmp 0x25aa
movl $0x2, %r14d
leaq -0x8(%rax), %rdi
testq %rax, %rax
cmoveq %rax, %rdi
imull %r14d, %esi
movslq %esi, %rsi
addq $0x8, %rsi
callq 0x11a0
testq %rax, %rax
je 0x25e9
cmpq $0x0, (%rbx)
jne 0x25d7
movl $0x0, 0x4(%rax)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rbx)
movl %r14d, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xd056(%rip), %rdi      # 0xf646
leaq 0xc5ab(%rip), %rsi      # 0xeba2
leaq 0xc98c(%rip), %rcx      # 0xef8a
movl $0x319, %edx            # imm = 0x319
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbiw__zlib_flushf
static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
{
   while (*bitcount >= 8) {
      stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer));
      *bitbuffer >>= 8;
      *bitcount -= 8;
   }
   return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rax
movq %rdi, -0x20(%rbp)
cmpl $0x8, (%rdx)
jl 0x2670
movq %rdx, %rbx
movq %rsi, %r14
leaq -0x20(%rbp), %r15
testq %rax, %rax
je 0x2638
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
cmpl -0x8(%rax), %edx
jl 0x264f
movq %r15, %rdi
movl $0x1, %esi
callq 0x2585
movq -0x20(%rbp), %rax
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movb (%r14), %sil
movl %edx, -0x4(%rax)
movslq %ecx, %rcx
movb %sil, (%rax,%rcx)
shrl $0x8, (%r14)
movl (%rbx), %ecx
leal -0x8(%rcx), %edx
movl %edx, (%rbx)
cmpl $0xf, %ecx
jg 0x2628
movq -0x20(%rbp), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_png
STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
{
   FILE *f;
   int len;
   unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len);
   if (png == NULL) return 0;

   f = stbiw__fopen(filename, "wb");
   if (!f) { STBIW_FREE(png); return 0; }
   fwrite(png, 1, len, f);
   fclose(f);
   STBIW_FREE(png);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r10d
movl %ecx, %eax
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %r14
leaq -0x14(%rbp), %r9
movq %r8, %rdi
movl %r10d, %esi
movl %eax, %r8d
callq 0x267b
testq %rax, %rax
je 0x2d7a
movq %rax, %rbx
leaq 0xbf1f(%rip), %rsi      # 0xec65
movq %r14, %rdi
callq 0x11c0
testq %rax, %rax
je 0x2d7f
movq %rax, %r14
movslq -0x14(%rbp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x1200
movq %r14, %rdi
callq 0x1080
movl $0x1, %r14d
jmp 0x2d82
xorl %r14d, %r14d
jmp 0x2d8a
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1030
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_png_to_func
STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes)
{
   int len;
   unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len);
   if (png == NULL) return 0;
   func(context, png, len);
   STBIW_FREE(png);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r9, %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rbp), %esi
leaq -0x1c(%rbp), %r9
movq %rax, %rdi
callq 0x267b
testq %rax, %rax
je 0x2dda
movq %rax, %r15
movl -0x1c(%rbp), %edx
movq %r14, %rdi
movq %rax, %rsi
callq *%rbx
movq %r15, %rdi
callq 0x1030
movl $0x1, %eax
jmp 0x2ddc
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_image_write.h
// Function: stbi_write_jpg
STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality)
{
   stbi__write_context s;
   if (stbi__start_write_file(&s,filename)) {
      int r = stbi_write_jpg_core(&s, x, y, comp, data, quality);
      stbi__end_write_file(&s);
      return r;
   } else
      return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, -0x2c(%rbp)
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebx
leaq 0xb71e(%rip), %rsi      # 0xec65
callq 0x11c0
movq %rax, %r13
leaq 0x6b2e(%rip), %rax      # 0xa084
movq %rax, -0x40(%rbp)
movq %r13, -0x38(%rbp)
testq %r13, %r13
je 0x3587
leaq -0x40(%rbp), %rdi
movl %ebx, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %r14, %r8
movl -0x2c(%rbp), %r9d
callq 0x2e19
movl %eax, %ebx
movq %r13, %rdi
callq 0x1080
jmp 0x3589
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetGlyphBox
STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1)
{
   if (info->cff.size) {
      stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1);
   } else {
      int g = stbtt__GetGlyfOffset(info, glyph_index);
      if (g < 0) return 0;

      if (x0) *x0 = ttSHORT(info->data + g + 2);
      if (y0) *y0 = ttSHORT(info->data + g + 4);
      if (x1) *x1 = ttSHORT(info->data + g + 6);
      if (y1) *y1 = ttSHORT(info->data + g + 8);
   }
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r15
cmpl $0x0, 0x4c(%rdi)
je 0x426a
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
movq %r14, %r8
movq %rbx, %r9
callq 0x42fc
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x438b
testl %eax, %eax
js 0x42f5
movl %eax, %ecx
testq %r13, %r13
je 0x4295
movq 0x8(%r15), %rax
movzbl 0x3(%rax,%rcx), %edx
movzbl 0x2(%rax,%rcx), %eax
shll $0x8, %eax
cwtl
orl %edx, %eax
movl %eax, (%r13)
testq %r12, %r12
je 0x42b2
movq 0x8(%r15), %rax
movzbl 0x5(%rax,%rcx), %edx
movzbl 0x4(%rax,%rcx), %eax
shll $0x8, %eax
cwtl
orl %edx, %eax
movl %eax, (%r12)
testq %r14, %r14
je 0x42ce
movq 0x8(%r15), %rax
movzbl 0x7(%rax,%rcx), %edx
movzbl 0x6(%rax,%rcx), %eax
shll $0x8, %eax
cwtl
orl %edx, %eax
movl %eax, (%r14)
movl $0x1, %eax
testq %rbx, %rbx
je 0x425b
movq 0x8(%r15), %rdx
movzbl 0x9(%rdx,%rcx), %esi
movzbl 0x8(%rdx,%rcx), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %esi, %ecx
movl %ecx, (%rbx)
jmp 0x425b
xorl %eax, %eax
jmp 0x425b
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__GetGlyphInfoT2
static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1)
{
   stbtt__csctx c = STBTT__CSCTX_INIT(1);
   int r = stbtt__run_charstring(info, glyph_index, &c);
   if (x0)  *x0 = r ? c.min_x : 0;
   if (y0)  *y0 = r ? c.min_y : 0;
   if (x1)  *x1 = r ? c.max_x : 0;
   if (y1)  *y1 = r ? c.max_y : 0;
   return r ? c.num_vertices : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movq $0x0, 0x30(%rdx)
movl $0x1, (%rdx)
callq 0xa711
testq %r12, %r12
je 0x434e
movl %eax, %ecx
testl %eax, %eax
je 0x434a
movl -0x48(%rbp), %ecx
movl %ecx, (%r12)
testq %r15, %r15
je 0x435f
movl %eax, %ecx
testl %eax, %eax
je 0x435c
movl -0x40(%rbp), %ecx
movl %ecx, (%r15)
testq %r14, %r14
je 0x4370
movl %eax, %ecx
testl %eax, %eax
je 0x436d
movl -0x44(%rbp), %ecx
movl %ecx, (%r14)
testq %rbx, %rbx
je 0x437e
testl %eax, %eax
je 0x437c
movl -0x3c(%rbp), %eax
movl %eax, (%rbx)
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__GetGlyfOffset
static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index)
{
   int g1,g2;

   STBTT_assert(!info->cff.size);

   if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range
   if (info->indexToLocFormat >= 2)    return -1; // unknown index->glyph map format

   if (info->indexToLocFormat == 0) {
      g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2;
      g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2;
   } else {
      g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4);
      g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4);
   }

   return g1==g2 ? -1 : g1; // if length is 0, return -1
}

// Assembly:
cmpl $0x0, 0x4c(%rdi)
jne 0x43f1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %esi, 0x14(%rdi)
jle 0x43f0
movl 0x38(%rdi), %r8d
cmpl $0x1, %r8d
jg 0x43f0
movslq 0x18(%rdi), %rdx
addq 0x8(%rdi), %rdx
movl 0x20(%rdi), %ecx
movslq %esi, %rsi
testl %r8d, %r8d
je 0x43c5
movl (%rdx,%rsi,4), %eax
movl 0x4(%rdx,%rsi,4), %edx
bswapl %eax
bswapl %edx
jmp 0x43e4
movzbl (%rdx,%rsi,2), %eax
movzbl 0x1(%rdx,%rsi,2), %edi
shll $0x9, %eax
leal (%rax,%rdi,2), %eax
movzbl 0x2(%rdx,%rsi,2), %edi
movzbl 0x3(%rdx,%rsi,2), %edx
shll $0x9, %edi
leal (%rdi,%rdx,2), %edx
addl %eax, %ecx
cmpl %edx, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnel %ecx, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xabb6(%rip), %rdi      # 0xefb2
leaq 0xa865(%rip), %rsi      # 0xec68
leaq 0xabb8(%rip), %rcx      # 0xefc2
movl $0x613, %edx            # imm = 0x613
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_IsGlyphEmpty
STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index)
{
   stbtt_int16 numberOfContours;
   int g;
   if (info->cff.size)
      return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0;
   g = stbtt__GetGlyfOffset(info, glyph_index);
   if (g < 0) return 1;
   numberOfContours = ttSHORT(info->data + g);
   return numberOfContours == 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x4c(%rdi)
je 0x44ae
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movq $0x0, 0x30(%r14)
movl $0x1, (%r14)
movq %rbx, %rdi
movq %r14, %rdx
callq 0xa711
testl %eax, %eax
sete %cl
cmpl $0x0, 0x30(%r14)
sete %al
orb %cl, %al
jmp 0x44ce
movq %rbx, %rdi
callq 0x438b
testl %eax, %eax
js 0x44cc
movq 0x8(%rbx), %rcx
movl %eax, %eax
movb 0x1(%rcx,%rax), %dl
orb (%rcx,%rax), %dl
sete %al
jmp 0x44ce
movb $0x1, %al
movzbl %al, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetGlyphHMetrics
STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing)
{
   stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34);
   if (glyph_index < numOfLongHorMetrics) {
      if (advanceWidth)     *advanceWidth    = ttSHORT(info->data + info->hmtx + 4*glyph_index);
      if (leftSideBearing)  *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2);
   } else {
      if (advanceWidth)     *advanceWidth    = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1));
      if (leftSideBearing)  *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics));
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movslq 0x24(%rdi), %r8
movzwl 0x22(%rax,%r8), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r9d
movl %esi, %r8d
subl %r9d, %r8d
jge 0x4548
testq %rdx, %rdx
je 0x4525
movslq 0x28(%rdi), %r8
addq %rax, %r8
movslq %esi, %r9
movzbl 0x1(%r8,%r9,4), %r10d
movzbl (%r8,%r9,4), %r8d
shll $0x8, %r8d
movswl %r8w, %r8d
orl %r10d, %r8d
movl %r8d, (%rdx)
testq %rcx, %rcx
je 0x45a1
movslq 0x28(%rdi), %rdx
addq %rdx, %rax
shll $0x2, %esi
movslq %esi, %rsi
leaq (%rsi,%rax), %rdx
addq $0x2, %rdx
addq %rsi, %rax
addq $0x3, %rax
jmp 0x4591
movl %r9d, %esi
testq %rdx, %rdx
je 0x4571
movslq 0x28(%rdi), %r9
addq %rax, %r9
movzbl -0x3(%r9,%rsi,4), %r10d
movzbl -0x4(%r9,%rsi,4), %r9d
shll $0x8, %r9d
movswl %r9w, %r9d
orl %r10d, %r9d
movl %r9d, (%rdx)
testq %rcx, %rcx
je 0x45a1
movslq 0x28(%rdi), %rdx
addq %rdx, %rax
leaq (%rax,%rsi,4), %rax
addl %r8d, %r8d
movslq %r8d, %rsi
leaq (%rax,%rsi), %rdx
addq %rsi, %rax
incq %rax
movzbl (%rax), %eax
movzbl (%rdx), %edx
shll $0x8, %edx
movswl %dx, %edx
orl %eax, %edx
movl %edx, (%rcx)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetFontVMetricsOS2
STBTT_DEF int  stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap)
{
   int tab = stbtt__find_table(info->data, info->fontstart, "OS/2");
   if (!tab)
      return 0;
   if (typoAscent ) *typoAscent  = ttSHORT(info->data+tab + 68);
   if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70);
   if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72);
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq 0x8(%rdi), %r14
movl 0x10(%rdi), %esi
leaq 0xa132(%rip), %rdx      # 0xece7
movq %r14, %rdi
callq 0x4c2a
testl %eax, %eax
je 0x4c1f
movslq %eax, %rcx
testq %r12, %r12
je 0x4be1
movzbl 0x45(%r14,%rcx), %eax
movzbl 0x44(%r14,%rcx), %edx
shll $0x8, %edx
movswl %dx, %edx
orl %eax, %edx
movl %edx, (%r12)
testq %r15, %r15
je 0x4bfd
movzbl 0x47(%r14,%rcx), %eax
movzbl 0x46(%r14,%rcx), %edx
shll $0x8, %edx
movswl %dx, %edx
orl %eax, %edx
movl %edx, (%r15)
movl $0x1, %eax
testq %rbx, %rbx
je 0x4c21
movzbl 0x49(%r14,%rcx), %edx
movzbl 0x48(%r14,%rcx), %ecx
shll $0x8, %ecx
movswl %cx, %ecx
orl %edx, %ecx
movl %ecx, (%rbx)
jmp 0x4c21
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__find_table
static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag)
{
   stbtt_int32 num_tables = ttUSHORT(data+fontstart+4);
   stbtt_uint32 tabledir = fontstart + 12;
   stbtt_int32 i;
   for (i=0; i < num_tables; ++i) {
      stbtt_uint32 loc = tabledir + 16*i;
      if (stbtt_tag(data+loc+0, tag))
         return ttULONG(data+loc+8);
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, %eax
movzwl 0x4(%rdi,%rax), %ecx
rolw $0x8, %cx
xorl %eax, %eax
testw %cx, %cx
je 0x4c91
movzwl %cx, %r8d
movsbl (%rdx), %ecx
movl %r8d, %r8d
addl $0xc, %esi
movl %esi, %esi
movzbl (%rdi,%rsi), %r9d
cmpl %ecx, %r9d
jne 0x4c89
movzbl 0x1(%rdi,%rsi), %r9d
movsbl 0x1(%rdx), %r10d
cmpl %r10d, %r9d
jne 0x4c89
movzbl 0x2(%rdi,%rsi), %r9d
movsbl 0x2(%rdx), %r10d
cmpl %r10d, %r9d
jne 0x4c89
movzbl 0x3(%rdi,%rsi), %r9d
movsbl 0x3(%rdx), %r10d
cmpl %r10d, %r9d
je 0x4c93
addl $0x10, %esi
decq %r8
jne 0x4c4d
popq %rbp
retq
movl 0x8(%rdi,%rsi), %eax
bswapl %eax
jmp 0x4c91
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetFontBoundingBox
STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1)
{
   *x0 = ttSHORT(info->data + info->head + 36);
   *y0 = ttSHORT(info->data + info->head + 38);
   *x1 = ttSHORT(info->data + info->head + 40);
   *y1 = ttSHORT(info->data + info->head + 42);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movslq 0x1c(%rdi), %r9
movzbl 0x25(%rax,%r9), %r10d
movzbl 0x24(%rax,%r9), %r9d
shll $0x8, %r9d
movswl %r9w, %r9d
orl %r10d, %r9d
movl %r9d, (%rsi)
movslq 0x1c(%rdi), %rsi
movzbl 0x27(%rax,%rsi), %r9d
movzbl 0x26(%rax,%rsi), %esi
shll $0x8, %esi
movswl %si, %esi
orl %r9d, %esi
movl %esi, (%rdx)
movslq 0x1c(%rdi), %rdx
movzbl 0x29(%rax,%rdx), %esi
movzbl 0x28(%rax,%rdx), %edx
shll $0x8, %edx
movswl %dx, %edx
orl %esi, %edx
movl %edx, (%rcx)
movslq 0x1c(%rdi), %rcx
movzbl 0x2b(%rax,%rcx), %edx
movzbl 0x2a(%rax,%rcx), %eax
shll $0x8, %eax
cwtl
orl %edx, %eax
movl %eax, (%r8)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetGlyphBitmapBoxSubpixel
STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1)
{
   int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning
   if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) {
      // e.g. space character
      if (ix0) *ix0 = 0;
      if (iy0) *iy0 = 0;
      if (ix1) *ix1 = 0;
      if (iy1) *iy1 = 0;
   } else {
      // move to integral bboxes (treating pixels as little squares, what pixels get touched)?
      if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x);
      if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y);
      if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x);
      if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movss %xmm3, -0x30(%rbp)
movss %xmm2, -0x28(%rbp)
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x24(%rbp)
xorl %eax, %eax
leaq -0x40(%rbp), %rdx
movl %eax, (%rdx)
leaq -0x3c(%rbp), %rcx
movl %eax, (%rcx)
leaq -0x38(%rbp), %r8
leaq -0x34(%rbp), %r9
callq 0x421f
testl %eax, %eax
je 0x4e5b
testq %r12, %r12
je 0x4deb
xorps %xmm0, %xmm0
cvtsi2ssl -0x40(%rbp), %xmm0
mulss -0x24(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
callq 0x11d0
cvttss2si %xmm0, %eax
movl %eax, (%r12)
testq %r15, %r15
je 0x4e12
xorl %eax, %eax
subl -0x34(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss -0x2c(%rbp), %xmm0
addss -0x30(%rbp), %xmm0
callq 0x11d0
cvttss2si %xmm0, %eax
movl %eax, (%r15)
testq %r14, %r14
je 0x4e35
xorps %xmm0, %xmm0
cvtsi2ssl -0x38(%rbp), %xmm0
mulss -0x24(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
callq 0x1110
cvttss2si %xmm0, %eax
movl %eax, (%r14)
testq %rbx, %rbx
je 0x4e89
xorl %eax, %eax
subl -0x3c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss -0x2c(%rbp), %xmm0
addss -0x30(%rbp), %xmm0
callq 0x1110
cvttss2si %xmm0, %eax
jmp 0x4e87
testq %r12, %r12
je 0x4e68
movl $0x0, (%r12)
testq %r15, %r15
je 0x4e74
movl $0x0, (%r15)
testq %r14, %r14
je 0x4e80
movl $0x0, (%r14)
xorl %eax, %eax
testq %rbx, %rbx
je 0x4e89
movl %eax, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_MakeGlyphBitmapSubpixel
STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph)
{
   int ix0,iy0;
   stbtt_vertex *vertices;
   int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices);
   stbtt__bitmap gbm;   

   stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0);
   gbm.pixels = output;
   gbm.w = out_w;
   gbm.h = out_h;
   gbm.stride = out_stride;

   if (gbm.w && gbm.h)
      stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata);

   STBTT_free(vertices, info->userdata);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebx
movss %xmm3, -0x38(%rbp)
movss %xmm2, -0x34(%rbp)
movss %xmm1, -0x30(%rbp)
movss %xmm0, -0x2c(%rbp)
movl %r8d, -0x40(%rbp)
movl %ecx, %r14d
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r15
leaq -0x50(%rbp), %rdx
movl %r9d, %esi
callq 0x3889
movl %eax, -0x3c(%rbp)
leaq -0x48(%rbp), %rdx
leaq -0x44(%rbp), %rcx
movq %r15, %rdi
movl %ebx, %esi
movss -0x2c(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss -0x34(%rbp), %xmm2
movss -0x38(%rbp), %xmm3
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x4d75
movq %r13, -0x58(%rbp)
movl %r12d, -0x68(%rbp)
movl %r14d, -0x64(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x60(%rbp)
testl %r12d, %r12d
sete %al
testl %r14d, %r14d
sete %cl
leaq -0x50(%rbp), %rdx
movq (%rdx), %r14
orb %al, %cl
jne 0x6235
movl -0x48(%rbp), %ecx
movl -0x44(%rbp), %r8d
leaq -0x68(%rbp), %rdi
movss 0x88b4(%rip), %xmm0     # 0xeac4
movq %r14, %rsi
movl -0x3c(%rbp), %edx
movss -0x2c(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x34(%rbp), %xmm3
movss -0x38(%rbp), %xmm4
movl $0x1, %r9d
callq 0x4f77
movq %r14, %rdi
callq 0x1030
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_MakeGlyphBitmapSubpixelPrefilter
STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph)
{
   stbtt_MakeGlyphBitmapSubpixel(info,
                                 output,
                                 out_w - (prefilter_x - 1),
                                 out_h - (prefilter_y - 1),
                                 out_stride,
                                 scale_x,
                                 scale_y,
                                 shift_x,
                                 shift_y,
                                 glyph);

   if (prefilter_x > 1)
      stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x);

   if (prefilter_y > 1)
      stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y);

   *sub_x = stbtt__oversample_shift(prefilter_x);
   *sub_y = stbtt__oversample_shift(prefilter_y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r14d
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %rbx
movl 0x28(%rbp), %r9d
subl %r14d, %edx
incl %edx
subl 0x10(%rbp), %ecx
incl %ecx
callq 0x6161
cmpl $0x2, %r14d
jl 0x63a5
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0x6a43
movl 0x10(%rbp), %edx
cmpl $0x2, %edx
jl 0x63c5
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl 0x10(%rbp), %r8d
callq 0x6c9d
movl 0x10(%rbp), %edx
movq 0x18(%rbp), %rax
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
testl %r14d, %r14d
je 0x63f3
movl $0x1, %ecx
subl %r14d, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %r14d, %xmm2
addss %xmm2, %xmm2
divss %xmm2, %xmm1
movq 0x20(%rbp), %rcx
movss %xmm1, (%rax)
testl %edx, %edx
je 0x641c
movl $0x1, %eax
subl %edx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
addss %xmm1, %xmm1
divss %xmm1, %xmm0
movss %xmm0, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_GetBakedQuad
STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule)
{
   float d3d_bias = opengl_fillrule ? 0 : -0.5f;
   float ipw = 1.0f / pw, iph = 1.0f / ph;
   const stbtt_bakedchar *b = chardata + char_index;
   int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f);
   int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f);

   q->x0 = round_x + d3d_bias;
   q->y0 = round_y + d3d_bias;
   q->x1 = round_x + b->x1 - b->x0 + d3d_bias;
   q->y1 = round_y + b->y1 - b->y0 + d3d_bias;

   q->s0 = b->x0 * ipw;
   q->t0 = b->y0 * iph;
   q->s1 = b->x1 * ipw;
   q->t1 = b->y1 * iph;

   *xpos += b->xadvance;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, -0x40(%rbp)
movq %r8, %rbx
movq %rdi, %r14
movq 0x10(%rbp), %r12
cmpl $0x0, 0x18(%rbp)
je 0x6592
xorps %xmm0, %xmm0
jmp 0x659a
movss 0x851a(%rip), %xmm0     # 0xeab4
movss %xmm0, -0x2c(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
movss 0x84da(%rip), %xmm1     # 0xea88
movaps %xmm1, %xmm2
divss %xmm0, %xmm2
movss %xmm2, -0x30(%rbp)
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
divss %xmm0, %xmm1
movss %xmm1, -0x34(%rbp)
movslq %ecx, %rax
leaq (%rax,%rax,4), %r13
movss (%rbx), %xmm0
addss 0x8(%r14,%r13,4), %xmm0
addss 0x84c0(%rip), %xmm0     # 0xeaa4
callq 0x11d0
movaps %xmm0, -0x50(%rbp)
cvttss2si %xmm0, %r15d
movq -0x40(%rbp), %rax
movss (%rax), %xmm0
addss 0xc(%r14,%r13,4), %xmm0
addss 0x849b(%rip), %xmm0     # 0xeaa4
callq 0x11d0
cvttss2si %xmm0, %eax
cvttps2dq -0x50(%rbp), %xmm1
cvtdq2ps %xmm1, %xmm1
movss -0x2c(%rbp), %xmm2
addss %xmm2, %xmm1
movss %xmm1, (%r12)
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
addss %xmm2, %xmm0
movss %xmm0, 0x4(%r12)
movzwl 0x4(%r14,%r13,4), %ecx
addl %ecx, %r15d
movzwl (%r14,%r13,4), %edx
subl %edx, %r15d
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
addss %xmm2, %xmm0
movss %xmm0, 0x10(%r12)
movzwl 0x6(%r14,%r13,4), %esi
addl %esi, %eax
movzwl 0x2(%r14,%r13,4), %edi
subl %edi, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
addss %xmm2, %xmm0
movss %xmm0, 0x14(%r12)
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
movss -0x30(%rbp), %xmm3
mulss %xmm3, %xmm0
movss %xmm0, 0x8(%r12)
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
movss -0x34(%rbp), %xmm2
mulss %xmm2, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss %xmm0, 0xc(%r12)
xorps %xmm0, %xmm0
cvtsi2ss %esi, %xmm0
mulss %xmm3, %xmm1
movss %xmm1, 0x18(%r12)
mulss %xmm2, %xmm0
movss %xmm0, 0x1c(%r12)
movss 0x10(%r14,%r13,4), %xmm0
addss (%rbx), %xmm0
movss %xmm0, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackBegin
STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context)
{
   stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context)            ,alloc_context);
   int            num_nodes = pw - padding;
   stbrp_node    *nodes   = (stbrp_node    *) STBTT_malloc(sizeof(*nodes  ) * num_nodes,alloc_context);

   if (context == NULL || nodes == NULL) {
      if (context != NULL) STBTT_free(context, alloc_context);
      if (nodes   != NULL) STBTT_free(nodes  , alloc_context);
      return 0;
   }

   spc->user_allocator_context = alloc_context;
   spc->width = pw;
   spc->height = ph;
   spc->pixels = pixels;
   spc->pack_info = context;
   spc->nodes = nodes;
   spc->padding = padding;
   spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw;
   spc->h_oversample = 1;
   spc->v_oversample = 1;
   spc->skip_missing = 0;

   stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);

   if (pixels)
      STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r13d
movl %r8d, %ebx
movl %ecx, -0x34(%rbp)
movl %edx, %r15d
movq %rsi, -0x40(%rbp)
movq %rdi, %r14
movl $0x14, %edi
callq 0x1170
movq %rax, %r12
movl %r15d, -0x30(%rbp)
movl %r13d, -0x2c(%rbp)
subl %r13d, %r15d
movslq %r15d, %rdi
callq 0x1170
movq %rax, %r13
testq %r12, %r12
setne %al
testq %r13, %r13
setne %cl
testb %cl, %al
jne 0x676d
testq %r12, %r12
je 0x6755
movq %r12, %rdi
callq 0x1030
xorl %ebx, %ebx
testq %r13, %r13
je 0x67ee
movq %r13, %rdi
callq 0x1030
jmp 0x67ee
movq 0x10(%rbp), %rax
movq %rax, (%r14)
movl -0x30(%rbp), %edx
movl %edx, 0x10(%r14)
movl -0x34(%rbp), %ecx
movl %ecx, 0x14(%r14)
movq -0x40(%rbp), %rdi
movq %rdi, 0x30(%r14)
movq %r12, 0x8(%r14)
movq %r13, 0x38(%r14)
movl -0x2c(%rbp), %esi
movl %esi, 0x1c(%r14)
testl %ebx, %ebx
cmovel %edx, %ebx
movl %ebx, 0x18(%r14)
movl $0x1, 0x28(%r14)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%r14)
movl %ecx, %eax
subl %esi, %eax
movl %r15d, (%r12)
movl %eax, 0x4(%r12)
movq $0x0, 0x8(%r12)
movl $0x0, 0x10(%r12)
movl $0x1, %ebx
testq %rdi, %rdi
je 0x67ee
imull %edx, %ecx
movslq %ecx, %rdx
xorl %esi, %esi
callq 0x10d0
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackSetOversampling
STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample)
{
   STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE);
   STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE);
   if (h_oversample <= STBTT_MAX_OVERSAMPLE)
      spc->h_oversample = h_oversample;
   if (v_oversample <= STBTT_MAX_OVERSAMPLE)
      spc->v_oversample = v_oversample;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x9, %esi
jae 0x6836
cmpl $0x9, %edx
jae 0x6855
movl %esi, 0x24(%rdi)
movl %edx, 0x28(%rdi)
popq %rbp
retq
leaq 0x84af(%rip), %rdi      # 0xecec
leaq 0x8424(%rip), %rsi      # 0xec68
leaq 0x84b3(%rip), %rcx      # 0xecfe
movl $0xee8, %edx            # imm = 0xEE8
callq 0x10c0
leaq 0x84f3(%rip), %rdi      # 0xed4f
leaq 0x8405(%rip), %rsi      # 0xec68
leaq 0x8494(%rip), %rcx      # 0xecfe
movl $0xee9, %edx            # imm = 0xEE9
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackFontRanges
STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges)
{
   stbtt_fontinfo info;
   int i,j,n, return_value = 1;
   //stbrp_context *context = (stbrp_context *) spc->pack_info;
   stbrp_rect    *rects;

   // flag all characters as NOT packed
   for (i=0; i < num_ranges; ++i)
      for (j=0; j < ranges[i].num_chars; ++j)
         ranges[i].chardata_for_range[j].x0 =
         ranges[i].chardata_for_range[j].y0 =
         ranges[i].chardata_for_range[j].x1 =
         ranges[i].chardata_for_range[j].y1 = 0;

   n = 0;
   for (i=0; i < num_ranges; ++i)
      n += ranges[i].num_chars;
         
   rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);
   if (rects == NULL)
      return 0;

   info.userdata = spc->user_allocator_context;
   stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index));

   n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);

   stbtt_PackFontRangesPackRects(spc, rects, n);
  
   return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects);

   STBTT_free(rects, spc->user_allocator_context);
   return return_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r8d, %ebx
movq %rcx, %r14
movl %edx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, %r15
xorl %r13d, %r13d
testl %r8d, %r8d
jle 0x74c6
movl %ebx, %eax
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rdx
movslq 0x10(%r14,%rdx,8), %rdi
testq %rdi, %rdi
jle 0x7490
leaq (%r14,%rdx,8), %rdx
movq 0x18(%rdx), %rdx
leaq (%rdi,%rdi,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdi, %rsi
xorl %edi, %edi
movq $0x0, (%rdx,%rdi)
addq $0x1c, %rdi
cmpq %rdi, %rsi
jne 0x747f
incq %rcx
cmpq %rax, %rcx
jne 0x745c
xorl %edi, %edi
testl %ebx, %ebx
jle 0x74c8
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movslq 0x10(%r14,%rcx), %rdx
movslq %edi, %rdi
addq %rdx, %rdi
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x74a8
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
jmp 0x74c8
xorl %edi, %edi
callq 0x1170
testq %rax, %rax
je 0x754a
movq %rax, %r12
movq (%r15), %rax
leaq -0xd8(%rbp), %rcx
movq %rax, (%rcx)
movq %r15, %r13
movq -0x38(%rbp), %r15
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x79a5
leaq -0xd8(%rbp), %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x755f
movq %r13, %rdi
leaq -0xd8(%rbp), %r15
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
movq %r12, %r8
callq 0x687d
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x737b
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
movq %r12, %r8
callq 0x6f43
movl %eax, %r13d
movq %r12, %rdi
callq 0x1030
movl %r13d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt_PackFontRange
STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size,
            int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range)
{
   stbtt_pack_range range;
   range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range;
   range.array_of_unicode_codepoints = NULL;
   range.num_chars                   = num_chars_in_range;
   range.chardata_for_range          = chardata_for_range;
   range.font_size                   = font_size;
   return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq $0x0, 0x8(%rax)
movl %r8d, 0x10(%rax)
movq %r9, 0x18(%rax)
movss %xmm0, (%rax)
movq %rax, %rcx
movl $0x1, %r8d
callq 0x742c
addq $0x30, %rsp
popq %rbp
retq