#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 */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
scalar_t__ TCP_Send(int /*<<< orphan*/, void *, size_t);
int /*<<< orphan*/ memcpy(void *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int MyFunc(void *_data, size_t _sizeData, uint _socketNum, void *_contex) {
  printf("Recive:%s. \n", (char *)_data);
  memcpy(_data, "!", 1);
  if (TCP_Send(_socketNum, _data, _sizeData) <= 0) {
    perror("Send response from server failed.\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<MyFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
mov    $0x1,%edx
call   1050 <memcpy@plt>
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <TCP_Send@plt>
cmp    $0x0,%rax
jg     11ae <MyFunc+0x6e>
lea    0xe72(%rip),%rdi
call   1060 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b5 <MyFunc+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyFunc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xea8(%rip),%rsi
mov    $0x1,%r14d
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <memcpy@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <TCP_Send@plt>
test   %rax,%rax
jle    1198 <MyFunc+0x58>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe70(%rip),%rdi
call   1060 <perror@plt>
xor    %r14d,%r14d
jmp    118a <MyFunc+0x4a>

LLVM IR (-O0):
@.str = [13 x i8] c"Recive:%s. \0A\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [35 x i8] c"Send response from server failed.\0A\00"
define i32 @MyFunc(i8* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i8*, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @memcpy(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%14 = load i32, i32* %8
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = call i64 @TCP_Send(i32 %14, i8* %15, i64 %16)
%18 = icmp sle i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %22
21: ; preds = %4
store i32 1, i32* %5
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [13 x i8] c"Recive:%s. \0A\00"
@.str.1 = [2 x i8] c"!\00"
@.str.2 = [35 x i8] c"Send response from server failed.\0A\00"
define i32 @MyFunc(i8* %0, i64 %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = tail call i64 @TCP_Send(i32 %2, i8* %0, i64 %1)
%8 = icmp slt i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %12
}