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

/* Variables and functions */
int /*<<< orphan*/ mg_add_response_header(struct mg_connection *,
                                          int /*<<< orphan*/, char *, char *);
char *mg_get_allowed_methods(struct mg_connection *);
scalar_t__ mg_is_producing_nested_page(struct mg_connection *);
int /*<<< orphan*/ mg_write_http_response_head(struct mg_connection *, int,
                                               int /*<<< orphan*/);
void send_options(struct mg_connection *conn) {
  if (mg_is_producing_nested_page(conn))
    return;
  mg_add_response_header(conn, 0, "Allow", mg_get_allowed_methods(conn));
  mg_add_response_header(conn, 0, "DAV", "1");
  mg_write_http_response_head(conn, 200, 0);
}


x86 assembly (clang, -O0):
<send_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mg_is_producing_nested_page@plt>
cmp    $0x0,%rax
je     1164 <send_options+0x24>
jmp    11b3 <send_options+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <mg_get_allowed_methods@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rcx
xor    %esi,%esi
lea    0xe7b(%rip),%rdx
call   1040 <mg_add_response_header@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
lea    0xe6f(%rip),%rdx
lea    0xe6c(%rip),%rcx
call   1040 <mg_add_response_header@plt>
mov    -0x8(%rbp),%rdi
mov    $0xc8,%esi
xor    %edx,%edx
call   1030 <mg_write_http_response_head@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_options>:
push   %rbx
mov    %rdi,%rbx
call   1050 <mg_is_producing_nested_page@plt>
test   %rax,%rax
je     1150 <send_options+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1060 <mg_get_allowed_methods@plt>
lea    0xea1(%rip),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %rax,%rcx
call   1040 <mg_add_response_header@plt>
lea    0xe93(%rip),%rdx
lea    0xe90(%rip),%rcx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <mg_add_response_header@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <mg_write_http_response_head@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
@.str = [6 x i8] c"Allow\00"
@.str.1 = [4 x i8] c"DAV\00"
@.str.2 = [2 x i8] c"1\00"
define void @send_options(%struct.mg_connection* %0) {
%2 = alloca %struct.mg_connection*
store %struct.mg_connection* %0, %struct.mg_connection** %2
%3 = load %struct.mg_connection*, %struct.mg_connection** %2
%4 = call i64 @mg_is_producing_nested_page(%struct.mg_connection* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %16
7: ; preds = %1
%8 = load %struct.mg_connection*, %struct.mg_connection** %2
%9 = load %struct.mg_connection*, %struct.mg_connection** %2
%10 = call i8* @mg_get_allowed_methods(%struct.mg_connection* %9)
%11 = call i32 @mg_add_response_header(%struct.mg_connection* %8, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load %struct.mg_connection*, %struct.mg_connection** %2
%13 = call i32 @mg_add_response_header(%struct.mg_connection* %12, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = load %struct.mg_connection*, %struct.mg_connection** %2
%15 = call i32 @mg_write_http_response_head(%struct.mg_connection* %14, i32 200, i32 0)
br label %16
16: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
@.str = [6 x i8] c"Allow\00"
@.str.1 = [4 x i8] c"DAV\00"
@.str.2 = [2 x i8] c"1\00"
define void @send_options(%struct.mg_connection* %0) {
%2 = tail call i64 @mg_is_producing_nested_page(%struct.mg_connection* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i8* @mg_get_allowed_methods(%struct.mg_connection* %0)
%6 = tail call i32 @mg_add_response_header(%struct.mg_connection* %0, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @mg_add_response_header(%struct.mg_connection* %0, i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @mg_write_http_response_head(%struct.mg_connection* %0, i32 200, i32 0)
br label %9
9: ; preds = %1, %4
ret void
}