#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*/ body;

/* Variables and functions */
int /*<<< orphan*/ BuildSendAndCloseSoapResp(struct upnphttp *, char *, int);
int snprintf(char *, int, char const *, char const *, char *, int,
             char const *);
void IsAuthorizedValidated(struct upnphttp *h, const char *action) {
  static const char resp[] = "<u:%sResponse "
                             "xmlns:u=\"%s\">"
                             "<Result>%d</Result>"
                             "</u:%sResponse>";
  char body[512];
  int bodylen;
  bodylen = snprintf(body, sizeof(body), resp, action,
                     "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
                     1, action);
  BuildSendAndCloseSoapResp(h, body, bodylen);
}


x86 assembly (clang, -O0):
<IsAuthorizedValidated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    $0x200,%esi
lea    0xeb2(%rip),%rdx
lea    0xee9(%rip),%r8
mov    $0x1,%r9d
mov    %rax,(%rsp)
call   1030 <snprintf@plt>
mov    %eax,-0x214(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    -0x214(%rbp),%edx
call   1040 <BuildSendAndCloseSoapResp@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAuthorizedValidated>:
push   %r14
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    %rsi,(%rsp)
lea    0xec5(%rip),%rdx
lea    0xefc(%rip),%r8
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x200,%esi
mov    $0x1,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <BuildSendAndCloseSoapResp@plt>
add    $0x218,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.upnphttp = type { i32 }
@IsAuthorizedValidated.resp = internal constant [62 x i8] c"<u:%sResponse xmlns:u=\22%s\22><Result>%d</Result></u:%sResponse>\00"
@.str = [56 x i8] c"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1\00"
define void @IsAuthorizedValidated(%struct.upnphttp* %0, i8* %1) {
%3 = alloca %struct.upnphttp*
%4 = alloca i8*
%5 = alloca [512 x i8]
%6 = alloca i32
store %struct.upnphttp* %0, %struct.upnphttp** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 512, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @IsAuthorizedValidated.resp, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 1, i8* %9)
store i32 %10, i32* %6
%11 = load %struct.upnphttp*, %struct.upnphttp** %3
%12 = getelementptr inbounds [512 x i8], [512 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 }
@IsAuthorizedValidated.resp = internal constant [62 x i8] c"<u:%sResponse xmlns:u=\22%s\22><Result>%d</Result></u:%sResponse>\00"
@.str = [56 x i8] c"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1\00"
define void @IsAuthorizedValidated(%struct.upnphttp* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @IsAuthorizedValidated.resp, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 1, i8* %1)
%6 = call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %0, i8* %4, i32 %5)
ret void
}