#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char const *, ...);
int /*<<< orphan*/ send_status(int /*<<< orphan*/ *, int, char const *);
scalar_t__ strlen(char const *);
void send_response(FILE *client, int code, const char *reason_phrase,
                   const char *message_body) {
  send_status(client, code, reason_phrase);
  fprintf(client, "Content-length: %d\r\n\r\n", (int)strlen(message_body));
  fflush(client);
  fprintf(client, message_body);
  fflush(client);
}


x86 assembly (clang, -O0):
<send_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <send_status@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
call   1030 <send_status@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <fflush@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Content-length: %d\0D\0A\0D\0A\00"
define void @send_response(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = call i32 @send_status(i32* %9, i32 %10, i8* %11)
%13 = load i32*, i32** %5
%14 = load i8*, i8** %8
%15 = call i64 @strlen(i8* %14)
%16 = trunc i64 %15 to i32
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %5
%19 = call i32 @fflush(i32* %18)
%20 = load i32*, i32** %5
%21 = load i8*, i8** %8
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* %21)
%23 = load i32*, i32** %5
%24 = call i32 @fflush(i32* %23)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Content-length: %d\0D\0A\0D\0A\00"
define void @send_response(i32* %0, i32 %1, i8* %2, i8* nocapture %3) {
%5 = tail call i32 @send_status(i32* %0, i32 %1, i8* %2)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%7 = trunc i64 %6 to i32
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @fflush(i32* %0)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* %3)
%11 = tail call i32 @fflush(i32* %0)
ret void
}