#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ send(int, char *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
scalar_t__ strlen(char *);
void sender(int sock, char *message) {
  do {
    printf("enter your word\n<you>:");
    fflush(stdout);
    scanf("%s", message);
    send(sock, message, strlen(message) + 1, 0);
    recv(sock, message, 2, 0);
    switch (message[0]) {
    case 'u':
      puts("Word already used");
      break;
    case 'z':
      puts("Not a word");
      break;
    case 'l':
      puts("R u a retard?");
      break;
    }
  } while (message[0] != 'w');
}


x86 assembly (clang, -O0):
<sender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe7a(%rip),%rdi
call   1070 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1090 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
call   1050 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
mov    %ecx,-0x18(%rbp)
call   1060 <send@plt>
mov    -0x18(%rbp),%ecx
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <recv@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x6c,%eax
je     1244 <sender+0xd4>
jmp    1200 <sender+0x90>
mov    -0x14(%rbp),%eax
sub    $0x75,%eax
je     1222 <sender+0xb2>
jmp    1211 <sender+0xa1>
mov    -0x14(%rbp),%eax
sub    $0x7a,%eax
je     1233 <sender+0xc3>
jmp    1250 <sender+0xe0>
lea    0xdf1(%rip),%rdi
call   1040 <puts@plt>
jmp    1250 <sender+0xe0>
lea    0xdf2(%rip),%rdi
call   1040 <puts@plt>
jmp    1250 <sender+0xe0>
lea    0xdec(%rip),%rdi
call   1040 <puts@plt>
jmp    1255 <sender+0xe5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x77,%eax
jne    117f <sender+0xf>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sender>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe79(%rip),%r14
mov    0x2e52(%rip),%r12
lea    0xe82(%rip),%r15
lea    0xe7e(%rip),%r13
jmp    11b3 <sender+0x43>
xchg   %ax,%ax
lea    0xe90(%rip),%rdi
call   1040 <puts@plt>
movzbl (%rbx),%eax
cmp    $0x77,%al
je     1219 <sender+0xa9>
mov    %r14,%rdi
call   1070 <printf@plt>
mov    (%r12),%edi
call   1080 <fflush@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
movzbl (%rbx),%eax
movsbl %al,%ecx
cmp    $0x6c,%ecx
je     11a0 <sender+0x30>
mov    %r13,%rdi
cmp    $0x75,%ecx
je     11a7 <sender+0x37>
cmp    $0x7a,%ecx
jne    11af <sender+0x3f>
lea    0xe15(%rip),%rdi
jmp    11a7 <sender+0x37>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"enter your word\0A<you>:\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"Word already used\00"
@.str.3 = [11 x i8] c"Not a word\00"
@.str.4 = [14 x i8] c"R u a retard?\00"
define void @sender(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %5
5: ; preds = %31, %2
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @send(i32 %11, i8* %12, i64 %15, i32 0)
%17 = load i32, i32* %3
%18 = load i8*, i8** %4
%19 = call i32 @recv(i32 %17, i8* %18, i32 2, i32 0)
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
switch i32 %23, label %30 [
i32 117, label %24
i32 122, label %26
i32 108, label %28
]
24: ; preds = %5
%25 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %30
26: ; preds = %5
%27 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %30
28: ; preds = %5
%29 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %5, %28, %26, %24
br label %31
31: ; preds = %30
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 119
br i1 %36, label %5, label %37
37: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"enter your word\0A<you>:\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"Word already used\00"
@.str.3 = [11 x i8] c"Not a word\00"
@.str.4 = [14 x i8] c"R u a retard?\00"
define void @sender(i32 %0, i8* %1) {
br label %3
3: ; preds = %20, %2
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%9 = add nsw i64 %8, 1
%10 = tail call i32 @send(i32 %0, i8* %1, i64 %9, i32 0)
%11 = tail call i32 @recv(i32 %0, i8* %1, i32 2, i32 0)
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
switch i32 %13, label %20 [
i32 117, label %16
i32 122, label %14
i32 108, label %15
]
14: ; preds = %3
br label %16
15: ; preds = %3
br label %16
16: ; preds = %3, %15, %14
%17 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), %15 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %14 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), %3 ]
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
%19 = load i8, i8* %1
br label %20
20: ; preds = %16, %3
%21 = phi i8 [ %19, %16 ], [ %12, %3 ]
%22 = icmp eq i8 %21, 119
br i1 %22, label %23, label %3
23: ; preds = %20
ret void
}