#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 *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sk_send(int, char *, int);
char *srv_readstr(int, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ ut_WriteLog(char *, char *);
void srv_DelBuddy(int sock, char *jidname, int ssl) {
  char *buffer = (char *)malloc(1024);
  strcpy(buffer, "<iq type='set'><query xmlns='jabber:iq:roster'>");
  strcat(buffer, "<item jid='");
  strcat(buffer, jidname);
  strcat(buffer, "' sudirription='remove'/></query></iq>");
  sk_send(sock, buffer, ssl);
  free(buffer);
  buffer = srv_readstr(sock, ssl);
  ut_WriteLog("[SudirriptionRemove]: %s\n", buffer);
  free(buffer);
}


x86 assembly (clang, -O0):
<srv_DelBuddy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <sk_send@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <srv_readstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe64(%rip),%rdi
call   1090 <ut_WriteLog@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srv_DelBuddy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe6d(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1080 <strcat@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1070 <sk_send@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <srv_readstr@plt>
mov    %rax,%rbx
lea    0xe76(%rip),%rdi
mov    %rax,%rsi
call   1090 <ut_WriteLog@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"<iq type='set'><query xmlns='jabber:iq:roster'>\00"
@.str.1 = [12 x i8] c"<item jid='\00"
@.str.2 = [39 x i8] c"' sudirription='remove'/></query></iq>\00"
@.str.3 = [26 x i8] c"[SudirriptionRemove]: %s\0A\00"
define void @srv_DelBuddy(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i64 @malloc(i32 1024)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %7
%13 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = load i8*, i8** %5
%16 = call i32 @strcat(i8* %14, i8* %15)
%17 = load i8*, i8** %7
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %4
%20 = load i8*, i8** %7
%21 = load i32, i32* %6
%22 = call i32 @sk_send(i32 %19, i8* %20, i32 %21)
%23 = load i8*, i8** %7
%24 = call i32 @free(i8* %23)
%25 = load i32, i32* %4
%26 = load i32, i32* %6
%27 = call i8* @srv_readstr(i32 %25, i32 %26)
store i8* %27, i8** %7
%28 = load i8*, i8** %7
%29 = call i32 @ut_WriteLog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %28)
%30 = load i8*, i8** %7
%31 = call i32 @free(i8* %30)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"<iq type='set'><query xmlns='jabber:iq:roster'>\00"
@.str.1 = [12 x i8] c"<item jid='\00"
@.str.2 = [39 x i8] c"' sudirription='remove'/></query></iq>\00"
@.str.3 = [26 x i8] c"[SudirriptionRemove]: %s\0A\00"
define void @srv_DelBuddy(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %5, i8* %1)
%9 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @sk_send(i32 %0, i8* %5, i32 %2)
%11 = tail call i32 @free(i8* %5)
%12 = tail call i8* @srv_readstr(i32 %0, i32 %2)
%13 = tail call i32 @ut_WriteLog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = tail call i32 @free(i8* %12)
ret void
}