unsigned char debugmalloc_random() {
  static unsigned int seed_1 = 0x00, seed_2 = 0x1e;
  unsigned int temp_1, temp_2;
  unsigned int carry, result;
  temp_1 = (seed_1 & 0x0001) << 7;
  temp_2 = (seed_2 >> 1) & 0x007F;
  result = (seed_2) + ((seed_2 & 0x0001) << 7);
  carry = (result >> 8);
  result = result & 0x00FF;
  result = result + carry + 0x13;
  carry = (result >> 8);
  seed_2 = result & 0x00FF;
  result = seed_1 + carry + temp_1;
  carry = (result >> 8);
  result = result & 0x00FF;
  result = result + carry + temp_2;
  seed_1 = result & 0x00FF;
  return seed_1;
}


x86 assembly (clang, -O0):
<debugmalloc_random>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
and    $0x1,%eax
shl    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    0x2f07(%rip),%eax
shr    $0x1,%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    0x2ef8(%rip),%eax
mov    0x2ef2(%rip),%ecx
and    $0x1,%ecx
shl    $0x7,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x13,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,0x2eb0(%rip)
mov    0x2eb2(%rip),%eax
add    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,0x2e7b(%rip)
mov    0x2e75(%rip),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugmalloc_random>:
mov    0x2f22(%rip),%ecx
mov    %ecx,%eax
shl    $0x7,%eax
movzbl %al,%eax
mov    0x2f0c(%rip),%edx
mov    %edx,%esi
shl    $0x7,%esi
movzbl %sil,%esi
add    %edx,%esi
shr    %edx
and    $0x7f,%edx
movzbl %sil,%edi
shr    $0x8,%esi
add    %edi,%esi
add    $0x13,%esi
movzbl %sil,%edi
shr    $0x8,%esi
mov    %edi,0x2ee3(%rip)
add    %ecx,%eax
add    %esi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %edx,%eax
add    %ecx,%eax
movzbl %al,%eax
mov    %eax,0x2ed5(%rip)
ret

LLVM IR (-O0):
@debugmalloc_random.seed_1 = internal global i32 0
@debugmalloc_random.seed_2 = internal global i32 30
define zeroext i8 @debugmalloc_random() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* @debugmalloc_random.seed_1
%6 = and i32 %5, 1
%7 = shl i32 %6, 7
store i32 %7, i32* %1
%8 = load i32, i32* @debugmalloc_random.seed_2
%9 = lshr i32 %8, 1
%10 = and i32 %9, 127
store i32 %10, i32* %2
%11 = load i32, i32* @debugmalloc_random.seed_2
%12 = load i32, i32* @debugmalloc_random.seed_2
%13 = and i32 %12, 1
%14 = shl i32 %13, 7
%15 = add i32 %11, %14
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = lshr i32 %16, 8
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = and i32 %18, 255
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = add i32 %20, %21
%23 = add i32 %22, 19
store i32 %23, i32* %4
%24 = load i32, i32* %4
%25 = lshr i32 %24, 8
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = and i32 %26, 255
store i32 %27, i32* @debugmalloc_random.seed_2
%28 = load i32, i32* @debugmalloc_random.seed_1
%29 = load i32, i32* %3
%30 = add i32 %28, %29
%31 = load i32, i32* %1
%32 = add i32 %30, %31
store i32 %32, i32* %4
%33 = load i32, i32* %4
%34 = lshr i32 %33, 8
store i32 %34, i32* %3
%35 = load i32, i32* %4
%36 = and i32 %35, 255
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = load i32, i32* %3
%39 = add i32 %37, %38
%40 = load i32, i32* %2
%41 = add i32 %39, %40
store i32 %41, i32* %4
%42 = load i32, i32* %4
%43 = and i32 %42, 255
store i32 %43, i32* @debugmalloc_random.seed_1
%44 = load i32, i32* @debugmalloc_random.seed_1
%45 = trunc i32 %44 to i8
ret i8 %45
}

LLVM IR (-O2):
@debugmalloc_random.seed_1 = internal unnamed_addr global i32 0
@debugmalloc_random.seed_2 = internal unnamed_addr global i32 30
define zeroext i8 @debugmalloc_random() {
%1 = load i32, i32* @debugmalloc_random.seed_1
%2 = shl i32 %1, 7
%3 = and i32 %2, 128
%4 = load i32, i32* @debugmalloc_random.seed_2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 127
%7 = shl i32 %4, 7
%8 = and i32 %7, 128
%9 = add i32 %8, %4
%10 = lshr i32 %9, 8
%11 = and i32 %9, 255
%12 = add nuw nsw i32 %10, 19
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 8
%15 = and i32 %13, 255
store i32 %15, i32* @debugmalloc_random.seed_2
%16 = add i32 %3, %1
%17 = add i32 %16, %14
%18 = lshr i32 %17, 8
%19 = add i32 %17, %6
%20 = add i32 %19, %18
%21 = and i32 %20, 255
store i32 %21, i32* @debugmalloc_random.seed_1
%22 = trunc i32 %20 to i8
ret i8 %22
}