#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*/ ILibXmlEscape(char *, char const *);
scalar_t__ ILibXmlEscapeLength(char const *);
int /*<<< orphan*/ UpnpResponseGeneric(void const *, char *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int const, char *, char *,
                           char *, char *, char *, int const, int const);
scalar_t__ strlen(char *);
void UpnpResponse_MediaRenderer_AVTransport_GetPositionInfo(
    const void *UPnPToken, const unsigned int Track,
    const char *unescaped_TrackDuration, const char *unescaped_TrackMetaData,
    const char *unescaped_TrackURI, const char *unescaped_RelTime,
    const char *unescaped_AbsTime, const int RelCount, const int AbsCount) {
  char *body;
  char *TrackDuration =
      (char *)malloc(1 + ILibXmlEscapeLength(unescaped_TrackDuration));
  char *TrackMetaData =
      (char *)malloc(1 + ILibXmlEscapeLength(unescaped_TrackMetaData));
  char *TrackURI = (char *)malloc(1 + ILibXmlEscapeLength(unescaped_TrackURI));
  char *RelTime = (char *)malloc(1 + ILibXmlEscapeLength(unescaped_RelTime));
  char *AbsTime = (char *)malloc(1 + ILibXmlEscapeLength(unescaped_AbsTime));
  ILibXmlEscape(TrackDuration, unescaped_TrackDuration);
  ILibXmlEscape(TrackMetaData, unescaped_TrackMetaData);
  ILibXmlEscape(TrackURI, unescaped_TrackURI);
  ILibXmlEscape(RelTime, unescaped_RelTime);
  ILibXmlEscape(AbsTime, unescaped_AbsTime);
  body = (char *)malloc(212 + strlen(TrackDuration) + strlen(TrackMetaData) +
                        strlen(TrackURI) + strlen(RelTime) + strlen(AbsTime));
  sprintf(
      body,
      "<Track>%u</Track><TrackDuration>%s</TrackDuration><TrackMetaData>%s</"
      "TrackMetaData><TrackURI>%s</TrackURI><RelTime>%s</RelTime><AbsTime>%s</"
      "AbsTime><RelCount>%d</RelCount><AbsCount>%d</AbsCount>",
      Track, TrackDuration, TrackMetaData, TrackURI, RelTime, AbsTime, RelCount,
      AbsCount);
  UpnpResponseGeneric(UPnPToken, "urn:schemas-upnp-org:service:AVTransport:1",
                      "GetPositionInfo", body);
  free(body);
  free(TrackDuration);
  free(TrackMetaData);
  free(TrackURI);
  free(RelTime);
  free(AbsTime);
}


