#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*/ clientcryptheader;

/* Variables and functions */
int hydra_send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int send_cstring(int s, char *crypted_string) {
  char buffer2[100], *bptr = buffer2;
  char clientcryptheader[] = "\x06";
  memset(buffer2, 0, sizeof(clientcryptheader));
  bptr = buffer2;
  buffer2[0] = 6;
  bptr++;
  buffer2[1] = strlen(crypted_string);
  bptr++;
  strcpy(bptr, crypted_string);
  return hydra_send(s, buffer2, 2 + strlen(crypted_string), 0);
}


x86 assembly (clang, -O0):
<send_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    0xe9c(%rip),%ax
mov    %ax,-0x8a(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <memset@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x88(%rbp)
movb   $0x6,-0x80(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %al,-0x7f(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x9c(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x9c(%rbp),%edi
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
add    $0x2,%edx
xor    %ecx,%ecx
call   1060 <hydra_send@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cstring>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <memset@plt>
movb   $0x6,(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %al,0x1(%rsp)
lea    0x2(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x2(%rax),%edx
mov    %ebp,%edi
mov    %r14,%rsi
xor    %ecx,%ecx
call   1060 <hydra_send@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.send_cstring.clientcryptheader = [2 x i8] c"\06\00"
define i32 @send_cstring(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i8]
%6 = alloca i8*
%7 = alloca [2 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8* %8, i8** %6
%9 = bitcast [2 x i8]* %7 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i32 0, i32 2)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8* %12, i8** %6
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8 6, i8* %13
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %6
%16 = load i8*, i8** %4
%17 = call i32 @strlen(i8* %16)
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 1
store i8 %18, i8* %19
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %22, i8* %23)
%25 = load i32, i32* %3
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%27 = load i8*, i8** %4
%28 = call i32 @strlen(i8* %27)
%29 = add nsw i32 2, %28
%30 = call i32 @hydra_send(i32 %25, i8* %26, i32 %29, i32 0)
ret i32 %30
}

LLVM IR (-O2):
define i32 @send_cstring(i32 %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 2)
store i8 6, i8* %4
%6 = call i32 @strlen(i8* %1)
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
%10 = call i32 @strcpy(i8* %9, i8* %1)
%11 = call i32 @strlen(i8* %1)
%12 = add nsw i32 %11, 2
%13 = call i32 @hydra_send(i32 %0, i8* %4, i32 %12, i32 0)
ret i32 %13
}