#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*/ Send(int, char *, char *);
int strlen(char *);
void nickc(int sock, char *sender, int argc, char **argv) {
  if (argc != 1) {
    Send(sock, "NOTICE %s :NICK <nick>\n", sender);
    return;
  }
  if (strlen(argv[1]) >= 10) {
    Send(sock, "NOTICE %s :Nick cannot be larger than 9 characters.\n", sender);
    return;
  }
  Send(sock, "NICK %s\n", argv[1]);
}


x86 assembly (clang, -O0):
<nickc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     1158 <nickc+0x38>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1040 <Send@plt>
jmp    119d <nickc+0x7d>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
jl     1186 <nickc+0x66>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <Send@plt>
jmp    119d <nickc+0x7d>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <Send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nickc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    $0x1,%edx
jne    1148 <nickc+0x28>
mov    %rcx,%rbx
mov    0x8(%rcx),%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
jl     1156 <nickc+0x36>
lea    0xed2(%rip),%rsi
jmp    114f <nickc+0x2f>
lea    0xeb1(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
jmp    1163 <nickc+0x43>
mov    0x8(%rbx),%rdx
lea    0xeec(%rip),%rsi
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Send@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"NOTICE %s :NICK <nick>\0A\00"
@.str.1 = [53 x i8] c"NOTICE %s :Nick cannot be larger than 9 characters.\0A\00"
@.str.2 = [9 x i8] c"NICK %s\0A\00"
define void @nickc(i32 %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @Send(i32 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %31
15: ; preds = %4
%16 = load i8**, i8*** %8
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
%20 = icmp sge i32 %19, 10
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32, i32* %5
%23 = load i8*, i8** %6
%24 = call i32 @Send(i32 %22, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %31
25: ; preds = %15
%26 = load i32, i32* %5
%27 = load i8**, i8*** %8
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @Send(i32 %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %25, %21, %11
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"NOTICE %s :NICK <nick>\0A\00"
@.str.1 = [53 x i8] c"NOTICE %s :Nick cannot be larger than 9 characters.\0A\00"
@.str.2 = [9 x i8] c"NICK %s\0A\00"
define void @nickc(i32 %0, i8* %1, i32 %2, i8** nocapture %3) {
%5 = icmp eq i32 %2, 1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @Send(i32 %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %18
8: ; preds = %4
%9 = getelementptr inbounds i8*, i8** %3, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strlen(i8* %10)
%12 = icmp sgt i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @Send(i32 %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %18
15: ; preds = %8
%16 = load i8*, i8** %9
%17 = tail call i32 @Send(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %13, %6
ret void
}