x86 assembly (clang, -O0):
<UpnpResponse_MediaRenderer_AVTransport_GetPositionInfo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xa8,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <ILibXmlEscapeLength@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
call   1090 <ILibXmlEscapeLength@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <ILibXmlEscapeLength@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%rdi
call   1090 <ILibXmlEscapeLength@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    0x10(%rbp),%rdi
call   1090 <ILibXmlEscapeLength@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    -0x50(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    -0x58(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    -0x60(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    -0x68(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    -0x48(%rbp),%rdi
call   1060 <strlen@plt>
add    $0xd4,%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x58(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x60(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x70(%rbp),%rdi
add    %rax,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%rbx
mov    -0x68(%rbp),%r11
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
lea    0xd05(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rcx
lea    0xda2(%rip),%rsi
lea    0xdc6(%rip),%rdx
call   1050 <UpnpResponseGeneric@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpResponse_MediaRenderer_AVTransport_GetPositionInfo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r12
mov    %r9,0x10(%rsp)
mov    %r8,%rbx
mov    %r8,0x18(%rsp)
mov    %rcx,%rbp
mov    %rcx,0x20(%rsp)
mov    %rdx,0x28(%rsp)
mov    %esi,0x4(%rsp)
mov    %rdi,0x40(%rsp)
mov    0x88(%rsp),%eax
mov    %rax,0x38(%rsp)
mov    0x90(%rsp),%eax
mov    %rax,0x30(%rsp)
mov    0x80(%rsp),%r14
mov    %rdx,%rdi
call   1090 <ILibXmlEscapeLength@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %rbp,%rdi
call   1090 <ILibXmlEscapeLength@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1090 <ILibXmlEscapeLength@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    %r12,%rdi
call   1090 <ILibXmlEscapeLength@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    %r14,%rdi
mov    %r14,%r12
call   1090 <ILibXmlEscapeLength@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    0x28(%rsp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    %rbp,%rdi
mov    0x20(%rsp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    %r15,%rdi
mov    0x18(%rsp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    %r13,%rdi
mov    0x10(%rsp),%rsi
call   1040 <ILibXmlEscape@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <ILibXmlEscape@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rbp,%r12
call   1060 <strlen@plt>
mov    %rax,%rbp
add    %rbx,%rbp
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbx
add    %rbp,%rbx
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbp
add    %rbx,%rbp
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    (%rax,%rbp,1),%rdi
add    $0xd4,%rdi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xd35(%rip),%rsi
mov    %rax,%rdi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rbp
mov    %rbp,%rcx
mov    %r12,%r8
mov    %r15,%r9
push   0x30(%rsp)
push   0x40(%rsp)
push   %r14
push   %r13
call   1080 <sprintf@plt>
add    $0x20,%rsp
lea    0xdc7(%rip),%rsi
lea    0xdeb(%rip),%rdx
mov    0x40(%rsp),%rdi
mov    %rbx,%rcx
call   1050 <UpnpResponseGeneric@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [195 x i8] c"<Track>%u</Track><TrackDuration>%s</TrackDuration><TrackMetaData>%s</TrackMetaData><TrackURI>%s</TrackURI><RelTime>%s</RelTime><AbsTime>%s</AbsTime><RelCount>%d</RelCount><AbsCount>%d</AbsCount>\00"
@.str.1 = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.2 = [16 x i8] c"GetPositionInfo\00"
define void @UpnpResponse_MediaRenderer_AVTransport_GetPositionInfo(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i32 %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
store i8* %0, i8** %10
store i32 %1, i32* %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i8* %5, i8** %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%25 = load i8*, i8** %12
%26 = call i64 @ILibXmlEscapeLength(i8* %25)
%27 = add nsw i64 1, %26
%28 = call i64 @malloc(i64 %27)
%29 = inttoptr i64 %28 to i8*
store i8* %29, i8** %20
%30 = load i8*, i8** %13
%31 = call i64 @ILibXmlEscapeLength(i8* %30)
%32 = add nsw i64 1, %31
%33 = call i64 @malloc(i64 %32)
%34 = inttoptr i64 %33 to i8*
store i8* %34, i8** %21
%35 = load i8*, i8** %14
%36 = call i64 @ILibXmlEscapeLength(i8* %35)
%37 = add nsw i64 1, %36
%38 = call i64 @malloc(i64 %37)
%39 = inttoptr i64 %38 to i8*
store i8* %39, i8** %22
%40 = load i8*, i8** %15
%41 = call i64 @ILibXmlEscapeLength(i8* %40)
%42 = add nsw i64 1, %41
%43 = call i64 @malloc(i64 %42)
%44 = inttoptr i64 %43 to i8*
store i8* %44, i8** %23
%45 = load i8*, i8** %16
%46 = call i64 @ILibXmlEscapeLength(i8* %45)
%47 = add nsw i64 1, %46
%48 = call i64 @malloc(i64 %47)
%49 = inttoptr i64 %48 to i8*
store i8* %49, i8** %24
%50 = load i8*, i8** %20
%51 = load i8*, i8** %12
%52 = call i32 @ILibXmlEscape(i8* %50, i8* %51)
%53 = load i8*, i8** %21
%54 = load i8*, i8** %13
%55 = call i32 @ILibXmlEscape(i8* %53, i8* %54)
%56 = load i8*, i8** %22
%57 = load i8*, i8** %14
%58 = call i32 @ILibXmlEscape(i8* %56, i8* %57)
%59 = load i8*, i8** %23
%60 = load i8*, i8** %15
%61 = call i32 @ILibXmlEscape(i8* %59, i8* %60)
%62 = load i8*, i8** %24
%63 = load i8*, i8** %16
%64 = call i32 @ILibXmlEscape(i8* %62, i8* %63)
%65 = load i8*, i8** %20
%66 = call i64 @strlen(i8* %65)
%67 = add nsw i64 212, %66
%68 = load i8*, i8** %21
%69 = call i64 @strlen(i8* %68)
%70 = add nsw i64 %67, %69
%71 = load i8*, i8** %22
%72 = call i64 @strlen(i8* %71)
%73 = add nsw i64 %70, %72
%74 = load i8*, i8** %23
%75 = call i64 @strlen(i8* %74)
%76 = add nsw i64 %73, %75
%77 = load i8*, i8** %24
%78 = call i64 @strlen(i8* %77)
%79 = add nsw i64 %76, %78
%80 = call i64 @malloc(i64 %79)
%81 = inttoptr i64 %80 to i8*
store i8* %81, i8** %19
%82 = load i8*, i8** %19
%83 = load i32, i32* %11
%84 = load i8*, i8** %20
%85 = load i8*, i8** %21
%86 = load i8*, i8** %22
%87 = load i8*, i8** %23
%88 = load i8*, i8** %24
%89 = load i32, i32* %17
%90 = load i32, i32* %18
%91 = call i32 @sprintf(i8* %82, i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0), i32 %83, i8* %84, i8* %85, i8* %86, i8* %87, i8* %88, i32 %89, i32 %90)
%92 = load i8*, i8** %10
%93 = load i8*, i8** %19
%94 = call i32 @UpnpResponseGeneric(i8* %92, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %93)
%95 = load i8*, i8** %19
%96 = call i32 @free(i8* %95)
%97 = load i8*, i8** %20
%98 = call i32 @free(i8* %97)
%99 = load i8*, i8** %21
%100 = call i32 @free(i8* %99)
%101 = load i8*, i8** %22
%102 = call i32 @free(i8* %101)
%103 = load i8*, i8** %23
%104 = call i32 @free(i8* %103)
%105 = load i8*, i8** %24
%106 = call i32 @free(i8* %105)
ret void
}

LLVM IR (-O2):
@.str = [195 x i8] c"<Track>%u</Track><TrackDuration>%s</TrackDuration><TrackMetaData>%s</TrackMetaData><TrackURI>%s</TrackURI><RelTime>%s</RelTime><AbsTime>%s</AbsTime><RelCount>%d</RelCount><AbsCount>%d</AbsCount>\00"
@.str.1 = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.2 = [16 x i8] c"GetPositionInfo\00"
define void @UpnpResponse_MediaRenderer_AVTransport_GetPositionInfo(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i32 %7, i32 %8) {
%10 = tail call i64 @ILibXmlEscapeLength(i8* %2)
%11 = add nsw i64 %10, 1
%12 = tail call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i64 @ILibXmlEscapeLength(i8* %3)
%15 = add nsw i64 %14, 1
%16 = tail call i64 @malloc(i64 %15)
%17 = inttoptr i64 %16 to i8*
%18 = tail call i64 @ILibXmlEscapeLength(i8* %4)
%19 = add nsw i64 %18, 1
%20 = tail call i64 @malloc(i64 %19)
%21 = inttoptr i64 %20 to i8*
%22 = tail call i64 @ILibXmlEscapeLength(i8* %5)
%23 = add nsw i64 %22, 1
%24 = tail call i64 @malloc(i64 %23)
%25 = inttoptr i64 %24 to i8*
%26 = tail call i64 @ILibXmlEscapeLength(i8* %6)
%27 = add nsw i64 %26, 1
%28 = tail call i64 @malloc(i64 %27)
%29 = inttoptr i64 %28 to i8*
%30 = tail call i32 @ILibXmlEscape(i8* %13, i8* %2)
%31 = tail call i32 @ILibXmlEscape(i8* %17, i8* %3)
%32 = tail call i32 @ILibXmlEscape(i8* %21, i8* %4)
%33 = tail call i32 @ILibXmlEscape(i8* %25, i8* %5)
%34 = tail call i32 @ILibXmlEscape(i8* %29, i8* %6)
%35 = tail call i64 @strlen(i8* dereferenceable(1) %13)
%36 = add nsw i64 %35, 212
%37 = tail call i64 @strlen(i8* dereferenceable(1) %17)
%38 = add nsw i64 %36, %37
%39 = tail call i64 @strlen(i8* dereferenceable(1) %21)
%40 = add nsw i64 %38, %39
%41 = tail call i64 @strlen(i8* dereferenceable(1) %25)
%42 = add nsw i64 %40, %41
%43 = tail call i64 @strlen(i8* dereferenceable(1) %29)
%44 = add nsw i64 %42, %43
%45 = tail call i64 @malloc(i64 %44)
%46 = inttoptr i64 %45 to i8*
%47 = tail call i32 @sprintf(i8* dereferenceable(1) %46, i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %13, i8* %17, i8* %21, i8* %25, i8* %29, i32 %7, i32 %8)
%48 = tail call i32 @UpnpResponseGeneric(i8* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %46)
%49 = tail call i32 @free(i8* %46)
%50 = tail call i32 @free(i8* %13)
%51 = tail call i32 @free(i8* %17)
%52 = tail call i32 @free(i8* %21)
%53 = tail call i32 @free(i8* %25)
%54 = tail call i32 @free(i8* %29)
ret void
}