#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 */

/* Variables and functions */
int asprintf(char **, char *);
int /*<<< orphan*/ send_free(int, char **, int);
void cannot_execute(int client) {
  char *buffer = NULL;
  int bytes = asprintf(&buffer, "HTTP/1.0 500 Internal Server Error\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "Content-type: text/html\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "\r\n");
  send_free(client, &buffer, bytes);
  ;
  bytes = asprintf(&buffer, "<P>Error prohibited CGI execution.\r\n");
  send_free(client, &buffer, bytes);
  ;
}


x86 assembly (clang, -O0):
<cannot_execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xedf(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
lea    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <asprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    -0x10(%rbp),%rsi
call   1030 <send_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cannot_execute>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movq   $0x0,(%rsp)
lea    0xecb(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xed2(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xef3(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
lea    0xeb6(%rip),%rsi
mov    %r14,%rdi
call   1040 <asprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <send_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"HTTP/1.0 500 Internal Server Error\0D\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [37 x i8] c"<P>Error prohibited CGI execution.\0D\0A\00"
define void @cannot_execute(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* null, i8** %3
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = call i32 @send_free(i32 %6, i8** %3, i32 %7)
%9 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = call i32 @send_free(i32 %10, i8** %3, i32 %11)
%13 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = call i32 @send_free(i32 %14, i8** %3, i32 %15)
%17 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = call i32 @send_free(i32 %18, i8** %3, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"HTTP/1.0 500 Internal Server Error\0D\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0D\0A\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [37 x i8] c"<P>Error prohibited CGI execution.\0D\0A\00"
define void @cannot_execute(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @send_free(i32 %0, i8** %2, i32 %4)
%6 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @send_free(i32 %0, i8** %2, i32 %6)
%8 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @send_free(i32 %0, i8** %2, i32 %8)
%10 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @send_free(i32 %0, i8** %2, i32 %10)
ret void
}