#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 */
struct wsgi_request {
  int dummy;
};

/* Variables and functions */
scalar_t__ uwsgi_response_add_header(struct wsgi_request *, char *, int, char *,
                                     int);
scalar_t__ uwsgi_response_prepare_headers(struct wsgi_request *, char *, int);
int /*<<< orphan*/ uwsgi_response_write_body_do(struct wsgi_request *, char *,
                                                int);
void uwsgi_404(struct wsgi_request *wsgi_req) {
  if (uwsgi_response_prepare_headers(wsgi_req, "404 Not Found", 13))
    return;
  if (uwsgi_response_add_header(wsgi_req, (char *)"Connection", 10,
                                (char *)"close", 5))
    return;
  if (uwsgi_response_add_header(wsgi_req, "Content-Type", 12, "text/plain", 10))
    return;
  uwsgi_response_write_body_do(wsgi_req, "Not Found", 9);
}


x86 assembly (clang, -O0):
<uwsgi_404>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0xd,%edx
call   1050 <uwsgi_response_prepare_headers@plt>
cmp    $0x0,%rax
je     1160 <uwsgi_404+0x30>
jmp    11d7 <uwsgi_404+0xa7>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0xa,%edx
lea    0xea2(%rip),%rcx
mov    $0x5,%r8d
call   1030 <uwsgi_response_add_header@plt>
cmp    $0x0,%rax
je     1191 <uwsgi_404+0x61>
jmp    11d7 <uwsgi_404+0xa7>
mov    -0x8(%rbp),%rdi
lea    0xe83(%rip),%rsi
mov    $0xc,%edx
lea    0xe84(%rip),%rcx
mov    $0xa,%r8d
call   1030 <uwsgi_response_add_header@plt>
cmp    $0x0,%rax
je     11c2 <uwsgi_404+0x92>
jmp    11d7 <uwsgi_404+0xa7>
mov    -0x8(%rbp),%rdi
lea    0xe37(%rip),%rsi
mov    $0x9,%edx
call   1040 <uwsgi_response_write_body_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_404>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0xd,%edx
call   1050 <uwsgi_response_prepare_headers@plt>
test   %rax,%rax
jne    1196 <uwsgi_404+0x66>
lea    0xebd(%rip),%rsi
lea    0xec1(%rip),%rcx
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x5,%r8d
call   1030 <uwsgi_response_add_header@plt>
test   %rax,%rax
jne    1196 <uwsgi_404+0x66>
lea    0xea8(%rip),%rsi
lea    0xeae(%rip),%rcx
mov    %rbx,%rdi
mov    $0xc,%edx
mov    $0xa,%r8d
call   1030 <uwsgi_response_add_header@plt>
test   %rax,%rax
je     1198 <uwsgi_404+0x68>
pop    %rbx
ret
lea    0xe65(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
pop    %rbx
jmp    1040 <uwsgi_response_write_body_do@plt>

LLVM IR (-O0):
%struct.wsgi_request = type { i32 }
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [11 x i8] c"Connection\00"
@.str.2 = [6 x i8] c"close\00"
@.str.3 = [13 x i8] c"Content-Type\00"
@.str.4 = [11 x i8] c"text/plain\00"
@.str.5 = [10 x i8] c"Not Found\00"
define void @uwsgi_404(%struct.wsgi_request* %0) {
%2 = alloca %struct.wsgi_request*
store %struct.wsgi_request* %0, %struct.wsgi_request** %2
%3 = load %struct.wsgi_request*, %struct.wsgi_request** %2
%4 = call i64 @uwsgi_response_prepare_headers(%struct.wsgi_request* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load %struct.wsgi_request*, %struct.wsgi_request** %2
%9 = call i64 @uwsgi_response_add_header(%struct.wsgi_request* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %20
12: ; preds = %7
%13 = load %struct.wsgi_request*, %struct.wsgi_request** %2
%14 = call i64 @uwsgi_response_add_header(%struct.wsgi_request* %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %20
17: ; preds = %12
%18 = load %struct.wsgi_request*, %struct.wsgi_request** %2
%19 = call i32 @uwsgi_response_write_body_do(%struct.wsgi_request* %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
br label %20
20: ; preds = %17, %16, %11, %6
ret void
}

LLVM IR (-O2):
%struct.wsgi_request = type { i32 }
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [11 x i8] c"Connection\00"
@.str.2 = [6 x i8] c"close\00"
@.str.3 = [13 x i8] c"Content-Type\00"
@.str.4 = [11 x i8] c"text/plain\00"
@.str.5 = [10 x i8] c"Not Found\00"
define void @uwsgi_404(%struct.wsgi_request* %0) {
%2 = tail call i64 @uwsgi_response_prepare_headers(%struct.wsgi_request* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i64 @uwsgi_response_add_header(%struct.wsgi_request* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = tail call i64 @uwsgi_response_add_header(%struct.wsgi_request* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @uwsgi_response_write_body_do(%struct.wsgi_request* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
br label %12
12: ; preds = %7, %4, %1, %10
ret void
}