// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r12
movq %rsi, %rdx
cmpl $0xa, %ecx
jle 0x5d7e8
leaq 0xb992(%rip), %rsi      # 0x69162
xorl %eax, %eax
addq $0x6018, %rsp           # imm = 0x6018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58c06
movq %rdx, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
incl %ecx
movl %ecx, -0x3c(%rbp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r12, %rdi
callq 0xc720
movl %r13d, %edx
cmpl $-0x1, %eax
je 0x5db80
movl %eax, %r15d
testl %ebx, %ebx
sete %al
cmpl $0x3e, %r15d
setne %cl
orb %al, %cl
movslq %r13d, %r14
je 0x5d8e0
testl %ebx, %ebx
je 0x5d861
cmpl $0x1ffe, %r13d          # imm = 0x1FFE
je 0x5d88e
pushq $0x1
popq %rbx
cmpl $0x5, %r13d
jne 0x5d8aa
leaq -0x2040(%rbp), %rdi
leaq 0xb999(%rip), %rsi      # 0x691e5
pushq $0x5
popq %rdx
callq 0xc800
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
pushq $0x5
popq %r13
jmp 0x5d8aa
cmpl $0x3c, %r15d
jne 0x5d8bd
testl %r13d, %r13d
jle 0x5d87c
movq -0x30(%rbp), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x59168
movb $0x3c, -0x2040(%rbp)
pushq $0x1
popq %rbx
movl %ebx, %r13d
jmp 0x5d7fa
xorl %r13d, %r13d
movq -0x30(%rbp), %rdi
leaq 0xb972(%rip), %rsi      # 0x6920e
movq -0x38(%rbp), %rdx
xorl %eax, %eax
callq 0x58c06
pushq $0x1
popq %rbx
movslq %r13d, %rax
incl %r13d
movb %r15b, -0x2040(%rbp,%rax)
jmp 0x5d7fa
leal 0x1(%r14), %r13d
movb %r15b, -0x2040(%rbp,%r14)
movl $0x0, %ebx
cmpl $0x2000, %r13d          # imm = 0x2000
jne 0x5d7fa
jmp 0x5d9df
movw $0x3e, -0x2040(%rbp,%r14)
cmpl $0x2000, %r13d          # imm = 0x2000
movq -0x30(%rbp), %rbx
jge 0x5dba7
cmpl $0x5, %r13d
jl 0x5d96a
leaq -0x2040(%rbp), %rdi
leaq 0xb8d5(%rip), %rsi      # 0x691e5
pushq $0x5
popq %rdx
callq 0xc800
testl %eax, %eax
jne 0x5d96a
leaq -0x203b(%rbp), %r14
movq %r14, %rdi
leaq 0x8974(%rip), %rsi      # 0x662a1
pushq $0x7
popq %rdx
callq 0xc800
testl %eax, %eax
je 0x5d984
cmpl $0x63657865, (%r14)     # imm = 0x63657865
je 0x5d9f1
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xb89d(%rip), %rsi      # 0x691f0
movq -0x38(%rbp), %rdx
leaq -0x2040(%rbp), %rcx
xorl %eax, %eax
callq 0x58c06
jmp 0x5d7f8
incq %r14
movq %rbx, %rdi
leaq -0x2040(%rbp), %rsi
movq %r14, %rdx
callq 0x59168
jmp 0x5d7f5
movq 0x2a0(%rbx), %r14
leaq -0x2034(%rbp), %r13
movq %r13, %rdi
leaq 0xb88b(%rip), %rsi      # 0x69227
leaq -0x6040(%rbp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0xc110
cmpl $0x1, %eax
jne 0x5da05
movq 0x70(%r14), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r13
movq %r13, %rdi
leaq 0xb3e9(%rip), %rdx      # 0x68db5
pushq $0x2f
popq %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x5bc9e
jmp 0x5dac9
movl $0x2000, %edx           # imm = 0x2000
movq -0x30(%rbp), %rdi
leaq -0x2040(%rbp), %rsi
jmp 0x5d97a
movq %rbx, %rdi
leaq -0x2037(%rbp), %rsi
callq 0x5dbc6
jmp 0x5d7f5
movq %r13, %rdi
leaq 0xb829(%rip), %rsi      # 0x69238
movq %r15, %rdx
xorl %eax, %eax
callq 0xc110
cmpl $0x1, %eax
jne 0x5da32
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r13
movq %r13, %rdi
jmp 0x5dab8
movq %r13, %rdi
leaq 0xb80d(%rip), %rsi      # 0x69249
movq %r15, %rdx
xorl %eax, %eax
callq 0xc110
cmpl $0x1, %eax
je 0x5da68
movq %r13, %rdi
leaq 0xb802(%rip), %rsi      # 0x69257
movq %r15, %rdx
xorl %eax, %eax
callq 0xc110
cmpl $0x1, %eax
jne 0x5db67
movl $0x2000, %esi           # imm = 0x2000
leaq -0x4040(%rbp), %r13
movq %r13, %rdi
leaq 0x88b1(%rip), %rdx      # 0x6632f
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x5bc9e
movq %r13, %rdi
pushq $0x2f
popq %rsi
callq 0xca80
testq %rax, %rax
je 0x5da9d
movb $0x0, 0x1(%rax)
movq %r13, %rdi
callq 0xc470
leaq (%rax,%rbp), %rdi
addq $-0x4040, %rdi          # imm = 0xBFC0
movl $0x2000, %esi           # imm = 0x2000
subq %rax, %rsi
leaq 0x8870(%rip), %rdx      # 0x6632f
movq %r15, %rcx
xorl %eax, %eax
callq 0x5bc9e
movq %r13, %rdi
leaq 0x3a02(%rip), %rsi      # 0x614d5
callq 0xcbb0
testq %rax, %rax
je 0x5db23
movq %rax, %r15
movq %rax, %rdi
callq 0xcce0
movl %eax, %edi
callq 0x579bd
movq 0xc0(%r14), %r14
movq %r14, %rdi
callq 0xc470
movq %r14, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x58e6c
movq %rbx, %rdi
testl %eax, %eax
jle 0x5db52
movq %r13, %rsi
movq %r15, %rdx
movl -0x3c(%rbp), %ecx
callq 0x5d7aa
jmp 0x5db5a
callq 0xcb50
movl (%rax), %edi
callq 0xc8d0
movq %rbx, %rdi
leaq 0xb73e(%rip), %rsi      # 0x69277
leaq -0x2034(%rbp), %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x58c06
jmp 0x5d7f5
movq %r15, %rsi
callq 0x5dc70
movq %r15, %rdi
callq 0xc4c0
jmp 0x5d7f5
movq %rbx, %rdi
leaq 0xb6ef(%rip), %rsi      # 0x69260
movq %r13, %rdx
xorl %eax, %eax
callq 0x58c06
jmp 0x5d7f5
testl %r13d, %r13d
jle 0x5db95
leaq -0x2040(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x59168
addq $0x6018, %rsp           # imm = 0x6018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb5d8(%rip), %rdi      # 0x69186
leaq 0xa68e(%rip), %rsi      # 0x68243
leaq 0xb5e3(%rip), %rcx      # 0x6919f
movl $0x1125, %edx           # imm = 0x1125
callq 0xc220