#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 user {
  int dummy;
};
struct mg_request_info {
  int dummy;
};
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_printf(struct mg_connection *, char *);
void api_logout(struct user *user __attribute__((__unused__)),
                struct mg_connection *conn __attribute__((__unused__)),
                const struct mg_request_info *req __attribute__((__unused__)),
                const char *called_as __attribute__((__unused__))) {
  mg_printf(conn, "HTTP/1.1 302 Found\r\n"
                  "Expires: Thu, 01-Jan-1970 00:00:01 GMT\r\n"
                  "Cache: no-cache\r\n"
                  "max-age: 0\r\n"
                  "s-maxage: 0\r\n"
                  "Cache-Control: no-cache, no-store, must-revalidate\r\n"
                  "SetCookie: session=deleted; "
                  "expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; httponly\r\n"
                  "Location: "
                  "/"
                  "?loggedout=1\r\n\r\n");
}


x86 assembly (clang, -O0):
<api_logout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <mg_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_logout>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <mg_printf@plt>

LLVM IR (-O0):
%struct.user = type { i32 }
%struct.mg_connection = type { i32 }
%struct.mg_request_info = type { i32 }
@.str = [267 x i8] c"HTTP/1.1 302 Found\0D\0AExpires: Thu, 01-Jan-1970 00:00:01 GMT\0D\0ACache: no-cache\0D\0Amax-age: 0\0D\0As-maxage: 0\0D\0ACache-Control: no-cache, no-store, must-revalidate\0D\0ASetCookie: session=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; httponly\0D\0ALocation: /?loggedout=1\0D\0A\0D\0A\00"
define void @api_logout(%struct.user* %0, %struct.mg_connection* %1, %struct.mg_request_info* %2, i8* %3) {
%5 = alloca %struct.user*
%6 = alloca %struct.mg_connection*
%7 = alloca %struct.mg_request_info*
%8 = alloca i8*
store %struct.user* %0, %struct.user** %5
store %struct.mg_connection* %1, %struct.mg_connection** %6
store %struct.mg_request_info* %2, %struct.mg_request_info** %7
store i8* %3, i8** %8
%9 = load %struct.mg_connection*, %struct.mg_connection** %6
%10 = call i32 @mg_printf(%struct.mg_connection* %9, i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.user = type { i32 }
%struct.mg_connection = type { i32 }
%struct.mg_request_info = type { i32 }
@.str = [267 x i8] c"HTTP/1.1 302 Found\0D\0AExpires: Thu, 01-Jan-1970 00:00:01 GMT\0D\0ACache: no-cache\0D\0Amax-age: 0\0D\0As-maxage: 0\0D\0ACache-Control: no-cache, no-store, must-revalidate\0D\0ASetCookie: session=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; httponly\0D\0ALocation: /?loggedout=1\0D\0A\0D\0A\00"
define void @api_logout(%struct.user* nocapture readnone %0, %struct.mg_connection* %1, %struct.mg_request_info* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @mg_printf(%struct.mg_connection* %1, i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0))
ret void
}