#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 */
unsigned char *medusaReceiveDataInternal(int, int *, int /*<<< orphan*/, int,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ writeError(int, char *);
int medusaReceiveRegex(int hSocket, unsigned char **szBufReceive,
                       int *nBufReceive, const char *regex) {
  writeError(3, "Medusa compiled without PCRE support. Data receiving may be "
                "less reliable.");
  *szBufReceive =
      medusaReceiveDataInternal(hSocket, nBufReceive, 0, 20 * 1000000, 0);
  if (*szBufReceive == NULL)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<medusaReceiveRegex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x3,%edi
lea    0xebd(%rip),%rsi
call   1040 <writeError@plt>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
xor    %r8d,%r8d
mov    $0x1312d00,%ecx
mov    %r8d,%edx
call   1030 <medusaReceiveDataInternal@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1183 <medusaReceiveRegex+0x63>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <medusaReceiveRegex+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medusaReceiveRegex>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
mov    $0x3,%edi
call   1040 <writeError@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %edx,%edx
mov    $0x1312d00,%ecx
xor    %r8d,%r8d
call   1030 <medusaReceiveDataInternal@plt>
mov    %rax,(%r14)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [75 x i8] c"Medusa compiled without PCRE support. Data receiving may be less reliable.\00"
define i32 @medusaReceiveRegex(i32 %0, i8** %1, i32* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i8*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
%10 = call i32 @writeError(i32 3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %6
%12 = load i32*, i32** %8
%13 = call i8* @medusaReceiveDataInternal(i32 %11, i32* %12, i32 0, i32 20000000, i32 0)
%14 = load i8**, i8*** %7
store i8* %13, i8** %14
%15 = load i8**, i8*** %7
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %19
18: ; preds = %4
store i32 -1, i32* %5
br label %20
19: ; preds = %4
store i32 0, i32* %5
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [75 x i8] c"Medusa compiled without PCRE support. Data receiving may be less reliable.\00"
define i32 @medusaReceiveRegex(i32 %0, i8** nocapture writeonly %1, i32* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @writeError(i32 3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @medusaReceiveDataInternal(i32 %0, i32* %2, i32 0, i32 20000000, i32 0)
store i8* %6, i8** %1
%7 = icmp eq i8* %6, null
%8 = sext i1 %7 to i32
ret i32 %8
}