LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__load_flip(stbi__context*, int*, int*, int*, int)
static unsigned char *stbi__load_flip(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   unsigned char *result = stbi__load_main(s, x, y, comp, req_comp);

   if (stbi__vertically_flip_on_load && result != NULL) {
      int w = *x, h = *y;
      int depth = req_comp ? req_comp : *comp;
      int row,col,z;
      stbi_uc temp;

      // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once
      for (row = 0; row < (h>>1); row++) {
         for (col = 0; col < w; col++) {
            for (z = 0; z < depth; z++) {
               temp = result[(row * w + col) * depth + z];
               result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z];
               result[((h - row - 1) * w + col) * depth + z] = temp;
            }
         }
      }
   }

   return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
callq 0xfe5d
movq %rax, (%rsp)
testq %rax, %rax
je 0xdf3a
cmpl $0x0, 0x1256d(%rip)     # 0x20410
je 0xdf3a
movslq (%r12), %rax
movl (%r15), %edx
testl %ebx, %ebx
jne 0xdeb7
movl (%r14), %ebx
movl %edx, %esi
sarl %esi
xorl %edi, %edi
testl %ebx, %ebx
movl $0x0, %r8d
cmovgl %ebx, %r8d
movslq %ebx, %r9
testl %eax, %eax
movl $0x0, %r10d
cmovgl %eax, %r10d
testl %esi, %esi
cmovlel %edi, %esi
decl %edx
imull %eax, %edx
movq %rax, %r11
imulq %r9, %r11
movq (%rsp), %rbx
cmpq %rsi, %rdi
je 0xdf3a
movslq %edx, %r14
imulq %r9, %r14
addq (%rsp), %r14
movq %rbx, %r15
xorl %r12d, %r12d
cmpq %r10, %r12
je 0xdf30
xorl %r13d, %r13d
cmpq %r13, %r8
je 0xdf25
movb (%r15,%r13), %bpl
movb (%r14,%r13), %cl
movb %cl, (%r15,%r13)
movb %bpl, (%r14,%r13)
incq %r13
jmp 0xdf0b
incq %r12
addq %r9, %r14
addq %r9, %r15
jmp 0xdf03
incq %rdi
subl %eax, %edx
addq %r11, %rbx
jmp 0xdeed
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__start_callbacks(stbi__context*, stbi_io_callbacks*, void*)
static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)
{
   s->io = *c;
   s->io_user_data = user;
   s->buflen = sizeof(s->buffer_start);
   s->read_from_callbacks = 1;
   s->img_buffer_original = s->buffer_start;
   stbi__refill_buffer(s);
}

