#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*/ assert(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int /*<<< orphan*/ strlen(char *);
void sendUser(const char *user, const char *name, int sockfd) {
  assert(NULL != user);
  assert(NULL != name);
  assert(0 < sockfd);
  char output[1024] = {0};
  sprintf(output, "USER %s 8 * :%s\r\n", user, name);
  if (0 > send(sockfd, output, strlen(output), 0)) {
    perror("send error");
    pthread_exit(NULL);
  }
}


x86 assembly (clang, -O0):
<sendUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe19(%rip),%rsi
call   1090 <sprintf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x42c(%rbp),%edi
mov    -0x428(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1248 <sendUser+0xd8>
lea    0xdd8(%rip),%rdi
call   1080 <perror@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <pthread_exit@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendUser>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1060 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1060 <assert@plt>
xor    %edi,%edi
test   %r14d,%r14d
setg   %dil
call   1060 <assert@plt>
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r15,%rcx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
test   %rax,%rax
js     1201 <sendUser+0x91>
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe0a(%rip),%rdi
call   1080 <perror@plt>
xor    %edi,%edi
call   1070 <pthread_exit@plt>
jmp    11f3 <sendUser+0x83>

LLVM IR (-O0):
@.str = [18 x i8] c"USER %s 8 * :%s\0D\0A\00"
@.str.1 = [11 x i8] c"send error\00"
define void @sendUser(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = icmp ne i8* null, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %5
%13 = icmp ne i8* null, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %6
%17 = icmp slt i32 0, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = bitcast [1024 x i8]* %7 to i8*
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23)
%25 = load i32, i32* %6
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
%29 = call i64 @send(i32 %25, i8* %26, i32 %28, i32 0)
%30 = icmp sgt i64 0, %29
br i1 %30, label %31, label %34
31: ; preds = %3
%32 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 @pthread_exit(i32* null)
br label %34
34: ; preds = %31, %3
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"USER %s 8 * :%s\0D\0A\00"
@.str.1 = [11 x i8] c"send error\00"
define void @sendUser(i8* %0, i8* %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i8* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp sgt i32 %2, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%16 = call i32 @strlen(i8* %14)
%17 = call i64 @send(i32 %2, i8* %14, i32 %16, i32 0)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @pthread_exit(i32* null)
br label %22
22: ; preds = %19, %3
ret void
}