// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: proxy_request
static void proxy_request(struct ns_connection *pc, struct mg_connection *c) {
  int i, sent_close_header = 0;

  ns_printf(pc, "%s %s%s%s HTTP/%s\r\n", c->request_method, c->uri,
            c->query_string ? "?" : "",
            c->query_string ? c->query_string : "",
            c->http_version);
  for (i = 0; i < c->num_headers; i++) {
    if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) {
      // Force connection close, cause we don't parse proxy replies
      // therefore we don't know message boundaries
      ns_printf(pc, "%s: %s\r\n", "Connection", "close");
      sent_close_header = 1;
    } else {
      ns_printf(pc, "%s: %s\r\n", c->http_headers[i].name,
                c->http_headers[i].value);
    }
  }
  if (!sent_close_header) {
    ns_printf(pc, "%s: %s\r\n", "Connection", "close");
  }
  ns_printf(pc, "%s", "\r\n");
  ns_send(pc, c->content, c->content_len);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x12366(%rip), %rax     # 0xc5b4b
leaq 0x103cb(%rip), %rcx     # 0xc3bb7
cmpq $0x0, %rdx
cmovneq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb3811
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0xb381e
leaq 0x12333(%rip), %rax     # 0xc5b4b
movq %rax, -0x40(%rbp)
jmp 0xb381e
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %r9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
leaq 0x13c97(%rip), %rsi     # 0xc74d8
movq %rax, (%rsp)
movb $0x0, %al
callq 0xaf0d0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x84(%rcx), %eax
jge 0xb390b
movq -0x10(%rbp), %rax
addq $0x88, %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
leaq 0xf505(%rip), %rsi      # 0xc2d8a
callq 0xb1070
cmpl $0x0, %eax
jne 0xb38b8
movq -0x8(%rbp), %rdi
leaq 0x13358(%rip), %rsi     # 0xc6bf2
leaq 0xf4e9(%rip), %rdx      # 0xc2d8a
leaq 0x11ff9(%rip), %rcx     # 0xc58a1
movb $0x0, %al
callq 0xaf0d0
movl $0x1, -0x18(%rbp)
jmp 0xb38fb
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x88, %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
addq $0x88, %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
leaq 0x132fe(%rip), %rsi     # 0xc6bf2
movb $0x0, %al
callq 0xaf0d0
jmp 0xb38fd
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb3853
cmpl $0x0, -0x18(%rbp)
jne 0xb3931
movq -0x8(%rbp), %rdi
leaq 0x132d6(%rip), %rsi     # 0xc6bf2
leaq 0xf467(%rip), %rdx      # 0xc2d8a
leaq 0x11f77(%rip), %rcx     # 0xc58a1
movb $0x0, %al
callq 0xaf0d0
movq -0x8(%rbp), %rdi
leaq 0x10ef4(%rip), %rsi     # 0xc4830
leaq 0x1332e(%rip), %rdx     # 0xc6c71
movb $0x0, %al
callq 0xaf0d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x268(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x270(%rax), %rdx
callq 0xafce0
addq $0x50, %rsp
popq %rbp
retq
nop