#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*/ UpnpResponseGeneric(void const *, char *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void UpnpResponse_MediaRenderer_RenderingControl_GetMute(
    const void *UPnPToken, const int CurrentMute) {
  char *body;
  body = (char *)malloc(29);
  sprintf(body, "<CurrentMute>%d</CurrentMute>", (CurrentMute != 0 ? 1 : 0));
  UpnpResponseGeneric(UPnPToken,
                      "urn:schemas-upnp-org:service:RenderingControl:1",
                      "GetMute", body);
  free(body);
}


x86 assembly (clang, -O0):
<UpnpResponse_MediaRenderer_RenderingControl_GetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1d,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xe88(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    0xe92(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1040 <UpnpResponseGeneric@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpResponse_MediaRenderer_RenderingControl_GetMute>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x1d,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edx,%edx
test   %ebp,%ebp
setne  %dl
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
call   1060 <sprintf@plt>
lea    0xeab(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <UpnpResponseGeneric@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"<CurrentMute>%d</CurrentMute>\00"
@.str.1 = [48 x i8] c"urn:schemas-upnp-org:service:RenderingControl:1\00"
@.str.2 = [8 x i8] c"GetMute\00"
define void @UpnpResponse_MediaRenderer_RenderingControl_GetMute(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i64 @malloc(i32 29)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
%13 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %3
%15 = load i8*, i8** %5
%16 = call i32 @UpnpResponseGeneric(i8* %14, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"<CurrentMute>%d</CurrentMute>\00"
@.str.1 = [48 x i8] c"urn:schemas-upnp-org:service:RenderingControl:1\00"
@.str.2 = [8 x i8] c"GetMute\00"
define void @UpnpResponse_MediaRenderer_RenderingControl_GetMute(i8* %0, i32 %1) {
%3 = tail call i64 @malloc(i32 29)
%4 = inttoptr i64 %3 to i8*
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @UpnpResponseGeneric(i8* %0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = tail call i32 @free(i8* %4)
ret void
}