#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 sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ sendto(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/,
                  struct sockaddr *, int);
int /*<<< orphan*/ strlen(char const *);
void cp_send(int descriptor, const char *response, struct sockaddr *info) {
  if (sendto(descriptor, response, strlen(response), 0, info, sizeof(*info)) <
      0) {
    perror("There was an error sending the information to player one");
  }
}


x86 assembly (clang, -O0):
<cp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1040 <sendto@plt>
cmp    $0x0,%rax
jge    118a <cp_send+0x5a>
lea    0xe7b(%rip),%rdi
call   1050 <perror@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_send>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0x4,%r9d
call   1040 <sendto@plt>
test   %rax,%rax
js     1165 <cp_send+0x35>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe94(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <perror@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [57 x i8] c"There was an error sending the information to player one\00"
define void @cp_send(i32 %0, i8* %1, %struct.sockaddr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.sockaddr*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.sockaddr* %2, %struct.sockaddr** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = load %struct.sockaddr*, %struct.sockaddr** %6
%12 = call i64 @sendto(i32 %7, i8* %8, i32 %10, i32 0, %struct.sockaddr* %11, i32 4)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [57 x i8] c"There was an error sending the information to player one\00"
define void @cp_send(i32 %0, i8* %1, %struct.sockaddr* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i64 @sendto(i32 %0, i8* %1, i32 %4, i32 0, %struct.sockaddr* %2, i32 4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}