#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*/ free(char *);
char *genConnectionManager(int *);
char *genContentDirectory(int *);
char *genRootDesc(int *);
char *genX_MS_MediaReceiverRegistrar(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ xml_pretty_print(char *, int, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char *rootDesc;
  int rootDescLen;
  char *s;
  int l;
  rootDesc = genRootDesc(&rootDescLen);
  xml_pretty_print(rootDesc, rootDescLen, stdout);
  free(rootDesc);
  printf("\n----------------\n");
  printf("ContentDirectory\n");
  printf("----------------\n");
  s = genContentDirectory(&l);
  xml_pretty_print(s, l, stdout);
  free(s);
  printf("\n----------------\n");
  printf("ConnectionManager\n");
  printf("----------------\n");
  s = genConnectionManager(&l);
  xml_pretty_print(s, l, stdout);
  free(s);
  printf("\n----------------\n");
  printf("X_MS_MRR\n");
  printf("----------------\n");
  s = genX_MS_MediaReceiverRegistrar(&l);
  xml_pretty_print(s, l, stdout);
  free(s);
  printf("\n-------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <genRootDesc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    0x2e3f(%rip),%rax
mov    (%rax),%edx
call   1050 <xml_pretty_print@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
lea    0xe48(%rip),%rdi
call   1060 <printf@plt>
lea    0xe4f(%rip),%rdi
call   1060 <printf@plt>
lea    0xe31(%rip),%rdi
call   1060 <printf@plt>
lea    -0x2c(%rbp),%rdi
call   1070 <genContentDirectory@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    0x2df0(%rip),%rax
mov    (%rax),%edx
call   1050 <xml_pretty_print@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
lea    0xdf9(%rip),%rdi
call   1060 <printf@plt>
lea    0xe12(%rip),%rdi
call   1060 <printf@plt>
lea    0xde2(%rip),%rdi
call   1060 <printf@plt>
lea    -0x2c(%rbp),%rdi
call   1090 <genConnectionManager@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    0x2da1(%rip),%rax
mov    (%rax),%edx
call   1050 <xml_pretty_print@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
lea    0xdaa(%rip),%rdi
call   1060 <printf@plt>
lea    0xdd6(%rip),%rdi
call   1060 <printf@plt>
lea    0xd93(%rip),%rdi
call   1060 <printf@plt>
lea    -0x2c(%rbp),%rdi
call   1080 <genX_MS_MediaReceiverRegistrar@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    0x2d52(%rip),%rax
mov    (%rax),%edx
call   1050 <xml_pretty_print@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
lea    0xd9d(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1050 <genRootDesc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%esi
mov    0x2e4b(%rip),%r13
mov    0x0(%r13),%edx
mov    %rax,%rdi
call   1060 <xml_pretty_print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe73(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe41(%rip),%rdi
call   1040 <puts@plt>
lea    0xe59(%rip),%r15
mov    %r15,%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%r12
mov    %r12,%rdi
call   1070 <genContentDirectory@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%esi
mov    0x0(%r13),%edx
mov    %rax,%rdi
call   1060 <xml_pretty_print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe07(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1090 <genConnectionManager@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%esi
mov    0x0(%r13),%edx
mov    %rax,%rdi
call   1060 <xml_pretty_print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xdec(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1080 <genX_MS_MediaReceiverRegistrar@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%esi
mov    0x0(%r13),%edx
mov    %rax,%rdi
call   1060 <xml_pretty_print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xdbe(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"\0A----------------\0A\00"
@.str.1 = [18 x i8] c"ContentDirectory\0A\00"
@.str.2 = [18 x i8] c"----------------\0A\00"
@.str.3 = [19 x i8] c"ConnectionManager\0A\00"
@.str.4 = [10 x i8] c"X_MS_MRR\0A\00"
@.str.5 = [16 x i8] c"\0A-------------\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i8* @genRootDesc(i32* %7)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* @stdout
%14 = call i32 @xml_pretty_print(i8* %11, i32 %12, i32 %13)
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%20 = call i8* @genContentDirectory(i32* %9)
store i8* %20, i8** %8
%21 = load i8*, i8** %8
%22 = load i32, i32* %9
%23 = load i32, i32* @stdout
%24 = call i32 @xml_pretty_print(i8* %21, i32 %22, i32 %23)
%25 = load i8*, i8** %8
%26 = call i32 @free(i8* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%28 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%30 = call i8* @genConnectionManager(i32* %9)
store i8* %30, i8** %8
%31 = load i8*, i8** %8
%32 = load i32, i32* %9
%33 = load i32, i32* @stdout
%34 = call i32 @xml_pretty_print(i8* %31, i32 %32, i32 %33)
%35 = load i8*, i8** %8
%36 = call i32 @free(i8* %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%38 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%39 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%40 = call i8* @genX_MS_MediaReceiverRegistrar(i32* %9)
store i8* %40, i8** %8
%41 = load i8*, i8** %8
%42 = load i32, i32* %9
%43 = load i32, i32* @stdout
%44 = call i32 @xml_pretty_print(i8* %41, i32 %42, i32 %43)
%45 = load i8*, i8** %8
%46 = call i32 @free(i8* %45)
%47 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str.6 = [17 x i8] c"ContentDirectory\00"
@str.9 = [18 x i8] c"ConnectionManager\00"
@str.11 = [18 x i8] c"\0A----------------\00"
@str.12 = [9 x i8] c"X_MS_MRR\00"
@str.13 = [17 x i8] c"----------------\00"
@str.14 = [15 x i8] c"\0A-------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i8* @genRootDesc(i32* %3)
%8 = load i32, i32* %3
%9 = load i32, i32* @stdout
%10 = call i32 @xml_pretty_print(i8* %7, i32 %8, i32 %9)
%11 = call i32 @free(i8* %7)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%15 = call i8* @genContentDirectory(i32* %4)
%16 = load i32, i32* %4
%17 = load i32, i32* @stdout
%18 = call i32 @xml_pretty_print(i8* %15, i32 %16, i32 %17)
%19 = call i32 @free(i8* %15)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%23 = call i8* @genConnectionManager(i32* %4)
%24 = load i32, i32* %4
%25 = load i32, i32* @stdout
%26 = call i32 @xml_pretty_print(i8* %23, i32 %24, i32 %25)
%27 = call i32 @free(i8* %23)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%31 = call i8* @genX_MS_MediaReceiverRegistrar(i32* %4)
%32 = load i32, i32* %4
%33 = load i32, i32* @stdout
%34 = call i32 @xml_pretty_print(i8* %31, i32 %32, i32 %33)
%35 = call i32 @free(i8* %31)
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
ret i32 0
}