// File: /workspace/github_c_makefile_star2_O1/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 0x6e849
leaq 0xc957(%rip), %rsi      # 0x7b182
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 0x69675
movl %ecx, %r13d
movq %rdx, %r12
movq %rdx, %rdi
callq 0xc700
cmpl $-0x1, %eax
je 0x6ec27
movl %eax, %r15d
movq %r14, -0x30(%rbp)
incl %r13d
movl %r13d, -0x34(%rbp)
xorl %r14d, %r14d
xorl %r13d, %r13d
testl %r14d, %r14d
sete %al
cmpl $0x3e, %r15d
setne %cl
orb %al, %cl
jne 0x6e8e2
movslq %r13d, %rdx
movw $0x3e, -0x2040(%rbp,%rdx)
cmpl $0x2000, %r13d          # imm = 0x2000
jge 0x6ec54
cmpl $0x5, %r13d
jl 0x6e8c4
movl -0x2040(%rbp), %eax
movl $0x2d2d213c, %ecx       # imm = 0x2D2D213C
xorl %ecx, %eax
movzbl -0x203c(%rbp), %ecx
xorl $0x23, %ecx
orl %eax, %ecx
je 0x6e993
incq %rdx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x681c0
xorl %r13d, %r13d
xorl %r14d, %r14d
jmp 0x6ea14
testl %r14d, %r14d
je 0x6e931
movl $0x1, %r14d
cmpl $0x1ffe, %r13d          # imm = 0x1FFE
je 0x6e9ee
cmpl $0x5, %r13d
jne 0x6ea06
movl -0x2040(%rbp), %eax
movl $0x2d2d213c, %ecx       # imm = 0x2D2D213C
xorl %ecx, %eax
movzbl -0x203c(%rbp), %ecx
xorl $0x23, %ecx
orl %eax, %ecx
je 0x6e9e5
xorl %r14d, %r14d
movl $0x5, %r13d
jmp 0x6ea06
cmpl $0x3c, %r15d
jne 0x6e967
testl %r13d, %r13d
jle 0x6e94f
movl %r13d, %edx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x681c0
movb $0x3c, -0x2040(%rbp)
movl $0x1, %r13d
movl $0x1, %r14d
jmp 0x6ea14
movslq %r13d, %rax
incl %r13d
movb %r15b, -0x2040(%rbp,%rax)
xorl %r14d, %r14d
cmpl $0x2000, %r13d          # imm = 0x2000
jne 0x6ea14
movq -0x8(%rbx), %rdi
movl $0x2000, %edx           # imm = 0x2000
jmp 0x6e8cb
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 0x6ea2d
cmpl $0x63657865, -0x203b(%rbp) # imm = 0x63657865
je 0x6ea8a
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xc842(%rip), %rsi      # 0x7b210
movq -0x30(%rbp), %rdx
leaq -0x2040(%rbp), %rcx
xorl %eax, %eax
callq 0x69675
jmp 0x6e8da
cmpl $0x1ffe, %r13d          # imm = 0x1FFE
jne 0x6ea06
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xc833(%rip), %rsi      # 0x7b22e
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x69675
movslq %r13d, %rax
incl %r13d
movb %r15b, -0x2040(%rbp,%rax)
movq %r12, %rdi
callq 0xc700
movl %eax, %r15d
cmpl $-0x1, %eax
jne 0x6e874
jmp 0x6ec2a
movq 0x2a0(%rbx), %r13
leaq -0x2034(%rbp), %r14
movq %r14, %rdi
leaq 0xc802(%rip), %rsi      # 0x7b247
leaq -0x6040(%rbp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6ea9e
movq 0x70(%r13), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r14
movq %r14, %rdi
leaq 0xc360(%rip), %rdx      # 0x7add5
movl $0x2f, %r8d
movq %r15, %r9
xorl %eax, %eax
callq 0x6c630
jmp 0x6eb64
movq %rbx, %rdi
leaq -0x2037(%rbp), %rsi
callq 0x6ec73
jmp 0x6e8d7
movq %r14, %rdi
leaq 0xc7b0(%rip), %rsi      # 0x7b258
movq %r15, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6eacb
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r14
movq %r14, %rdi
jmp 0x6eb53
movq %r14, %rdi
leaq 0xc794(%rip), %rsi      # 0x7b269
movq %r15, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
je 0x6eb01
movq %r14, %rdi
leaq 0xc789(%rip), %rsi      # 0x7b277
movq %r15, %rdx
xorl %eax, %eax
callq 0xc100
cmpl $0x1, %eax
jne 0x6ec0e
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r14
movq %r14, %rdi
leaq 0x982d(%rip), %rdx      # 0x78344
movq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0x6c630
movq %r14, %rdi
movl $0x2f, %esi
callq 0xca50
testq %rax, %rax
je 0x6eb38
movb $0x0, 0x1(%rax)
movq %r14, %rdi
callq 0xc460
leaq (%rax,%rbp), %rdi
addq $-0x4040, %rdi          # imm = 0xBFC0
movl $0x2000, %esi           # imm = 0x2000
subq %rax, %rsi
leaq 0x97ea(%rip), %rdx      # 0x78344
movq %r15, %rcx
xorl %eax, %eax
callq 0x6c630
movq %r14, %rdi
leaq 0x4991(%rip), %rsi      # 0x734ff
callq 0xcb90
testq %rax, %rax
je 0x6ebca
movq %rax, %r15
movq %rax, %rdi
callq 0xccb0
movl %eax, %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0xc220
movq 0xc0(%r13), %r13
movq %r13, %rdi
callq 0xc460
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x698e5
movq %rbx, %rdi
testl %eax, %eax
jle 0x6ebf9
movq %r14, %rsi
movq %r15, %rdx
movl -0x34(%rbp), %ecx
callq 0x6e805
jmp 0x6ec01
callq 0xcb20
movl (%rax), %edi
callq 0xc8c0
movq %rbx, %rdi
leaq 0xc6b7(%rip), %rsi      # 0x7b297
leaq -0x2034(%rbp), %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x69675
jmp 0x6e8d7
movq %r15, %rsi
callq 0x6ed1d
movq %r15, %rdi
callq 0xc4c0
jmp 0x6e8d7
movq %rbx, %rdi
leaq 0xc668(%rip), %rsi      # 0x7b280
movq %r14, %rdx
xorl %eax, %eax
callq 0x69675
jmp 0x6e8d7
xorl %r13d, %r13d
testl %r13d, %r13d
jle 0x6ec42
movl %r13d, %edx
movq -0x8(%rbx), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x681c0
addq $0x6018, %rsp           # imm = 0x6018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc54b(%rip), %rdi      # 0x7b1a6
leaq 0xb601(%rip), %rsi      # 0x7a263
leaq 0xc556(%rip), %rcx      # 0x7b1bf
movl $0x1125, %edx           # imm = 0x1125
callq 0xc210