#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*/ xsubi;
typedef size_t uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char _po_int2char(unsigned char);
int /*<<< orphan*/ memcpy(unsigned short *, int /*<<< orphan*/ *, int);
size_t nrand48(unsigned short *);
int /*<<< orphan*/ poMurmurHash(char const *, int, int);
char *poRandSequence_string(const char *ibuf, char *buf, size_t *rlen,
                            size_t minLen, size_t maxLen) {
  ;
  ;
  uint32_t seed[2];
  unsigned short int xsubi[3];
  seed[0] = poMurmurHash(ibuf, 4, 0x324A5231);
  seed[1] = poMurmurHash(&ibuf[4], 4, 0xF3245233);
  memcpy(xsubi, seed, sizeof(xsubi));
  int len;
  char *ret;
  ret = buf;
  len = minLen + nrand48(xsubi) % (maxLen - minLen);
  if (rlen)
    *rlen = len;
  while (len) {
    int j = 0;
    uint64_t val;
    val = nrand48(xsubi);
    unsigned char *ptr;
    ptr = (unsigned char *)&val;
    while (len && j < 6) {
      *buf = _po_int2char((ptr[j / 2] >> (4 * (j % 2))) & 0x0F);
      ++buf;
      --len;
      ++j;
    }
  }
  *buf = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<poRandSequence_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x324a5231,%edx
call   1060 <poMurmurHash@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    $0x4,%esi
mov    $0xf3245233,%edx
call   1060 <poMurmurHash@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x36(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x6,%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x36(%rbp),%rdi
call   1030 <nrand48@plt>
mov    -0x28(%rbp),%rcx
sub    -0x20(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    -0x68(%rbp),%rax
add    %rdx,%rax
mov    %eax,-0x3c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11e7 <poRandSequence_string+0xa7>
movslq -0x3c(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    11ec <poRandSequence_string+0xac>
cmpl   $0x0,-0x3c(%rbp)
je     12ae <poRandSequence_string+0x16e>
movl   $0x0,-0x4c(%rbp)
lea    -0x36(%rbp),%rdi
call   1030 <nrand48@plt>
mov    %rax,-0x58(%rbp)
lea    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x3c(%rbp)
mov    %al,-0x69(%rbp)
je     122b <poRandSequence_string+0xeb>
cmpl   $0x6,-0x4c(%rbp)
setl   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    123b <poRandSequence_string+0xfb>
jmp    12a9 <poRandSequence_string+0x169>
mov    -0x60(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x70(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x70(%rbp),%eax
mov    %edx,%ecx
shl    $0x2,%ecx
sar    %cl,%eax
and    $0xf,%eax
movzbl %al,%edi
call   1040 <_po_int2char@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1212 <poRandSequence_string+0xd2>
jmp    11ec <poRandSequence_string+0xac>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poRandSequence_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r13
mov    %rcx,%r12
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    $0x4,%esi
mov    $0x324a5231,%edx
call   1060 <poMurmurHash@plt>
mov    %eax,0x8(%rsp)
add    $0x4,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xf3245233,%edx
call   1060 <poMurmurHash@plt>
mov    %eax,0xc(%rsp)
lea    0x12(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <nrand48@plt>
sub    %r12,%r13
mov    %rax,%rcx
or     %r13,%rcx
shr    $0x20,%rcx
je     11c2 <poRandSequence_string+0x82>
xor    %edx,%edx
div    %r13
mov    %rdx,%r13
jmp    11ca <poRandSequence_string+0x8a>
xor    %edx,%edx
div    %r13d
mov    %edx,%r13d
add    %r12,%r13
test   %r15,%r15
je     11d8 <poRandSequence_string+0x98>
movslq %r13d,%rax
mov    %rax,(%r15)
mov    %rbp,%rbx
test   %r13d,%r13d
je     125b <poRandSequence_string+0x11b>
mov    $0x5,%r12d
mov    %rbp,0x18(%rsp)
mov    %rbp,%rax
xchg   %ax,%ax
mov    %rax,%rbx
lea    0x12(%rsp),%rdi
call   1030 <nrand48@plt>
lea    -0x1(%r13),%r14d
cmp    $0x5,%r14d
cmovae %r12d,%r14d
mov    %rax,0x20(%rsp)
add    $0x1,%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%eax
shr    %rax
movzbl 0x20(%rsp,%rax,1),%edi
mov    %r15d,%ecx
and    $0x4,%cl
shr    %cl,%edi
and    $0xf,%edi
call   1040 <_po_int2char@plt>
mov    %al,(%rbx,%rbp,1)
add    $0x1,%rbp
add    $0x4,%r15d
cmp    %ebp,%r14d
jne    1220 <poRandSequence_string+0xe0>
lea    (%rbx,%rbp,1),%rax
sub    %ebp,%r13d
jne    11f0 <poRandSequence_string+0xb0>
add    %rbp,%rbx
mov    0x18(%rsp),%rbp
movb   $0x0,(%rbx)
mov    %rbp,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @poRandSequence_string(i8* %0, i8* %1, i64* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i64
%11 = alloca [2 x i32]
%12 = alloca [3 x i16]
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i64
%17 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64* %2, i64** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%18 = load i8*, i8** %6
%19 = call i32 @poMurmurHash(i8* %18, i32 4, i32 843731505)
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
store i32 %19, i32* %20
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i64 4
%23 = call i32 @poMurmurHash(i8* %22, i32 4, i32 -215723469)
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
store i32 %23, i32* %24
%25 = getelementptr inbounds [3 x i16], [3 x i16]* %12, i64 0, i64 0
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%27 = call i32 @memcpy(i16* %25, i32* %26, i32 6)
%28 = load i8*, i8** %7
store i8* %28, i8** %14
%29 = load i64, i64* %9
%30 = getelementptr inbounds [3 x i16], [3 x i16]* %12, i64 0, i64 0
%31 = call i64 @nrand48(i16* %30)
%32 = load i64, i64* %10
%33 = load i64, i64* %9
%34 = sub i64 %32, %33
%35 = urem i64 %31, %34
%36 = add i64 %29, %35
%37 = trunc i64 %36 to i32
store i32 %37, i32* %13
%38 = load i64*, i64** %8
%39 = icmp ne i64* %38, null
br i1 %39, label %40, label %44
40: ; preds = %5
%41 = load i32, i32* %13
%42 = sext i32 %41 to i64
%43 = load i64*, i64** %8
store i64 %42, i64* %43
br label %44
44: ; preds = %40, %5
br label %45
45: ; preds = %82, %44
%46 = load i32, i32* %13
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %83
48: ; preds = %45
store i32 0, i32* %15
%49 = getelementptr inbounds [3 x i16], [3 x i16]* %12, i64 0, i64 0
%50 = call i64 @nrand48(i16* %49)
store i64 %50, i64* %16
%51 = bitcast i64* %16 to i8*
store i8* %51, i8** %17
br label %52
52: ; preds = %60, %48
%53 = load i32, i32* %13
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %52
%56 = load i32, i32* %15
%57 = icmp slt i32 %56, 6
br label %58
58: ; preds = %55, %52
%59 = phi i1 [ false, %52 ], [ %57, %55 ]
br i1 %59, label %60, label %82
60: ; preds = %58
%61 = load i8*, i8** %17
%62 = load i32, i32* %15
%63 = sdiv i32 %62, 2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %61, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = load i32, i32* %15
%69 = srem i32 %68, 2
%70 = mul nsw i32 4, %69
%71 = ashr i32 %67, %70
%72 = and i32 %71, 15
%73 = trunc i32 %72 to i8
%74 = call signext i8 @_po_int2char(i8 zeroext %73)
%75 = load i8*, i8** %7
store i8 %74, i8* %75
%76 = load i8*, i8** %7
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %7
%78 = load i32, i32* %13
%79 = add nsw i32 %78, -1
store i32 %79, i32* %13
%80 = load i32, i32* %15
%81 = add nsw i32 %80, 1
store i32 %81, i32* %15
br label %52
82: ; preds = %58
br label %45
83: ; preds = %45
%84 = load i8*, i8** %7
store i8 0, i8* %84
%85 = load i8*, i8** %14
ret i8* %85
}

LLVM IR (-O2):
define i8* @poRandSequence_string(i8* %0, i8* returned writeonly %1, i64* writeonly %2, i64 %3, i64 %4) {
%6 = alloca [2 x i32]
%7 = alloca [3 x i16]
%8 = alloca i64
%9 = bitcast [2 x i32]* %6 to i8*
%10 = bitcast [3 x i16]* %7 to i8*
%11 = tail call i32 @poMurmurHash(i8* %0, i32 4, i32 843731505)
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %11, i32* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = tail call i32 @poMurmurHash(i8* %13, i32 4, i32 -215723469)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %14, i32* %15
%16 = getelementptr inbounds [3 x i16], [3 x i16]* %7, i64 0, i64 0
%17 = call i32 @memcpy(i16* %16, i32* %12, i32 6)
%18 = call i64 @nrand48(i16* %16)
%19 = sub i64 %4, %3
%20 = urem i64 %18, %19
%21 = add i64 %20, %3
%22 = trunc i64 %21 to i32
%23 = icmp eq i64* %2, null
br i1 %23, label %27, label %24
24: ; preds = %5
%25 = shl i64 %21, 32
%26 = ashr exact i64 %25, 32
store i64 %26, i64* %2
br label %27
27: ; preds = %24, %5
%28 = icmp eq i32 %22, 0
br i1 %28, label %58, label %29
29: ; preds = %27
%30 = bitcast i64* %8 to i8*
br label %31
31: ; preds = %29, %56
%32 = phi i8* [ %1, %29 ], [ %52, %56 ]
%33 = phi i32 [ %22, %29 ], [ %53, %56 ]
%34 = call i64 @nrand48(i16* %16)
store i64 %34, i64* %8
%35 = add i32 %33, -1
%36 = call i32 @llvm.umin.i32(i32 %35, i32 5)
br label %37
37: ; preds = %31, %37
%38 = phi i8* [ %32, %31 ], [ %52, %37 ]
%39 = phi i32 [ 0, %31 ], [ %54, %37 ]
%40 = phi i32 [ %33, %31 ], [ %53, %37 ]
%41 = lshr i32 %39, 1
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %30, i64 %42
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = shl nuw nsw i32 %39, 2
%47 = and i32 %46, 4
%48 = lshr i32 %45, %47
%49 = trunc i32 %48 to i8
%50 = and i8 %49, 15
%51 = call signext i8 @_po_int2char(i8 zeroext %50)
store i8 %51, i8* %38
%52 = getelementptr inbounds i8, i8* %38, i64 1
%53 = add nsw i32 %40, -1
%54 = add nuw nsw i32 %39, 1
%55 = icmp eq i32 %39, %36
br i1 %55, label %56, label %37
56: ; preds = %37
%57 = icmp eq i32 %53, 0
br i1 %57, label %58, label %31
58: ; preds = %56, %27
%59 = phi i8* [ %1, %27 ], [ %52, %56 ]
store i8 0, i8* %59
ret i8* %1
}