#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 /*<<< orphan*/ close_xml_document_(int);
int /*<<< orphan*/ open_xml_document_(int, unsigned long);
int /*<<< orphan*/ write_XML_Element_(int, char *, char *);
int /*<<< orphan*/ write_XML_Element_Size(int, char *, char *, size_t);
void write_Email_message_to_xml(int xml_fd, unsigned long int docID_CRC32,
                                char *text, size_t size_text, char *from_field,
                                char *subj_field, char *offset_attr,
                                char *sent_tm, char *recv_tm, char *file_name,
                                char *message_id_attr) {
  open_xml_document_(xml_fd, docID_CRC32);
  write_XML_Element_Size(xml_fd, "CONTENT_FIELD", text, size_text);
  write_XML_Element_(xml_fd, "FROM_FIELD", from_field);
  write_XML_Element_(xml_fd, "SUBJECT_FIELD", subj_field);
  write_XML_Element_(xml_fd, "OFFSET_MESSAGE", offset_attr);
  write_XML_Element_(xml_fd, "SENT", sent_tm);
  write_XML_Element_(xml_fd, "RECEIVED", recv_tm);
  write_XML_Element_(xml_fd, "FROM", from_field);
  write_XML_Element_(xml_fd, "SUBJECT_ATTR", subj_field);
  close_xml_document_(xml_fd);
  return;
}


x86 assembly (clang, -O0):
<write_Email_message_to_xml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <open_xml_document_@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe6f(%rip),%rsi
call   1040 <write_XML_Element_Size@plt>
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rdx
lea    0xe6a(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rdx
lea    0xe62(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    0x10(%rbp),%rdx
lea    0xe5d(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    0x18(%rbp),%rdx
lea    0xe59(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    0x20(%rbp),%rdx
lea    0xe4b(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rdx
lea    0xe41(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rdx
lea    0xe33(%rip),%rsi
call   1030 <write_XML_Element_@plt>
mov    -0x4(%rbp),%edi
call   1060 <close_xml_document_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_Email_message_to_xml>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %rcx,%r15
mov    %rdx,%r12
mov    %edi,%ebp
mov    0x60(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x58(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    0x50(%rsp),%r13
call   1050 <open_xml_document_@plt>
lea    0xe7f(%rip),%rsi
mov    %ebp,%edi
mov    %r12,%rdx
mov    %r15,%rcx
call   1040 <write_XML_Element_Size@plt>
lea    0xe79(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe73(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe70(%rip),%rsi
mov    %ebp,%edi
mov    %r13,%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe6e(%rip),%rsi
mov    %ebp,%edi
mov    0x8(%rsp),%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe60(%rip),%rsi
mov    %ebp,%edi
mov    0x10(%rsp),%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe56(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1030 <write_XML_Element_@plt>
lea    0xe4a(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
call   1030 <write_XML_Element_@plt>
mov    %ebp,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <close_xml_document_@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"CONTENT_FIELD\00"
@.str.1 = [11 x i8] c"FROM_FIELD\00"
@.str.2 = [14 x i8] c"SUBJECT_FIELD\00"
@.str.3 = [15 x i8] c"OFFSET_MESSAGE\00"
@.str.4 = [5 x i8] c"SENT\00"
@.str.5 = [9 x i8] c"RECEIVED\00"
@.str.6 = [5 x i8] c"FROM\00"
@.str.7 = [13 x i8] c"SUBJECT_ATTR\00"
define void @write_Email_message_to_xml(i32 %0, i64 %1, i8* %2, i64 %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* %9, i8* %10) {
%12 = alloca i32
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
store i32 %0, i32* %12
store i64 %1, i64* %13
store i8* %2, i8** %14
store i64 %3, i64* %15
store i8* %4, i8** %16
store i8* %5, i8** %17
store i8* %6, i8** %18
store i8* %7, i8** %19
store i8* %8, i8** %20
store i8* %9, i8** %21
store i8* %10, i8** %22
%23 = load i32, i32* %12
%24 = load i64, i64* %13
%25 = call i32 @open_xml_document_(i32 %23, i64 %24)
%26 = load i32, i32* %12
%27 = load i8*, i8** %14
%28 = load i64, i64* %15
%29 = call i32 @write_XML_Element_Size(i32 %26, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %27, i64 %28)
%30 = load i32, i32* %12
%31 = load i8*, i8** %16
%32 = call i32 @write_XML_Element_(i32 %30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = load i32, i32* %12
%34 = load i8*, i8** %17
%35 = call i32 @write_XML_Element_(i32 %33, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %12
%37 = load i8*, i8** %18
%38 = call i32 @write_XML_Element_(i32 %36, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = load i32, i32* %12
%40 = load i8*, i8** %19
%41 = call i32 @write_XML_Element_(i32 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = load i32, i32* %12
%43 = load i8*, i8** %20
%44 = call i32 @write_XML_Element_(i32 %42, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %43)
%45 = load i32, i32* %12
%46 = load i8*, i8** %16
%47 = call i32 @write_XML_Element_(i32 %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %46)
%48 = load i32, i32* %12
%49 = load i8*, i8** %17
%50 = call i32 @write_XML_Element_(i32 %48, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %49)
%51 = load i32, i32* %12
%52 = call i32 @close_xml_document_(i32 %51)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"CONTENT_FIELD\00"
@.str.1 = [11 x i8] c"FROM_FIELD\00"
@.str.2 = [14 x i8] c"SUBJECT_FIELD\00"
@.str.3 = [15 x i8] c"OFFSET_MESSAGE\00"
@.str.4 = [5 x i8] c"SENT\00"
@.str.5 = [9 x i8] c"RECEIVED\00"
@.str.6 = [5 x i8] c"FROM\00"
@.str.7 = [13 x i8] c"SUBJECT_ATTR\00"
define void @write_Email_message_to_xml(i32 %0, i64 %1, i8* %2, i64 %3, i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* nocapture readnone %9, i8* nocapture readnone %10) {
%12 = tail call i32 @open_xml_document_(i32 %0, i64 %1)
%13 = tail call i32 @write_XML_Element_Size(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %3)
%14 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%16 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%17 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%18 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %8)
%19 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* %4)
%20 = tail call i32 @write_XML_Element_(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%21 = tail call i32 @close_xml_document_(i32 %0)
ret void
}