#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 upnphttp {
  int dummy;
};
typedef int /*<<< orphan*/ resp;
typedef int /*<<< orphan*/ body;

/* Variables and functions */
int /*<<< orphan*/ BuildSendAndCloseSoapResp(struct upnphttp *, char *, int);
int snprintf(char *, int, char const *, char const *, char *, char const *);
void GetCurrentConnectionInfo(struct upnphttp *h, const char *action) {
  static const char resp[] = "<u:%sResponse "
                             "xmlns:u=\"%s\">"
                             "<RcsID>-1</RcsID>"
                             "<AVTransportID>-1</AVTransportID>"
                             "<ProtocolInfo></ProtocolInfo>"
                             "<PeerConnectionManager></PeerConnectionManager>"
                             "<PeerConnectionID>-1</PeerConnectionID>"
                             "<Direction>Output</Direction>"
                             "<Status>Unknown</Status>"
                             "</u:%sResponse>";
  char body[sizeof(resp) + 128];
  int bodylen;
  bodylen =
      snprintf(body, sizeof(body), resp, action,
               "urn:schemas-upnp-org:service:ConnectionManager:1", action);
  BuildSendAndCloseSoapResp(h, body, bodylen);
}


x86 assembly (clang, -O0):
<GetCurrentConnectionInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    $0x185,%esi
lea    0xeb2(%rip),%rdx
lea    0xfb0(%rip),%r8
call   1030 <snprintf@plt>
mov    %eax,-0x1a4(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
mov    -0x1a4(%rbp),%edx
call   1040 <BuildSendAndCloseSoapResp@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCurrentConnectionInfo>:
push   %r14
push   %rbx
sub    $0x188,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xec9(%rip),%rdx
lea    0xfc7(%rip),%r8
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x185,%esi
mov    %rcx,%r9
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <BuildSendAndCloseSoapResp@plt>
add    $0x188,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.upnphttp = type { i32 }
@GetCurrentConnectionInfo.resp = internal constant [261 x i8] c"<u:%sResponse xmlns:u=\22%s\22><RcsID>-1</RcsID><AVTransportID>-1</AVTransportID><ProtocolInfo></ProtocolInfo><PeerConnectionManager></PeerConnectionManager><PeerConnectionID>-1</PeerConnectionID><Direction>Output</Direction><Status>Unknown</Status></u:%sResponse>\00"
@.str = [49 x i8] c"urn:schemas-upnp-org:service:ConnectionManager:1\00"
define void @GetCurrentConnectionInfo(%struct.upnphttp* %0, i8* %1) {
%3 = alloca %struct.upnphttp*
%4 = alloca i8*
%5 = alloca [389 x i8]
%6 = alloca i32
store %struct.upnphttp* %0, %struct.upnphttp** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [389 x i8], [389 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 389, i8* getelementptr inbounds ([261 x i8], [261 x i8]* @GetCurrentConnectionInfo.resp, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 %10, i32* %6
%11 = load %struct.upnphttp*, %struct.upnphttp** %3
%12 = getelementptr inbounds [389 x i8], [389 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %6
%14 = call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.upnphttp = type { i32 }
@GetCurrentConnectionInfo.resp = internal constant [261 x i8] c"<u:%sResponse xmlns:u=\22%s\22><RcsID>-1</RcsID><AVTransportID>-1</AVTransportID><ProtocolInfo></ProtocolInfo><PeerConnectionManager></PeerConnectionManager><PeerConnectionID>-1</PeerConnectionID><Direction>Output</Direction><Status>Unknown</Status></u:%sResponse>\00"
@.str = [49 x i8] c"urn:schemas-upnp-org:service:ConnectionManager:1\00"
define void @GetCurrentConnectionInfo(%struct.upnphttp* %0, i8* %1) {
%3 = alloca [389 x i8]
%4 = getelementptr inbounds [389 x i8], [389 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 389, i8* getelementptr inbounds ([261 x i8], [261 x i8]* @GetCurrentConnectionInfo.resp, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %0, i8* %4, i32 %5)
ret void
}