#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 uint8_t;

/* Variables and functions */
int rand_uint32_range(int, int);
void __aosc_split_and_8(uint8_t *byte1, uint8_t *byte2) {
  if (rand_uint32_range(1, 255) <= 127) {
    *byte1 = 0x20 | rand_uint32_range(1, 0x1F);
    *byte2 = 0x40 | (rand_uint32_range(0, 0x1F) & ~*byte1);
  } else {
    *byte2 = 0x20 | rand_uint32_range(1, 0x1F);
    *byte1 = 0x40 | (rand_uint32_range(0, 0x1F) & ~*byte2);
  }
}


x86 assembly (clang, -O0):
<__aosc_split_and_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <rand_uint32_range@plt>
cmp    $0x7f,%eax
jg     1179 <__aosc_split_and_8+0x69>
mov    $0x1,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
mov    %eax,%ecx
or     $0x20,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %edi,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
or     $0x40,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    11b5 <__aosc_split_and_8+0xa5>
mov    $0x1,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
mov    %eax,%ecx
or     $0x20,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %edi,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
or     $0x40,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aosc_split_and_8>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <rand_uint32_range@plt>
mov    %eax,%ebp
mov    $0x1,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
or     $0x20,%eax
cmp    $0x80,%ebp
mov    %r14,%rbp
cmovl  %rbx,%rbp
cmovl  %r14,%rbx
mov    %eax,0x0(%rbp)
xor    %edi,%edi
mov    $0x1f,%esi
call   1030 <rand_uint32_range@plt>
mov    0x0(%rbp),%ecx
not    %ecx
and    %eax,%ecx
or     $0x40,%ecx
mov    %ecx,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @__aosc_split_and_8(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @rand_uint32_range(i32 1, i32 255)
%6 = icmp sle i32 %5, 127
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = call i32 @rand_uint32_range(i32 1, i32 31)
%9 = or i32 32, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = call i32 @rand_uint32_range(i32 0, i32 31)
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = xor i32 %13, -1
%15 = and i32 %11, %14
%16 = or i32 64, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
br label %29
18: ; preds = %2
%19 = call i32 @rand_uint32_range(i32 1, i32 31)
%20 = or i32 32, %19
%21 = load i32*, i32** %4
store i32 %20, i32* %21
%22 = call i32 @rand_uint32_range(i32 0, i32 31)
%23 = load i32*, i32** %4
%24 = load i32, i32* %23
%25 = xor i32 %24, -1
%26 = and i32 %22, %25
%27 = or i32 64, %26
%28 = load i32*, i32** %3
store i32 %27, i32* %28
br label %29
29: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
define void @__aosc_split_and_8(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @rand_uint32_range(i32 1, i32 255)
%4 = icmp slt i32 %3, 128
%5 = tail call i32 @rand_uint32_range(i32 1, i32 31)
%6 = or i32 %5, 32
%7 = select i1 %4, i32* %0, i32* %1
%8 = select i1 %4, i32* %1, i32* %0
store i32 %6, i32* %7
%9 = tail call i32 @rand_uint32_range(i32 0, i32 31)
%10 = load i32, i32* %7
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = or i32 %12, 64
store i32 %13, i32* %8
ret void
}