// Assembly:
movq 0x10(%rsi), %rax
movq %rax, 0x20(%rdi)
movups (%rsi), %xmm0
movups %xmm0, 0x10(%rdi)
movq %rdx, 0x28(%rdi)
movabsq $0x8000000001, %rax     # imm = 0x8000000001
movq %rax, 0x30(%rdi)
leaq 0x38(%rdi), %rax
movq %rax, 0xc8(%rdi)
jmp 0x142ec
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/src/thermalPrinter.cpp
// Function: ThermalPrinter::setControlParameter(unsigned char, unsigned char, unsigned char)
void ThermalPrinter::setControlParameter(uint8_t maxHeatingDots, uint8_t heatingTime, uint8_t heatingInterval) {
    write(27,55);
    write(maxHeatingDots);
    write(heatingTime);
    write(heatingInterval);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7(%rsp), %r14
movb %sil, (%r14)
leaq 0x6(%rsp), %r15
movb %dl, (%r15)
leaq 0x5(%rsp), %r12
movb %cl, (%r12)
leaq 0x4(%rsp), %rsi
movb $0x1b, (%rsi)
leaq 0x3(%rsp), %rdx
movb $0x37, (%rdx)
callq 0xf5f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf614
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf614
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf614
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/src/thermalPrinter.cpp
// Function: ThermalPrinter::print(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void ThermalPrinter::print(const std::string& _text){
    if (bConnected) 
    {
        // Characters perline
        uint nCharByLine = 32;

        uint index = 0;
        while (index+nCharByLine < _text.size()){
            std::string rta = _text.substr(index,nCharByLine);
            port->write(rta);
            usleep(BYTE_TIME*_text.size());
            index += nCharByLine;
        }

        uint rest = _text.size() % nCharByLine;
        std::string remainer = _text.substr(index,rest);
        // for(uint i = 0; i < nCharByLine-rest; i++){
        //     remainer += " ";
        // }
        port->write(remainer);
        usleep(BYTE_TIME*_text.size());
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpb $0x1, 0x10(%rdi)
jne 0xf9e4
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movq %rsp, %r15
pushq $0x20
popq %r12
movl %r13d, %edx
addl $0x20, %r13d
movq 0x8(%rbx), %rcx
cmpq %r13, %rcx
jbe 0xf9b3
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rcx
callq 0x8330
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xa4a2
imull $0x23c, 0x8(%rbx), %edi # imm = 0x23C
callq 0x8480
movq %r15, %rdi
callq 0x8170
jmp 0xf973
andl $0x1f, %ecx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8330
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xa4a2
imull $0x23c, 0x8(%rbx), %edi # imm = 0x23C
callq 0x8480
movq %rsp, %rdi
callq 0x8170
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xf9f4
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8170
movq %rbx, %rdi
callq 0x85c0
nop
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/src/thermalPrinter.cpp
// Function: ThermalPrinter::printBar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BarcodeType)
void ThermalPrinter::printBar(const std::string &data, BarcodeType type) {
    if(bConnected){
        write(29, 107, type);
        port->write(data);
        usleep(BYTE_TIME*data.size());
        write(0);
    }
}

// Assembly:
cmpb $0x1, 0x10(%rdi)
jne 0xfa67
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7(%rsp), %rsi
movb $0x1d, (%rsi)
leaq 0x6(%rsp), %rax
movb $0x6b, (%rax)
leaq 0x5(%rsp), %rcx
movb %dl, (%rcx)
movq %rax, %rdx
callq 0xf654
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xa4a2
imull $0x23c, 0x8(%r14), %edi # imm = 0x23C
callq 0x8480
leaq 0x4(%rsp), %rsi
movb $0x0, (%rsi)
movq %rbx, %rdi
callq 0xf614
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/src/thermalPrinter.cpp
// Function: ThermalPrinter::writeBytesRow(unsigned char const*, int)
void ThermalPrinter::writeBytesRow(const uint8_t *_array, int _width) {
    if(bConnected){
        if(_width>48)
            _width = 48;
        
        const uint8_t command[4] = {18, 42, 1, (uint8_t)_width};
        port->write(command, 4);
        usleep(BYTE_TIME*4);
        
        port->write(_array,_width);
        usleep(BYTE_TIME*_width);
    }
}

// Assembly:
cmpb $0x1, 0x10(%rdi)
jne 0xfe15
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x30, %edx
pushq $0x30
popq %rbp
cmovll %edx, %ebp
leaq 0xc(%rsp), %rsi
movw $0x2a12, (%rsi)         # imm = 0x2A12
movb $0x1, 0x2(%rsi)
movb %bpl, 0x3(%rsi)
movq 0x8(%rdi), %rdi
pushq $0x4
popq %rdx
callq 0xa566
movl $0x8f0, %edi            # imm = 0x8F0
callq 0x8480
movq 0x8(%r14), %rdi
movslq %ebp, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0xa566
imull $0x23c, %r14d, %edi     # imm = 0x23C
callq 0x8480
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__YCbCr_to_RGB_row(unsigned char*, unsigned char const*, unsigned char const*, unsigned char const*, int, int)
static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
{
   int i;
   for (i=0; i < count; ++i) {
      int y_fixed = (y[i] << 20) + (1<<19); // rounding
      int r,g,b;
      int cr = pcr[i] - 128;
      int cb = pcb[i] - 128;
      r = y_fixed +  cr* float2fixed(1.40200f);
      g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);
      b = y_fixed                               +   cb* float2fixed(1.77200f);
      r >>= 20;
      g >>= 20;
      b >>= 20;
      if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
      if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
      if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
      out[0] = (stbi_uc)r;
      out[1] = (stbi_uc)g;
      out[2] = (stbi_uc)b;
      out[3] = 255;
      out += step;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %r9d, %rax
xorl %r9d, %r9d
testl %r8d, %r8d
cmovlel %r9d, %r8d
addq $0x3, %rdi
movl $0xff, %ebp
cmpq %r9, %r8
je 0x13e80
movzbl (%rsi,%r9), %ebx
shll $0x14, %ebx
movzbl (%rcx,%r9), %r14d
addl $-0x80, %r14d
imull $0x166f00, %r14d, %r10d # imm = 0x166F00
leal (%r10,%rbx), %r11d
addl $0x80000, %r11d         # imm = 0x80000
sarl $0x14, %r11d
xorl %r10d, %r10d
testl %r11d, %r11d
cmovlel %r10d, %r11d
cmpl %ebp, %r11d
jl 0x13dff
movl $0xff, %r11d
movzbl (%rdx,%r9), %r15d
addl $-0x80, %r15d
imull $0xfff49300, %r14d, %r14d # imm = 0xFFF49300
leal (%r14,%rbx), %r12d
addl $0x80000, %r12d         # imm = 0x80000
imull $0xfffa7e00, %r15d, %r14d # imm = 0xFFFA7E00
andl $0xffff0000, %r14d      # imm = 0xFFFF0000
addl %r12d, %r14d
sarl $0x14, %r14d
testl %r14d, %r14d
jg 0x13e37
xorl %r14d, %r14d
cmpl %ebp, %r14d
jl 0x13e42
movl $0xff, %r14d
imull $0x1c5a00, %r15d, %r15d # imm = 0x1C5A00
addl %r15d, %ebx
addl $0x80000, %ebx          # imm = 0x80000
sarl $0x14, %ebx
testl %ebx, %ebx
cmovgl %ebx, %r10d
cmpl %ebp, %r10d
jl 0x13e66
movl $0xff, %r10d
movb %r11b, -0x3(%rdi)
movb %r14b, -0x2(%rdi)
movb %r10b, -0x1(%rdi)
movb $-0x1, (%rdi)
incq %r9
addq %rax, %rdi
jmp 0x13dba
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__resample_row_hv_2(unsigned char*, unsigned char*, unsigned char*, int, int)
static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
{
   // need to generate 2x2 samples for every one in input
   int i,t0,t1;
   if (w == 1) {
      out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
      return out;
   }

   t1 = 3*in_near[0] + in_far[0];
   out[0] = stbi__div4(t1+2);
   for (i=1; i < w; ++i) {
      t0 = t1;
      t1 = 3*in_near[i]+in_far[i];
      out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
      out[i*2  ] = stbi__div16(3*t1 + t0 + 8);
   }
   out[w*2-1] = stbi__div4(t1+2);

   STBI_NOTUSED(hs);

   return out;
}

// Assembly:
movq %rdi, %rax
movzbl (%rsi), %r8d
movzbl (%rdx), %edi
cmpl $0x1, %ecx
jne 0x13eb0
movzwl %r8w, %ecx
leal (%rcx,%rcx,2), %ecx
movzwl %di, %edx
addl %edx, %ecx
addl $0x2, %ecx
shrl $0x2, %ecx
movb %cl, 0x1(%rax)
movb %cl, (%rax)
retq
movzwl %r8w, %r8d
leal (%r8,%r8,2), %r8d
movzwl %di, %r9d
leal (%r8,%r9), %edi
addl %r9d, %r8d
addl $0x2, %r8d
shrl $0x2, %r8d
movb %r8b, (%rax)
movslq %ecx, %rcx
pushq $0x1
popq %r8
cmpq %rcx, %r8
jge 0x13f18
movzbl (%rsi,%r8), %r9d
leal (%r9,%r9,2), %r9d
movzbl (%rdx,%r8), %r10d
addl %r9d, %r10d
leal (%rdi,%rdi,2), %r9d
addl %r10d, %r9d
addl $0x8, %r9d
shrl $0x4, %r9d
movb %r9b, -0x1(%rax,%r8,2)
leal (%r10,%r10,2), %r9d
addl %r9d, %edi
addl $0x8, %edi
shrl $0x4, %edi
movb %dil, (%rax,%r8,2)
incq %r8
movl %r10d, %edi
jmp 0x13ed5
addl $0x2, %edi
shrl $0x2, %edi
movb %dil, -0x1(%rax,%rcx,2)
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__build_huffman(stbi__huffman*, int*)
static int stbi__build_huffman(stbi__huffman *h, int *count)
{
   int i,j,k=0,code;
   // build size list for each symbol (from JPEG spec)
   for (i=0; i < 16; ++i)
      for (j=0; j < count[i]; ++j)
         h->size[k++] = (stbi_uc) (i+1);
   h->size[k] = 0;

   // compute actual symbols (from jpeg spec)
   code = 0;
   k = 0;
   for(j=1; j <= 16; ++j) {
      // compute delta to add to code to compute symbol id
      h->delta[j] = k - code;
      if (h->size[k] == j) {
         while (h->size[k] == j)
            h->code[k++] = (stbi__uint16) (code++);
         if (code-1 >= (1 << j)) return stbi__err("bad code lengths","Corrupt JPEG");
      }
      // compute largest code + 1 for this size, preshifted as needed later
      h->maxcode[j] = code << (16-j);
      code <<= 1;
   }
   h->maxcode[j] = 0xffffffff;

   // build non-spec acceleration table; 255 is flag for not-accelerated
   memset(h->fast, 255, 1 << FAST_BITS);
   for (i=0; i < k; ++i) {
      int s = h->size[i];
      if (s <= FAST_BITS) {
         int c = h->code[i] << (FAST_BITS-s);
         int m = 1 << (FAST_BITS-s);
         for (j=0; j < m; ++j) {
            h->fast[c+j] = (stbi_uc) i;
         }
      }
   }
   return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x500(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
movslq %edx, %rdi
cmpq $0x10, %rcx
je 0x14392
leal 0x1(%rcx), %r8d
addq %rax, %rdi
xorl %r9d, %r9d
cmpl (%rsi,%rcx,4), %r9d
jge 0x1438a
movb %r8b, (%rdi,%r9)
incq %r9
jmp 0x1437b
addl %r9d, %edx
incq %rcx
jmp 0x14368
movb $0x0, 0x500(%rbx,%rdi)
xorl %r14d, %r14d
pushq $0x1
popq %rax
pushq $0x1
popq %rbp
xorl %edx, %edx
cmpq $0x11, %rax
je 0x1440a
movl %r14d, %ecx
subl %edx, %ecx
movl %ecx, 0x64c(%rbx,%rax,4)
movslq %r14d, %rcx
movzbl 0x500(%rbx,%rcx), %esi
cmpq %rsi, %rax
jne 0x143f4
movzbl %sil, %esi
cmpq %rsi, %rax
jne 0x143ea
movw %dx, 0x200(%rbx,%rcx,2)
incl %edx
movb 0x501(%rbx,%rcx), %sil
incq %rcx
incl %r14d
jmp 0x143c7
movl %ebp, %esi
movl %eax, %ecx
shll %cl, %esi
cmpl %esi, %edx
jg 0x14470
movb $0x10, %cl
subb %al, %cl
movl %edx, %esi
shll %cl, %esi
movl %esi, 0x604(%rbx,%rax,4)
addl %edx, %edx
incq %rax
jmp 0x143a5
orl $-0x1, 0x648(%rbx)
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
movl $0xff, %esi
callq 0x81d0
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
pushq $0x9
popq %rdx
cmpq %r14, %rax
je 0x14480
movzbl 0x500(%rbx,%rax), %edi
cmpq $0x9, %rdi
ja 0x1446b
movzwl 0x200(%rbx,%rax,2), %esi
movq %rdx, %rcx
subq %rdi, %rcx
shlq %cl, %rsi
addq %rbx, %rsi
xorl %edi, %edi
movl %edi, %r8d
shrl %cl, %r8d
testl %r8d, %r8d
jne 0x1446b
movb %al, (%rsi,%rdi)
incq %rdi
jmp 0x14458
incq %rax
jmp 0x1442f
leaq 0x499d(%rip), %rax      # 0x18e14
movq %rax, 0xbf8a(%rip)      # 0x20408
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__cleanup_jpeg(stbi__jpeg*)
static void stbi__cleanup_jpeg(stbi__jpeg *j)
{
   int i;
   for (i=0; i < j->s->img_n; ++i) {
      if (j->img_comp[i].raw_data) {
         STBI_FREE(j->img_comp[i].raw_data);
         j->img_comp[i].raw_data = NULL;
         j->img_comp[i].data = NULL;
      }
      if (j->img_comp[i].raw_coeff) {
         STBI_FREE(j->img_comp[i].raw_coeff);
         j->img_comp[i].raw_coeff = 0;
         j->img_comp[i].coeff = 0;
      }
      if (j->img_comp[i].linebuf) {
         STBI_FREE(j->img_comp[i].linebuf);
         j->img_comp[i].linebuf = NULL;
      }
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x45f0(%rdi), %r14
xorl %r15d, %r15d
movq (%rbx), %rax
movslq 0x8(%rax), %rax
cmpq %rax, %r15
jge 0x14544
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x14511
callq 0x83d0
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%r14)
movq -0x10(%r14), %rdi
testq %rdi, %rdi
je 0x14528
callq 0x83d0
andq $0x0, -0x10(%r14)
andq $0x0, (%r14)
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0x1453b
callq 0x83d0
andq $0x0, -0x8(%r14)
incq %r15
addq $0x60, %r14
jmp 0x144ef
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__grow_buffer_unsafe(stbi__jpeg*)
static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
{
   do {
      int b = j->nomore ? 0 : stbi__get8(j->s);
      if (b == 0xff) {
         int c = stbi__get8(j->s);
         if (c != 0) {
            j->marker = (unsigned char) c;
            j->nomore = 1;
            return;
         }
      }
      j->code_buffer |= b << (24 - j->code_bits);
      j->code_bits += 8;
   } while (j->code_bits <= 24);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %edx, %edx
cmpl $0x0, 0x472c(%rbx)
jne 0x1481a
movq (%rbx), %rdi
callq 0x142b0
cmpb $-0x1, %al
je 0x14809
movzbl %al, %edx
jmp 0x1481a
movq (%rbx), %rdi
callq 0x142b0
movl $0xff, %edx
testb %al, %al
jne 0x1483c
movl 0x4724(%rbx), %eax
movb $0x18, %cl
subb %al, %cl
shll %cl, %edx
orl %edx, 0x4720(%rbx)
leal 0x8(%rax), %ecx
movl %ecx, 0x4724(%rbx)
cmpl $0x11, %eax
jl 0x147ed
popq %rbx
retq
movb %al, 0x4728(%rbx)
movl $0x1, 0x472c(%rbx)
jmp 0x1483a
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__shiftsigned(int, int, int)
static int stbi__shiftsigned(int v, int shift, int bits)
{
   int result;
   int z=0;

   if (shift < 0) v <<= -shift;
   else v >>= shift;
   result = v;

   z = bits;
   while (z < 8) {
      result += v >> z;
      z += bits;
   }
   return result;
}

// Assembly:
movl %esi, %ecx
negb %cl
movl %edi, %eax
shll %cl, %eax
movl %esi, %ecx
sarl %cl, %edi
testl %esi, %esi
cmovsl %eax, %edi
movl %edi, %eax
movl %edx, %ecx
cmpl $0x7, %ecx
jg 0x1682e
movl %edi, %esi
sarl %cl, %esi
addl %esi, %eax
addl %edx, %ecx
jmp 0x1681f
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__out_gif_code(stbi__gif*, unsigned short)
static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
{
   stbi_uc *p, *c;

   // recurse to decode the prefixes, since the linked-list is backwards,
   // and working backwards through an interleaved image would be nasty
   if (g->codes[code].prefix >= 0)
      stbi__out_gif_code(g, g->codes[code].prefix);

   if (g->cur_y >= g->max_y) return;

   p = &g->out[g->cur_x + g->cur_y];
   c = &g->color_table[g->codes[code].suffix * 4];

   if (c[3] >= 128) {
      p[0] = c[2];
      p[1] = c[1];
      p[2] = c[0];
      p[3] = c[3];
   }
   g->cur_x += 4;

   if (g->cur_x >= g->max_x) {
      g->cur_x = g->start_x;
      g->cur_y += g->step;

      while (g->cur_y >= g->max_y && g->parse > 0) {
         g->step = (1 << g->parse) * g->line_size;
         g->cur_y = g->start_y + (g->step >> 1);
         --g->parse;
      }
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
movzwl 0x824(%rdi,%r14,4), %eax
testw %ax, %ax
js 0x169d4
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x169b1
movslq 0x4850(%rbx), %rcx
cmpl 0x4848(%rbx), %ecx
jge 0x16a3d
movq 0x4828(%rbx), %rax
movzbl 0x827(%rbx,%r14,4), %edx
cmpb $0x0, 0x3(%rax,%rdx,4)
jns 0x16a26
movq 0x8(%rbx), %rsi
movslq 0x484c(%rbx), %rdi
addq %rcx, %rdi
movb 0x2(%rax,%rdx,4), %cl
movb %cl, (%rsi,%rdi)
movb 0x1(%rax,%rdx,4), %cl
movb %cl, 0x1(%rsi,%rdi)
movb (%rax,%rdx,4), %cl
movb %cl, 0x2(%rsi,%rdi)
movb 0x3(%rax,%rdx,4), %al
movb %al, 0x3(%rsi,%rdi)
movl 0x484c(%rbx), %eax
addl $0x4, %eax
movl %eax, 0x484c(%rbx)
cmpl 0x4844(%rbx), %eax
jge 0x16a45
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x483c(%rbx), %ecx
movl 0x4848(%rbx), %eax
movl %ecx, 0x484c(%rbx)
movl 0x4850(%rbx), %edx
addl 0x4834(%rbx), %edx
movl %edx, 0x4850(%rbx)
cmpl %eax, %edx
jl 0x16a3d
movl 0x4830(%rbx), %ecx
testl %ecx, %ecx
jle 0x16a3d
movl 0x4854(%rbx), %edx
shll %cl, %edx
movl %edx, 0x4834(%rbx)
sarl %edx
addl 0x4840(%rbx), %edx
movl %edx, 0x4850(%rbx)
decl %ecx
movl %ecx, 0x4830(%rbx)
jmp 0x16a69
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__pnm_info(stbi__context*, int*, int*, int*)
static int      stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
{
   int maxv;
   char c, p, t;

   stbi__rewind( s );

   // Get identifier
   p = (char) stbi__get8(s);
   t = (char) stbi__get8(s);
   if (p != 'P' || (t != '5' && t != '6')) {
       stbi__rewind( s );
       return 0;
   }

   *comp = (t == '6') ? 3 : 1;  // '5' is 1-component .pgm; '6' is 3-component .ppm

   c = (char) stbi__get8(s);
   stbi__pnm_skip_whitespace(s, &c);

   *x = stbi__pnm_getinteger(s, &c); // read width
   stbi__pnm_skip_whitespace(s, &c);

   *y = stbi__pnm_getinteger(s, &c); // read height
   stbi__pnm_skip_whitespace(s, &c);

   maxv = stbi__pnm_getinteger(s, &c);  // read max value

   if (maxv > 255)
      return stbi__err("max value > 255", "PPM image not 8-bit");
   else
      return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0xc8(%rdi), %rax
movq %rax, 0xb8(%rdi)
callq 0x142b0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x142b0
cmpb $0x50, %bpl
sete %cl
leal -0x37(%rax), %edx
cmpb $-0x2, %dl
setae %dl
testb %dl, %cl
jne 0x16bba
movq 0xc8(%rbx), %rax
movq %rax, 0xb8(%rbx)
jmp 0x16c3a
xorl %ecx, %ecx
cmpb $0x36, %al
sete %cl
leal 0x1(,%rcx,2), %eax
movl %eax, (%r12)
movq %rbx, %rdi
callq 0x142b0
leaq 0xf(%rsp), %r12
movb %al, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c4e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c90
movl %eax, (%r15)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c4e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c90
movl %eax, (%r14)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c4e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16c90
cmpl $0x100, %eax            # imm = 0x100
jl 0x16c3e
leaq 0x2888(%rip), %rax      # 0x194bb
movq %rax, 0x97ce(%rip)      # 0x20408
xorl %eax, %eax
jmp 0x16c41
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__fill_bits(stbi__zbuf*)
static void stbi__fill_bits(stbi__zbuf *z)
{
   do {
      STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
      z->code_buffer |= stbi__zget8(z) << z->num_bits;
      z->num_bits += 8;
   } while (z->num_bits <= 24);
}

// Assembly:
pushq %rax
movl 0x10(%rdi), %ecx
movl 0x14(%rdi), %eax
movl %eax, %edx
shrl %cl, %edx
testl %edx, %edx
jne 0x17076
movq (%rdi), %rsi
xorl %edx, %edx
cmpq 0x8(%rdi), %rsi
jae 0x17060
leaq 0x1(%rsi), %rdx
movq %rdx, (%rdi)
movzbl (%rsi), %edx
shll %cl, %edx
orl %edx, %eax
movl %eax, 0x14(%rdi)
leal 0x8(%rcx), %edx
movl %edx, 0x10(%rdi)
cmpl $0x11, %ecx
movl %edx, %ecx
jl 0x17043
popq %rax
retq
leaq 0x24f2(%rip), %rdi      # 0x1956f
leaq 0x1ee3(%rip), %rsi      # 0x18f67
leaq 0x2509(%rip), %rcx      # 0x19594
movl $0xdd8, %edx            # imm = 0xDD8
callq 0x8210
// File: /workspace/github_c_makefile_star2_O2/patriciogonzalezvivo[P]tprint/include/std/stb_image.h
// Function: stbi__zexpand(stbi__zbuf*, char*, int)
static int stbi__zexpand(stbi__zbuf *z, char *zout, int n)  // need to make room for n bytes
{
   char *q;
   int cur, limit;
   z->zout = zout;
   if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
   cur   = (int) (z->zout     - z->zout_start);
   limit = (int) (z->zout_end - z->zout_start);
   while (cur + n > limit)
      limit *= 2;
   q = (char *) STBI_REALLOC(z->zout_start, limit);
   if (q == NULL) return stbi__err("outofmem", "Out of memory");
   z->zout_start = q;
   z->zout       = q + cur;
   z->zout_end   = q + limit;
   return 1;
}

// Assembly:
movq %rsi, 0x18(%rdi)
cmpl $0x0, 0x30(%rdi)
je 0x170ec
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
subq %rdi, %r14
movl 0x28(%rbx), %eax
subl %edi, %eax
addl %r14d, %edx
movl %eax, %ecx
leal (%rcx,%rcx), %eax
cmpl %ecx, %edx
jg 0x170b9
movslq %ecx, %r15
movq %r15, %rsi
callq 0x8560
testq %rax, %rax
je 0x170fd
movq %rax, 0x20(%rbx)
movslq %r14d, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rbx)
addq %rax, %r15
movq %r15, 0x28(%rbx)
pushq $0x1
popq %rax
jmp 0x1710d
leaq 0x2524(%rip), %rax      # 0x19617
movq %rax, 0x930e(%rip)      # 0x20408
xorl %eax, %eax
retq
leaq 0x1d93(%rip), %rax      # 0x18e97
movq %rax, 0x92fd(%rip)      # 0x20408
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/put-tags.c
// Function: tag_output_close
void tag_output_close(void) {
	if (O.tag_deferred) {
		FILE *deferred = tag_output;
		tag_output = stdout;
		rewind(deferred);
		size_t readlen;
		uint8_t buf[STACK_BUF_LEN];
		while(readlen = fread(buf, 1, STACK_BUF_LEN, deferred)) {
			put_bin(buf, readlen);
		}
		fclose(deferred);
	}
	
	if (fclose(stdout) == EOF) {
		puterror();
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
leaq 0x1a099(%rip), %rax     # 0x1c688
cmpb $0x1, 0x20(%rax)
jne 0x2648
leaq 0x1a0ec(%rip), %rax     # 0x1c6e8
movq (%rax), %rbx
movq 0x99ba(%rip), %rcx      # 0xbfc0
movq (%rcx), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
callq 0x2150
movq %rsp, %r14
pushq $0x1
popq %r15
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x20e0
testq %rax, %rax
je 0x2640
movq %r14, %rdi
movq %rax, %rsi
callq 0x2670
jmp 0x261b
movq %rbx, %rdi
callq 0x2120
movq 0x9971(%rip), %rax      # 0xbfc0
movq (%rax), %rdi
callq 0x2120
addq $0x1000, %rsp           # imm = 0x1000
cmpl $-0x1, %eax
je 0x2669
popq %rbx
popq %r14
popq %r15
retq
popq %rbx
popq %r14
popq %r15
jmp 0x2693
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/put-tags.c
// Function: iconv_new
iconv_t iconv_new(char const *to, char const *from) {
#if defined __GLIBC__ || defined _LIBICONV_VERSION
	char to2[64];
	strcat(strcpy(to2, to), "//TRANSLIT");
#else
	char const *to2 = to;
#endif
	iconv_t cd = iconv_open(to2, from);
	if (cd == (iconv_t)-1) {
		if (errno == EINVAL) {
			oserror_fmt(catgets(catd, 4, 3, "iconv doesn't support converting %s -> %s"), from, to);
		}
		else {
			oserror();
		}
	}
	return cd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2090
movq %r15, %rdi
callq 0x2130
movabsq $0x4c534e4152542f2f, %rcx # imm = 0x4C534E4152542F2F
movq %rcx, (%rsp,%rax)
movl $0x54494c, 0x7(%rsp,%rax) # imm = 0x54494C
movq %r15, %rdi
movq %r14, %rsi
callq 0x24d0
movq %rax, %r15
cmpq $-0x1, %rax
jne 0x292a
callq 0x2050
cmpl $0x16, (%rax)
jne 0x2925
leaq 0x19d82(%rip), %rax     # 0x1c680
movq (%rax), %rdi
leaq 0x570d(%rip), %rcx      # 0x8015
pushq $0x4
popq %rsi
pushq $0x3
popq %rdx
callq 0x2440
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x67ce
jmp 0x292a
callq 0x67b6
movq %r15, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/put-tags.c
// Function: conv_ls
static size_t conv_ls(iconv_t cd, uint8_t *buf, size_t tagleft) {
	uint8_t *u8 = buf;
	char *ls = buf + tagleft;
	size_t remain = 0;
	for (;;) {
		char *lsend = ls;
		size_t bufleft = STACK_BUF_LEN - ((uint8_t*)ls - buf) - 1;
		size_t iconvret = iconv(cd, (char**)&u8, &tagleft, &lsend, &bufleft);
		int ie = errno;
		errno = 0;
		if (iconvret == (size_t)-1 && ie == EILSEQ) {
			u8error();
		}
		*lsend = '\0';
		// WONTFIX
		// ロケール文字列に \0 が含まれていてもそのままそこで途切れさせる
		put_ls(ls);
		if (iconvret != (size_t)-1 || ie == EINVAL) {
			remain = tagleft;
			if (remain) {
				memcpy(buf, u8, remain);
			}
			break;
		}
	}
	return remain;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rax
movq %rdx, (%rax)
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movq %rsi, 0x18(%rsp)
leaq (%rsi,%rdx), %r13
movl $0xfff, %r12d           # imm = 0xFFF
subq %rdx, %r12
leaq 0x20(%rsp), %rbx
movq %r13, (%rsp)
movq %r12, 0x20(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
movq %rbx, %r8
callq 0x20b0
movq %rax, %r15
callq 0x2050
movl (%rax), %ebp
andl $0x0, (%rax)
cmpq $-0x1, %r15
sete %al
cmpl $0x54, %ebp
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x29c6
callq 0x2a0e
movq (%rsp), %rax
movb $0x0, (%rax)
movq %r13, %rdi
callq 0x2a1e
cmpq $-0x1, %r15
jne 0x29e0
cmpl $0x16, %ebp
jne 0x297f
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x29fc
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
callq 0x22a0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/put-tags.c
// Function: esc_oc
static uint8_t *esc_oc(uint8_t *src, uint8_t *dest, size_t len) {
	uint8_t *end = src + len;
	while(src < end) {
		*dest++ = *src++;
		if (src[-1] == 0xa) *dest++ = O.tag_escape_tilde ? 0x7e : 0x9;
	}
	return dest;
}

// Assembly:
addq %rdi, %rdx
leaq 0x19c4b(%rip), %rcx     # 0x1c688
pushq $0x7e
popq %r8
pushq $0x9
popq %r9
movq %rsi, %rax
cmpq %rdx, %rdi
jae 0x2a79
movb (%rdi), %r10b
incq %rdi
leaq 0x1(%rax), %rsi
movb %r10b, (%rax)
cmpb $0xa, %r10b
jne 0x2a45
cmpb $0x0, 0x14(%rcx)
movl %r8d, %esi
jne 0x2a6c
movl %r9d, %esi
movb %sil, 0x1(%rax)
addq $0x2, %rax
movq %rax, %rsi
jmp 0x2a45
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: split_text
void *split_text(void *fp_) {
	FILE *fp = fp_;
	prepare_record();
	void (*line)(uint8_t *, size_t, bool) = O.tag_escape ? line_vc : line_oc;
	
	uint8_t tagbuf[STACK_BUF_LEN];
	size_t readlen;
	while ((readlen = fread(tagbuf, 1, STACK_BUF_LEN, fp)) != 0) {
		uint8_t *p1, *p2;
		if (memchr(tagbuf, 0, readlen) != NULL) {
			err_bin();
		}
		p1 = tagbuf;
		while ((p2 = memchr(p1, 0x0a, readlen - (p1 - tagbuf))) != NULL) {
			p2++;
			line(p1, p2 - p1, true);
			p1 = p2;
		}
		size_t left = readlen - (p1 - tagbuf);
		if (left) line(p1, left, false);
	}
	fclose(fp);
	line(NULL, 0, false);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdi, 0x8(%rsp)
callq 0x2aec
leaq 0x19b1c(%rip), %rax     # 0x1c688
cmpl $0x0, 0x10(%rax)
leaq 0x265(%rip), %rax       # 0x2ddc
leaq 0xac(%rip), %rbp        # 0x2c2a
cmoveq %rax, %rbp
leaq 0x10(%rsp), %r12
movl $0x1000, %edx           # imm = 0x1000
movq %r12, %rdi
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rcx
callq 0x20e0
testq %rax, %rax
je 0x2bff
movq %rax, %r13
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x2200
testq %rax, %rax
jne 0x2c25
movq %r12, %rbx
movq %r12, %r15
subq %rbx, %r15
addq %r13, %r15
movq %rbx, %rdi
pushq $0xa
popq %rsi
movq %r15, %rdx
callq 0x2200
testq %rax, %rax
je 0x2bee
movq %rax, %r14
incq %r14
movq %r14, %rsi
subq %rbx, %rsi
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq *%rbp
movq %r14, %rbx
jmp 0x2bb9
testq %r15, %r15
je 0x2b87
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq *%rbp
jmp 0x2b87
movq 0x8(%rsp), %rdi
callq 0x2120
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq *%rbp
xorl %eax, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2ef6
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: line_vc
static void line_vc(uint8_t *line, size_t n, bool lf) {
	static bool escape_pending = false;
	
	if (!line) {
		if (!first_call) {
			if (O.tag_check_line_term) {
				err_noterm();
			}
			if (!keep_blank) {
				if (escape_pending) err_esc();
				if (on_field) err_nosep();
				finalize_record();
			}
			first_call = true;
		}
		return;
	}
	
	if(test_blank(line, n, lf)) return;
	
	if (escape_pending) {
		*line = esctab(*line);
	}
	
	if (lf) n--;
	uint8_t *bs = memchr(line + escape_pending, 0x5c, n - escape_pending);
	escape_pending = false;
	if (bs) {
		uint8_t *unesc = bs, *end = line + n;
		while (bs < end) {
			uint8_t c = *bs++;
			if (c == 0x5c) {
				if (bs == end) {
					if (lf) err_esc();
					escape_pending = true;
					n--;
					break;
				}
				c = esctab(*bs++);
				n--;
			}
			*unesc++ = c;
		}
	}
	if (on_field) {
		if(!test_tag_field(line, n, true, &on_field, NULL)) err_name();
		if (on_field && lf) err_nosep();
		test_mbp(&line, &n);
	}
	else {
		append_buffer(line, n);
	}
	if (lf) {
		finalize_record();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
testq %rdi, %rdi
je 0x2cf3
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzbl %bl, %edx
callq 0x35f1
testb %al, %al
jne 0x2dbe
cmpb $0x1, 0x9906(%rip)      # 0xc570
jne 0x2c78
movzbl (%r15), %edi
callq 0x3796
movb %al, (%r15)
testb %bl, %bl
je 0x2c84
decq %r14
movq %r14, 0x8(%rsp)
movzbl 0x98e5(%rip), %eax      # 0xc570
leaq (%r15,%rax), %rdi
movq %r14, %rdx
subq %rax, %rdx
pushq $0x5c
popq %rsi
callq 0x2200
movb $0x0, 0x98cc(%rip)      # 0xc570
testq %rax, %rax
je 0x2d5a
movq %rax, %r12
leaq (%r15,%r14), %r13
movq %rax, %rbp
cmpq %r13, %rbp
jae 0x2d5a
leaq 0x1(%rbp), %rcx
movb (%rbp), %al
cmpb $0x5c, %al
jne 0x2ce7
cmpq %r13, %rcx
je 0x2d43
movzbl 0x1(%rbp), %edi
addq $0x2, %rbp
callq 0x3796
decq %r14
movq %r14, 0x8(%rsp)
jmp 0x2cea
movq %rcx, %rbp
movb %al, (%r12)
incq %r12
jmp 0x2cb7
cmpb $0x1, 0x9877(%rip)      # 0xc571
jne 0x2dbe
leaq 0x19981(%rip), %rax     # 0x1c688
cmpb $0x1, 0x22(%rax)
jne 0x2d12
callq 0x34e9
cmpb $0x0, 0x9859(%rip)      # 0xc572
jne 0x2d3a
cmpb $0x1, 0x984e(%rip)      # 0xc570
je 0x2dd2
cmpb $0x1, 0x9844(%rip)      # 0xc573
je 0x2dcd
callq 0x353c
movb $0x0, 0x9830(%rip)      # 0xc571
jmp 0x2dbe
testb %bl, %bl
jne 0x2dd2
movb $0x1, 0x981e(%rip)      # 0xc570
decq %r14
movq %r14, 0x8(%rsp)
cmpb $0x1, 0x9812(%rip)      # 0xc573
jne 0x2d9c
leaq 0x9809(%rip), %rcx      # 0xc573
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x53ec
testb %al, %al
je 0x2dd7
movb 0x97ee(%rip), %al       # 0xc573
andb %bl, %al
cmpb $0x1, %al
je 0x2dcd
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x37e4
jmp 0x2da7
movq %r15, %rdi
movq %r14, %rsi
callq 0x394a
testb %bl, %bl
je 0x2dbe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x353c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3517
callq 0x34f3
callq 0x37bf
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: line_oc
static void line_oc(uint8_t *line, size_t n, bool lf) {
	static bool afterlf = false;
	
	if (!line) {
		if (!first_call) {
			if (O.tag_check_line_term && !afterlf) {
				err_noterm();
			}
			if (!keep_blank) {
				if (on_field) err_nosep();
				finalize_record();
			}
			first_call = true;
			afterlf = false;
		}
		return;
	}
	
	if (afterlf) {
		if (*line == 0x9 || *line == 0x7e) {
			*line = 0x0a;
			if (lf) n--;
			append_buffer(line, n);
			afterlf = lf;
			return;
		}
		else {
			finalize_record();
		}
	}
	if (test_blank(line, n, lf)) return;
	
	if (lf) n--;
	if (on_field) {
		if(!test_tag_field(line, n, true, &on_field, NULL)) err_name();
		if (on_field && lf) err_name();
		test_mbp(&line, &n);
	}
	else {
		append_buffer(line, n);
	}
	afterlf = lf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
testq %rdi, %rdi
je 0x2e21
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x1, 0x97c9(%rip)      # 0xc5cb
jne 0x2e74
movzbl (%r15), %eax
cmpl $0x7e, %eax
je 0x2e12
cmpl $0x9, %eax
jne 0x2e6f
movb $0xa, (%r15)
movzbl %bl, %eax
subq %rax, %r14
jmp 0x2ed1
cmpb $0x1, 0x9749(%rip)      # 0xc571
jne 0x2ee2
leaq 0x19853(%rip), %rax     # 0x1c688
cmpb $0x1, 0x22(%rax)
jne 0x2e49
cmpb $0x0, 0x9789(%rip)      # 0xc5cb
jne 0x2e49
callq 0x34e9
cmpb $0x0, 0x9722(%rip)      # 0xc572
jne 0x2e64
cmpb $0x1, 0x971a(%rip)      # 0xc573
je 0x2ef1
callq 0x353c
movb $0x0, 0x9706(%rip)      # 0xc571
xorl %ebx, %ebx
jmp 0x2edc
callq 0x353c
movzbl %bl, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x35f1
testb %al, %al
jne 0x2ee2
testb %bl, %bl
je 0x2e91
decq %r14
movq %r14, (%rsp)
cmpb $0x1, 0x96db(%rip)      # 0xc573
jne 0x2ed1
leaq 0x96d2(%rip), %rcx      # 0xc573
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x53ec
testb %al, %al
je 0x2eec
movb 0x96b7(%rip), %al       # 0xc573
andb %bl, %al
cmpb $0x1, %al
je 0x2eec
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x37e4
jmp 0x2edc
movq %r15, %rdi
movq %r14, %rsi
callq 0x394a
movb %bl, 0x96e9(%rip)       # 0xc5cb
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x37bf
callq 0x3517
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: split_binary
void *split_binary(void *fp_) {
	FILE *fp = fp_;
	prepare_record();
	
	uint8_t tagbuf[STACK_BUF_LEN];
	size_t readlen;
	while ((readlen = fread(tagbuf, 1, STACK_BUF_LEN, fp)) != 0) {
		uint8_t *p1, *p2;
		p1 = tagbuf;
		while ((p2 = memchr(p1, 0, readlen - (p1 - tagbuf))) != NULL) {
			line_nul(p1, p2 - p1, true);
			p1 = p2 + 1;
		}
		size_t left = readlen - (p1 - tagbuf);
		if (left) line_nul(p1, left, false);
	}
	fclose(fp);
	line_nul(NULL, 0, false);
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
movq %rdi, 0x8(%rsp)
callq 0x2aec
leaq 0x10(%rsp), %rbx
pushq $0x1
popq %rbp
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rcx
callq 0x20e0
testq %rax, %rax
je 0x2fa8
movq %rax, %r12
movq %rbx, %r15
movq %rbx, %r14
subq %r15, %r14
addq %r12, %r14
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
je 0x2f94
movq %rax, %r13
movq %rax, %rsi
subq %r15, %rsi
movq %r15, %rdi
movl %ebp, %edx
callq 0x2fd1
incq %r13
movq %r13, %r15
jmp 0x2f5e
testq %r14, %r14
je 0x2f3e
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2fd1
jmp 0x2f3e
movq 0x8(%rsp), %rdi
callq 0x2120
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2fd1
xorl %eax, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: line_nul
static void line_nul(uint8_t *line, size_t n, bool term) {
	if (!line) {
		if (!first_call) {
			if (!keep_blank) {
				if (on_field) err_nosep();
				finalize_record();
			}
			first_call = true;
		}
		return;
	}
	
	if(test_blank(line, n, term)) return;
	
	if (on_field) {
		if(!test_tag_field(line, n, true, &on_field, NULL)) err_name();
		if (on_field && term) err_nosep();
		test_mbp(&line, &n);
	}
	else {
		append_buffer(line, n);
	}
	
	if (term) finalize_record();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, (%rsp)
testq %rdi, %rdi
je 0x3040
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzbl %bl, %edx
callq 0x35f1
testb %al, %al
jne 0x3086
cmpb $0x1, 0x956c(%rip)      # 0xc573
jne 0x3069
leaq 0x9563(%rip), %rcx      # 0xc573
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
callq 0x53ec
testb %al, %al
je 0x3095
movb 0x9548(%rip), %al       # 0xc573
andb %bl, %al
cmpb $0x1, %al
je 0x3090
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x37e4
jmp 0x3074
cmpb $0x1, 0x952a(%rip)      # 0xc571
jne 0x3086
cmpb $0x0, 0x9522(%rip)      # 0xc572
jne 0x3060
cmpb $0x1, 0x951a(%rip)      # 0xc573
je 0x3090
callq 0x353c
movb $0x0, 0x950a(%rip)      # 0xc571
jmp 0x3086
movq %r15, %rdi
movq %r14, %rsi
callq 0x394a
testb %bl, %bl
je 0x3086
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x353c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x3517
callq 0x37bf
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: parse_opt_tag
void parse_opt_tag(int opt, char const *arg) {
	char *ls = (char*)arg;
	size_t l = strlen(ls);
	
	if (optcd == (iconv_t)-1) {
		optcd = iconv_new("UTF-8", nl_langinfo(CODESET));
	}
	void (*addbuf)(uint8_t *, size_t, bool);
	switch (opt) {
	case 't':
		prepare_record();
		addbuf = line_nul;
		break;
	case 'd':
		addbuf = rt_del_args;
		break;
	}
	char u8buf[STACK_BUF_LEN];
	size_t u8left;
	char *u8;
	while (l) {
		u8left = STACK_BUF_LEN;
		u8 = u8buf;
		size_t ret = iconv(optcd, &ls, &l, &u8, &u8left);
		
		if (ret == (size_t)-1) {
			// 引数処理なのでEINVAL時のバッファ持ち越しは考慮しない
			if (errno != E2BIG) {
				oserror();
			}
		}
		addbuf(u8buf, u8 - u8buf, false);
	}
	u8 = u8buf;
	u8left = STACK_BUF_LEN;
	if (iconv(optcd, NULL, NULL, &u8, &u8left) == (size_t)-1) {
		oserror();
	}
	addbuf(u8buf, u8 - u8buf, true);
	addbuf(NULL, 0, false);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movl %edi, %ebx
movq %rsi, 0x18(%rsp)
movq %rsi, %rdi
callq 0x2130
movq %rax, %rbp
movq %rax, 0x10(%rsp)
cmpq $-0x1, 0x8ea6(%rip)     # 0xc288
jne 0x3402
pushq $0xe
popq %rdi
callq 0x22f0
leaq 0x4c11(%rip), %rdi      # 0x8004
movq %rax, %rsi
callq 0x289e
movq %rax, 0x8e86(%rip)      # 0xc288
cmpl $0x74, %ebx
jne 0x3415
callq 0x2aec
leaq -0x442(%rip), %r14      # 0x2fd1
jmp 0x341c
leaq 0x2b85(%rip), %r14      # 0x5fa1
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %r15
movq %rsp, %r12
leaq 0x8(%rsp), %r13
testq %rbp, %rbp
je 0x3485
movq $0x1000, 0x8(%rsp)      # imm = 0x1000
movq %rbx, (%rsp)
movq 0x8e41(%rip), %rdi      # 0xc288
leaq 0x18(%rsp), %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x20b0
cmpq $-0x1, %rax
jne 0x346f
callq 0x2050
cmpl $0x7, (%rax)
je 0x346f
callq 0x67b6
movq (%rsp), %rsi
subq %rbx, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq *%r14
movq 0x10(%rsp), %rbp
jmp 0x342e
movq %rsp, %rcx
movq %rbx, (%rcx)
leaq 0x8(%rsp), %r8
movq $0x1000, (%r8)          # imm = 0x1000
movq 0x8dea(%rip), %rdi      # 0xc288
xorl %esi, %esi
xorl %edx, %edx
callq 0x20b0
cmpq $-0x1, %rax
jne 0x34b2
callq 0x67b6
movq (%rsp), %rsi
subq %rbx, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq *%r14
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq *%r14
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: finalize_record
static void finalize_record(void) {
	if (store_picture) {
		if (b64pos != 0) err_base64();
		long picend = ftell(flacpict);
		uint32_t piclength = picend - picture_top - 4;
		piclength = ntohl(0x06000000 | piclength);
		fseek(flacpict, picture_top, SEEK_SET);
		fwrite(&piclength, 4, 1, flacpict);
		fseek(flacpict, 0, SEEK_END);
		picture_top = picend;
	}
	else {
		fwrite(&recordlen, 4, 1, strcount);
		tagnum++;
	}
	first_call = true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0x902d(%rip)      # 0xc574
jne 0x35bd
cmpb $0x0, 0x9025(%rip)      # 0xc575
jne 0x35ec
movq 0x8ff3(%rip), %rdi      # 0xc550
callq 0x2280
movq %rax, %rbx
movq 0x900c(%rip), %rsi      # 0xc578
subl %esi, %eax
addl $-0x4, %eax
orl $0x6000000, %eax        # imm = 0x6000000
bswapl %eax
leaq 0x4(%rsp), %r14
movl %eax, (%r14)
movq 0x8fc9(%rip), %rdi      # 0xc550
xorl %edx, %edx
callq 0x2320
movq 0x8fbb(%rip), %rcx      # 0xc550
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2460
movq 0x8fa6(%rip), %rdi      # 0xc550
pushq $0x2
popq %rdx
xorl %esi, %esi
callq 0x2320
movq %rbx, 0x8fbd(%rip)      # 0xc578
jmp 0x35dd
movq 0x8f84(%rip), %rcx      # 0xc548
leaq 0x8fb5(%rip), %rdi      # 0xc580
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x2460
incq 0x8f7b(%rip)            # 0xc558
movb $0x0, 0x8f8d(%rip)      # 0xc571
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3b7d
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: esctab
static int esctab(int c) {
	switch (c) {
	case 0x30: // '0'
		c = '\0';
		break;
	case 0x5c: // '\'
		c = 0x5c;
		break;
	case 0x6e: // 'n'
		c = 0x0a;
		break;
	case 0x72: // 'r'
		c = 0x0d;
		break;
	default:
		err_esc();
		break;
	}
	return c;
}

// Assembly:
cmpl $0x30, %edi
je 0x37b2
cmpl $0x72, %edi
je 0x37b5
cmpl $0x6e, %edi
je 0x37ae
cmpl $0x5c, %edi
jne 0x37b9
pushq $0x5c
jmp 0x37b7
pushq $0xa
jmp 0x37b7
xorl %eax, %eax
retq
pushq $0xd
popq %rax
retq
pushq %rax
callq 0x34f3
// File: /workspace/github_c_makefile_star2_O2/hcmiya[P]opuscomment/src/parse-tags.c
// Function: test_mbp
static void test_mbp(uint8_t **line, size_t *n) {
	if (fieldlen > 22) {
		append_buffer(*line, *n);
	}
	else {
		bool filled;
		size_t before = fieldlen;
		filled = count_field_len(*line, *n);
		size_t add = fieldlen - before;
		if (filled) {
			size_t w;
			// M_B_Pを比較する分のバッファが埋まったか項目名が決まった場合
			if (fieldlen > 22) {
				if (add + before > 22) {
					add = 22 - before;
				}
				w = 22;
			}
			else if (fieldlen == 22 && !on_field) {
				if (codec->type == CODEC_FLAC &&
					memcmp(field_pending, MBPeq, 22) == 0) {
					store_picture = true;
					fwrite((uint32_t[]){0}, 4, 1, flacpict);
					editlen -= 4;
					uint8_t *databegin = strchr(*line, 0x3d) + 1;
					append_buffer(databegin, *n - (databegin - *line));
					return;
				}
				else {
					w = 22;
				}
			}
			else {
				w = fieldlen;
			}
			append_buffer(field_pending, w);
			*line += add;
			*n -= add;
			append_buffer(*line, *n);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8d92(%rip), %r13      # 0xc588
movq (%rdi), %r12
movq (%rsi), %rdx
cmpq $0x17, %r13
jb 0x380d
movq %r12, %rdi
movq %rdx, %rsi
jmp 0x38af
movq %rsi, %rbx
movq %rdi, %r14
movb 0x8d59(%rip), %bpl      # 0xc573
cmpb $0x1, %bpl
jne 0x3825
subq %r13, %rdx
jmp 0x3836
pushq $0x3d
popq %rsi
movq %r12, %rdi
callq 0x2200
movq %rax, %rdx
subq %r12, %rdx
leaq (%rdx,%r13), %r15
leaq 0x8d6f(%rip), %rdi      # 0xc5b0
addq %r13, %rdi
cmpq $0x17, %r15
jae 0x386d
movq %r12, %rsi
callq 0x22a0
movq %r15, 0x8d2f(%rip)      # 0xc588
testb %bpl, %bpl
je 0x38c2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x16
popq %rbp
movq %rbp, %rdx
subq %r13, %rdx
movq %r12, %rsi
callq 0x22a0
movq %r15, 0x8d03(%rip)      # 0xc588
movq %rbp, %r15
movq %r15, %r12
subq %r13, %r12
leaq 0x8d1b(%rip), %rdi      # 0xc5b0
movq %r15, %rsi
callq 0x394a
movq (%r14), %rdi
addq %r12, %rdi
movq %rdi, (%r14)
movq (%rbx), %rsi
subq %r12, %rsi
movq %rsi, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x394a
cmpq $0x16, %r15
jne 0x3888
leaq 0x18da1(%rip), %rax     # 0x1c670
movq (%rax), %rax
cmpl $0x2, (%rax)
jne 0x3941
leaq 0x84ba(%rip), %rax      # 0xbd98
movq (%rax), %rsi
leaq 0x8cc8(%rip), %rdi      # 0xc5b0
pushq $0x16
popq %r15
movq %r15, %rdx
callq 0x2300
testl %eax, %eax
jne 0x3888
movb $0x1, 0x8c75(%rip)      # 0xc574
leaq 0x4(%rsp), %rdi
andl $0x0, (%rdi)
movq 0x8c42(%rip), %rcx      # 0xc550
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
callq 0x2460
addq $-0x4, 0x8c7f(%rip)     # 0xc5a0
movq (%r14), %r14
pushq $0x3d
popq %rsi
movq %r14, %rdi
callq 0x2140
addq (%rbx), %r14
leaq 0x1(%rax), %rdi
subq %rdi, %r14
movq %r14, %rsi
jmp 0x38af
pushq $0x16
popq %r15
jmp 0x3888