// File: /workspace/github_c_makefile_star2_O0/somethingnew2-0[P]CS537-P4/request.c
// Function: requestError
void requestError(int fd, char *cause, char *errnum, char *shortmsg, char *longmsg) 
{
   char buf[MAXLINE], body[MAXBUF];

   printf("Request ERROR\n");

   // Create the body of the error message
   sprintf(body, "<html><title>CS537 Error</title>");
   sprintf(body, "%s<body bgcolor=""fffff"">\r\n", body);
   sprintf(body, "%s%s: %s\r\n", body, errnum, shortmsg);
   sprintf(body, "%s<p>%s: %s\r\n", body, longmsg, cause);
   sprintf(body, "%s<hr>CS537 Web Server\r\n", body);

   // Write out the header information for this response
   sprintf(buf, "HTTP/1.0 %s %s\r\n", errnum, shortmsg);
   Rio_writen(fd, buf, strlen(buf));
   printf("%s", buf);

   sprintf(buf, "Content-Type: text/html\r\n");
   Rio_writen(fd, buf, strlen(buf));
   printf("%s", buf);

   sprintf(buf, "Content-Length: %lu\r\n\r\n", strlen(body));
   Rio_writen(fd, buf, strlen(buf));
   printf("%s", buf);

   // Write out the content
   Rio_writen(fd, body, strlen(body));
   printf("%s", body);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4080, %rsp           # imm = 0x4080
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
leaq 0x23ca(%rip), %rdi      # 0x506f
movb $0x0, %al
callq 0x2110
leaq -0x4030(%rbp), %rdi
leaq 0x23c4(%rip), %rsi      # 0x507e
movb $0x0, %al
callq 0x22f0
leaq -0x4030(%rbp), %rdi
leaq -0x4030(%rbp), %rdx
leaq 0x23c9(%rip), %rsi      # 0x509f
movb $0x0, %al
callq 0x22f0
leaq -0x4030(%rbp), %rdi
leaq -0x4030(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x23be(%rip), %rsi      # 0x50b8
movb $0x0, %al
callq 0x22f0
leaq -0x4030(%rbp), %rdi
leaq -0x4030(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %r8
leaq 0x23a5(%rip), %rsi      # 0x50c3
movb $0x0, %al
callq 0x22f0
leaq -0x4030(%rbp), %rdi
leaq -0x4030(%rbp), %rdx
leaq 0x2397(%rip), %rsi      # 0x50d1
movb $0x0, %al
callq 0x22f0
leaq -0x2030(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x2393(%rip), %rsi      # 0x50ea
movb $0x0, %al
callq 0x22f0
movl -0x4(%rbp), %eax
movl %eax, -0x4074(%rbp)
leaq -0x2030(%rbp), %rax
movq %rax, -0x4070(%rbp)
leaq -0x2030(%rbp), %rdi
callq 0x20d0
movl -0x4074(%rbp), %edi
movq -0x4070(%rbp), %rsi
movq %rax, %rdx
callq 0x4470
leaq -0x2030(%rbp), %rsi
leaq 0x2513(%rip), %rdi      # 0x52b7
movb $0x0, %al
callq 0x2110
leaq -0x2030(%rbp), %rdi
leaq 0x2342(%rip), %rsi      # 0x50fb
movb $0x0, %al
callq 0x22f0
movl -0x4(%rbp), %eax
movl %eax, -0x4064(%rbp)
leaq -0x2030(%rbp), %rax
movq %rax, -0x4060(%rbp)
leaq -0x2030(%rbp), %rdi
callq 0x20d0
movl -0x4064(%rbp), %edi
movq -0x4060(%rbp), %rsi
movq %rax, %rdx
callq 0x4470
leaq -0x2030(%rbp), %rsi
leaq 0x24b1(%rip), %rdi      # 0x52b7
movb $0x0, %al
callq 0x2110
leaq -0x2030(%rbp), %rax
movq %rax, -0x4058(%rbp)
leaq -0x4030(%rbp), %rdi
callq 0x20d0
movq -0x4058(%rbp), %rdi
movq %rax, %rdx
leaq 0x22dd(%rip), %rsi      # 0x5115
movb $0x0, %al
callq 0x22f0
movl -0x4(%rbp), %eax
movl %eax, -0x404c(%rbp)
leaq -0x2030(%rbp), %rax
movq %rax, -0x4048(%rbp)
leaq -0x2030(%rbp), %rdi
callq 0x20d0
movl -0x404c(%rbp), %edi
movq -0x4048(%rbp), %rsi
movq %rax, %rdx
callq 0x4470
leaq -0x2030(%rbp), %rsi
leaq 0x2432(%rip), %rdi      # 0x52b7
movb $0x0, %al
callq 0x2110
movl -0x4(%rbp), %eax
movl %eax, -0x403c(%rbp)
leaq -0x4030(%rbp), %rax
movq %rax, -0x4038(%rbp)
leaq -0x4030(%rbp), %rdi
callq 0x20d0
movl -0x403c(%rbp), %edi
movq -0x4038(%rbp), %rsi
movq %rax, %rdx
callq 0x4470
leaq -0x4030(%rbp), %rsi
leaq 0x23e5(%rip), %rdi      # 0x52b7
movb $0x0, %al
callq 0x2110
addq $0x4080, %rsp           # imm = 0x4080
popq %rbp
retq
nopw %cs:(%rax,%rax)