// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: send_ssi_file
static void send_ssi_file(struct mg_connection *conn, const char *path,
                          FILE *fp, int include_level) {
  char buf[IOBUF_SIZE];
  int ch, offset, len, in_ssi_tag;

  if (include_level > 10) {
    mg_printf(conn, "SSI #include level is too deep (%s)", path);
    return;
  }

  in_ssi_tag = len = offset = 0;
  while ((ch = fgetc(fp)) != EOF) {
    if (in_ssi_tag && ch == '>') {
      in_ssi_tag = 0;
      buf[len++] = (char) ch;
      buf[len] = '\0';
      assert(len <= (int) sizeof(buf));
      if (len < 6 || memcmp(buf, "<!--#", 5) != 0) {
        // Not an SSI tag, pass it
        (void) mg_write(conn, buf, (size_t) len);
      } else {
        if (!memcmp(buf + 5, "include", 7)) {
          do_ssi_include(conn, path, buf + 12, include_level);
#if !defined(MONGOOSE_NO_POPEN)
        } else if (!memcmp(buf + 5, "exec", 4)) {
          do_ssi_exec(conn, buf + 9);
#endif // !NO_POPEN
        } else {
          mg_printf(conn, "%s: unknown SSI " "command: \"%s\"", path, buf);
        }
      }
      len = 0;
    } else if (in_ssi_tag) {
      if (len == 5 && memcmp(buf, "<!--#", 5) != 0) {
        // Not an SSI tag
        in_ssi_tag = 0;
      } else if (len == (int) sizeof(buf) - 2) {
        mg_printf(conn, "%s: SSI tag is too large", path);
        len = 0;
      }
      buf[len++] = ch & 0xff;
    } else if (ch == '<') {
      in_ssi_tag = 1;
      if (len > 0) {
        mg_write(conn, buf, (size_t) len);
      }
      len = 0;
      buf[len++] = ch & 0xff;
    } else {
      buf[len++] = ch & 0xff;
      if (len == (int) sizeof(buf)) {
        mg_write(conn, buf, (size_t) len);
        len = 0;
      }
    }
  }

  // Send the rest of buffered data
  if (len > 0) {
    mg_write(conn, buf, (size_t) len);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6018, %rsp           # imm = 0x6018
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0xa, %ecx
jle 0x6cc8e
leaq 0xc512(%rip), %rsi      # 0x79182
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
addq $0x6018, %rsp           # imm = 0x6018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x67a83
movl %ecx, %r13d
movq %rdx, %r12
movq %rdx, %rdi
callq 0xc700
cmpl $-0x1, %eax
je 0x6d07c
movl %eax, %r15d
movq %r14, -0x30(%rbp)
incl %r13d
movl %r13d, -0x34(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
testl %r13d, %r13d
sete %al
cmpl $0x3e, %r15d
setne %cl
orb %al, %cl
jne 0x6cd27
movslq %r14d, %rdx
movw $0x3e, -0x2040(%rbp,%rdx)
cmpl $0x2000, %r14d          # imm = 0x2000
jge 0x6d08e
cmpl $0x5, %r14d
jl 0x6cd09
movl -0x2040(%rbp), %eax
movl $0x2d2d213c, %ecx       # imm = 0x2D2D213C
xorl %ecx, %eax
movzbl -0x203c(%rbp), %ecx
xorl $0x23, %ecx
orl %eax, %ecx
je 0x6ce03
incq %rdx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x6661a
xorl %r14d, %r14d
xorl %r13d, %r13d
jmp 0x6cdc2
testl %r13d, %r13d
je 0x6cd69
movl $0x1, %r13d
cmpl $0x1ffe, %r14d          # imm = 0x1FFE
je 0x6cd9c
cmpl $0x5, %r14d
jne 0x6cdb4
movl -0x2040(%rbp), %eax
movl $0x2d2d213c, %ecx       # imm = 0x2D2D213C
xorl %ecx, %eax
movzbl -0x203c(%rbp), %ecx
xorl $0x23, %ecx
xorl %r13d, %r13d
orl %eax, %ecx
sete %r13b
movl $0x5, %r14d
jmp 0x6cdb4
cmpl $0x3c, %r15d
jne 0x6cddb
testl %r14d, %r14d
jle 0x6cd87
movl %r14d, %edx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x6661a
movb $0x3c, -0x2040(%rbp)
movl $0x1, %r14d
movl $0x1, %r13d
jmp 0x6cdc2
xorl %r14d, %r14d
movq %rbx, %rdi
leaq 0xc485(%rip), %rsi      # 0x7922e
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x67a83
movslq %r14d, %rax
incl %r14d
movb %r15b, -0x2040(%rbp,%rax)
movq %r12, %rdi
callq 0xc700
movl %eax, %r15d
cmpl $-0x1, %eax
jne 0x6ccb9
jmp 0x6d064
movslq %r14d, %rax
incl %r14d
movb %r15b, -0x2040(%rbp,%rax)
xorl %r13d, %r13d
cmpl $0x2000, %r14d          # imm = 0x2000
jne 0x6cdc2
movq -0x8(%rbx), %rdi
movl $0x2000, %edx           # imm = 0x2000
jmp 0x6cd10
movl -0x203b(%rbp), %eax
movl $0x6c636e69, %ecx       # imm = 0x6C636E69
xorl %ecx, %eax
movl -0x2038(%rbp), %ecx
movl $0x6564756c, %edx       # imm = 0x6564756C
xorl %edx, %ecx
orl %eax, %ecx
je 0x6ce55
cmpl $0x63657865, -0x203b(%rbp) # imm = 0x63657865
je 0x6ceb2
xorl %r14d, %r14d
movq %rbx, %rdi
leaq 0xc3d2(%rip), %rsi      # 0x79210
movq -0x30(%rbp), %rdx
leaq -0x2040(%rbp), %rcx
xorl %eax, %eax
callq 0x67a83
jmp 0x6cd1f
movq 0x2a0(%rbx), %r14
leaq -0x2034(%rbp), %r15
movq %r15, %rdi
leaq 0xc3da(%rip), %rsi      # 0x79247
leaq -0x6040(%rbp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6cec6
movq 0x70(%r14), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r15
movq %r15, %rdi
leaq 0xbf38(%rip), %rdx      # 0x78dd5
movl $0x2f, %r8d
movq %r13, %r9
xorl %eax, %eax
callq 0x6ad62
jmp 0x6cf9e
movq %rbx, %rdi
leaq -0x2037(%rbp), %rsi
callq 0x6d0ad
jmp 0x6cd1c
movq %r15, %rdi
leaq 0xc388(%rip), %rsi      # 0x79258
movq %r13, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
movq %r13, %rcx
jne 0x6cefd
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r15
movq %r15, %rdi
leaq 0x9457(%rip), %rdx      # 0x7634f
jmp 0x6cf97
movq %r15, %rdi
leaq 0xc362(%rip), %rsi      # 0x79269
movq %rcx, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
je 0x6cf37
movq %r15, %rdi
leaq 0xc357(%rip), %rsi      # 0x79277
leaq -0x6040(%rbp), %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6d04b
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r15
movq %r15, %rdi
leaq 0x9402(%rip), %rdx      # 0x7634f
movq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0x6ad62
movq %r15, %rdi
movl $0x2f, %esi
callq 0xca50
testq %rax, %rax
je 0x6cf6e
movb $0x0, 0x1(%rax)
movq %r15, %rdi
callq 0xc460
leaq (%rax,%rbp), %rdi
addq $-0x4040, %rdi          # imm = 0xBFC0
movl $0x2000, %esi           # imm = 0x2000
subq %rax, %rsi
leaq 0x93bf(%rip), %rdx      # 0x7634f
leaq -0x6040(%rbp), %rcx
xorl %eax, %eax
callq 0x6ad62
movq %r15, %rdi
leaq 0x4557(%rip), %rsi      # 0x714ff
callq 0xcb90
movq %r15, %r13
testq %rax, %rax
je 0x6d007
movq %rax, %r15
movq %rax, %rdi
callq 0xccb0
movl %eax, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0xc220
movq 0xc0(%r14), %r14
movq %r14, %rdi
callq 0xc460
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x67cec
movq %rbx, %rdi
testl %eax, %eax
jle 0x6d036
movq %r13, %rsi
movq %r15, %rdx
movl -0x34(%rbp), %ecx
callq 0x6cc4a
jmp 0x6d03e
callq 0xcb20
movl (%rax), %edi
callq 0xc8c0
movq %rbx, %rdi
leaq 0xc27a(%rip), %rsi      # 0x79297
leaq -0x2034(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x67a83
jmp 0x6cd1c
movq %r15, %rsi
callq 0x6d157
movq %r15, %rdi
callq 0xc4c0
jmp 0x6cd1c
movq %rbx, %rdi
leaq 0xc22b(%rip), %rsi      # 0x79280
movq %r15, %rdx
xorl %eax, %eax
callq 0x67a83
jmp 0x6cd1c
testl %r14d, %r14d
jle 0x6d07c
movl %r14d, %edx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x6661a
addq $0x6018, %rsp           # imm = 0x6018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc111(%rip), %rdi      # 0x791a6
leaq 0xb1c7(%rip), %rsi      # 0x78263
leaq 0xc11c(%rip), %rcx      # 0x791bf
movl $0x1125, %edx           # imm = 0x1125
callq 0xc210