#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*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ send_status(int /*<<< orphan*/ *, int, char const *);
void send_response_file(FILE *client, int code, const char *reason_phrase,
                        int size, char *mime_type) {
  send_status(client, code, reason_phrase);
  if (fprintf(
          client,
          "Connection: close\r\nContent-Type: %s\r\nContent-Length: %d\r\n\r\n",
          mime_type, size) < 0) {
    exit(-1);
  }
  fflush(NULL);
}


x86 assembly (clang, -O0):
<send_response_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <send_status@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
cmp    $0x0,%rax
jge    1195 <send_response_file+0x55>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response_file>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdi,%rbx
call   1030 <send_status@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <fprintf@plt>
test   %rax,%rax
js     1175 <send_response_file+0x35>
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Connection: close\0D\0AContent-Type: %s\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
define void @send_response_file(i32* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @send_status(i32* %11, i32 %12, i8* %13)
%15 = load i32*, i32** %6
%16 = load i8*, i8** %10
%17 = load i32, i32* %9
%18 = call i64 @fprintf(i32* %15, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %5
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %5
%23 = call i32 @fflush(i32* null)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Connection: close\0D\0AContent-Type: %s\0D\0AContent-Length: %d\0D\0A\0D\0A\00"
define void @send_response_file(i32* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @send_status(i32* %0, i32 %1, i8* %2)
%7 = tail call i64 @fprintf(i32* %0, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %3)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %5
%12 = tail call i32 @fflush(i32* null)
ret void
}