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

/* Variables and functions */
int bpf_rand_u16(int);
int bpf_rand_u24(int);
int bpf_rand_u32(int);
int bpf_rand_u40(int);
int bpf_rand_u48(int);
int bpf_rand_u56(int);
int bpf_rand_u64(int);
int bpf_rand_u8(int);
int rand();
uint64_t bpf_semi_rand_get(void) {
  switch (rand() % 39) {
  case 0:
    return 0x000000ff00000000ULL | bpf_rand_u8(0);
  case 1:
    return 0xffffffff00000000ULL | bpf_rand_u16(0);
  case 2:
    return 0x00000000ffff0000ULL | bpf_rand_u16(0);
  case 3:
    return 0x8000000000000000ULL | bpf_rand_u32(0);
  case 4:
    return 0x00000000f0000000ULL | bpf_rand_u32(0);
  case 5:
    return 0x0000000100000000ULL | bpf_rand_u24(0);
  case 6:
    return 0x800ff00000000000ULL | bpf_rand_u32(0);
  case 7:
    return 0x7fffffff00000000ULL | bpf_rand_u32(0);
  case 8:
    return 0xffffffffffffff00ULL ^ bpf_rand_u32(24);
  case 9:
    return 0xffffffffffffff00ULL | bpf_rand_u8(0);
  case 10:
    return 0x0000000010000000ULL | bpf_rand_u32(0);
  case 11:
    return 0xf000000000000000ULL | bpf_rand_u8(0);
  case 12:
    return 0x0000f00000000000ULL | bpf_rand_u8(8);
  case 13:
    return 0x000000000f000000ULL | bpf_rand_u8(16);
  case 14:
    return 0x0000000000000f00ULL | bpf_rand_u8(32);
  case 15:
    return 0x00fff00000000f00ULL | bpf_rand_u8(48);
  case 16:
    return 0x00007fffffffffffULL ^ bpf_rand_u32(1);
  case 17:
    return 0xffff800000000000ULL | bpf_rand_u8(4);
  case 18:
    return 0xffff800000000000ULL | bpf_rand_u8(20);
  case 19:
    return (0xffffffc000000000ULL + 0x80000ULL) | bpf_rand_u32(0);
  case 20:
    return (0xffffffc000000000ULL - 0x04000000ULL) | bpf_rand_u32(0);
  case 21:
    return 0x0000000000000000ULL | bpf_rand_u8(55) | bpf_rand_u32(20);
  case 22:
    return 0xffffffffffffffffULL ^ bpf_rand_u8(3) ^ bpf_rand_u32(40);
  case 23:
    return 0x0000000000000000ULL | bpf_rand_u8(bpf_rand_u8(0) % 64);
  case 24:
    return 0x0000000000000000ULL | bpf_rand_u16(bpf_rand_u8(0) % 64);
  case 25:
    return 0xffffffffffffffffULL ^ bpf_rand_u8(bpf_rand_u8(0) % 64);
  case 26:
    return 0xffffffffffffffffULL ^ bpf_rand_u40(bpf_rand_u8(0) % 64);
  case 27:
    return 0x0000800000000000ULL;
  case 28:
    return 0x8000000000000000ULL;
  case 29:
    return 0x0000000000000000ULL;
  case 30:
    return 0xffffffffffffffffULL;
  case 31:
    return bpf_rand_u16(bpf_rand_u8(0) % 64);
  case 32:
    return bpf_rand_u24(bpf_rand_u8(0) % 64);
  case 33:
    return bpf_rand_u32(bpf_rand_u8(0) % 64);
  case 34:
    return bpf_rand_u40(bpf_rand_u8(0) % 64);
  case 35:
    return bpf_rand_u48(bpf_rand_u8(0) % 64);
  case 36:
    return bpf_rand_u56(bpf_rand_u8(0) % 64);
  case 37:
    return bpf_rand_u64(bpf_rand_u8(0) % 64);
  default:
    return bpf_rand_u64(0);
  }
}


x86 assembly (clang, -O0):
<bpf_semi_rand_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffffd20d20d3,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x27,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x25,%eax
ja     1642 <bpf_semi_rand_get+0x4b2>
mov    -0x10(%rbp),%rax
lea    0xe28(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xff00000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1080 <bpf_rand_u16@plt>
cltq
movabs $0xffffffff00000000,%rcx
ff ff ff
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1080 <bpf_rand_u16@plt>
cltq
movabs $0xffff0000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0x8000000000000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0xf0000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1030 <bpf_rand_u24@plt>
cltq
movabs $0x100000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0x800ff00000000000,%rcx
f0 0f 80
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0x7fffffff00000000,%rcx
ff ff 7f
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x18,%edi
call   1060 <bpf_rand_u32@plt>
cltq
xor    $0xffffffffffffff00,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
cltq
or     $0xffffffffffffff00,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
or     $0x10000000,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xf000000000000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x8,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xf00000000000,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x10,%edi
call   1050 <bpf_rand_u8@plt>
cltq
or     $0xf000000,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x20,%edi
call   1050 <bpf_rand_u8@plt>
cltq
or     $0xf00,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x30,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xfff00000000f00,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x1,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0x7fffffffffff,%rcx
xor    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x4,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xffff800000000000,%rcx
80 ff ff
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x14,%edi
call   1050 <bpf_rand_u8@plt>
cltq
movabs $0xffff800000000000,%rcx
80 ff ff
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0xffffffc000080000,%rcx
ff ff ff
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
cltq
movabs $0xffffffbffc000000,%rcx
ff ff ff
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x37,%edi
call   1050 <bpf_rand_u8@plt>
cltq
or     $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    $0x14,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
mov    $0x3,%edi
call   1050 <bpf_rand_u8@plt>
cltq
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    $0x28,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
xor    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1050 <bpf_rand_u8@plt>
cltq
or     $0x0,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1080 <bpf_rand_u16@plt>
cltq
or     $0x0,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1050 <bpf_rand_u8@plt>
cltq
xor    $0xffffffffffffffff,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <bpf_rand_u40@plt>
cltq
xor    $0xffffffffffffffff,%rax
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
movl   $0x0,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
movl   $0x0,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
movl   $0x0,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
movl   $0xffffffff,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1080 <bpf_rand_u16@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <bpf_rand_u24@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <bpf_rand_u40@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   10a0 <bpf_rand_u48@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1070 <bpf_rand_u56@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1090 <bpf_rand_u64@plt>
mov    %eax,-0x4(%rbp)
jmp    164c <bpf_semi_rand_get+0x4bc>
xor    %edi,%edi
call   1090 <bpf_rand_u64@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_semi_rand_get>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   10b0 <rand@plt>
cltq
imul   $0xffffffffd20d20d3,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x27,%ecx,%ecx
sub    %ecx,%eax
cmp    $0x25,%eax
ja     11f5 <bpf_semi_rand_get+0x65>
lea    0xe3a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
jmp    13df <bpf_semi_rand_get+0x24f>
xor    %edi,%edi
jmp    1351 <bpf_semi_rand_get+0x1c1>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
jmp    11fe <bpf_semi_rand_get+0x6e>
xor    %edi,%edi
jmp    1463 <bpf_semi_rand_get+0x2d3>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <bpf_rand_u16@plt>
xor    %edi,%edi
call   1080 <bpf_rand_u16@plt>
mov    %eax,%ebx
or     $0xffff0000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
or     $0xf0000000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
jmp    13be <bpf_semi_rand_get+0x22e>
mov    $0x18,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
xor    $0xffffff00,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
mov    %eax,%ebx
or     $0xffffff00,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
or     $0x10000000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0x8,%edi
jmp    1351 <bpf_semi_rand_get+0x1c1>
mov    $0x10,%edi
call   1050 <bpf_rand_u8@plt>
mov    %eax,%ebx
or     $0xf000000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0x20,%edi
jmp    12a4 <bpf_semi_rand_get+0x114>
mov    $0x30,%edi
call   1050 <bpf_rand_u8@plt>
mov    %eax,%ebx
or     $0xf00,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0x1,%edi
call   1060 <bpf_rand_u32@plt>
jmp    1394 <bpf_semi_rand_get+0x204>
mov    $0x4,%edi
jmp    1351 <bpf_semi_rand_get+0x1c1>
mov    $0x14,%edi
jmp    1351 <bpf_semi_rand_get+0x1c1>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
or     $0x80000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
or     $0xfc000000,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0x37,%edi
call   1050 <bpf_rand_u8@plt>
mov    %eax,%ebp
mov    $0x14,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
or     %ebp,%ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0x3,%edi
call   1050 <bpf_rand_u8@plt>
mov    %eax,%ebp
mov    $0x28,%edi
call   1060 <bpf_rand_u32@plt>
mov    %eax,%ebx
xor    %ebp,%ebx
not    %ebx
jmp    139f <bpf_semi_rand_get+0x20f>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <bpf_rand_u8@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1050 <bpf_rand_u8@plt>
jmp    1394 <bpf_semi_rand_get+0x204>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1040 <bpf_rand_u40@plt>
mov    %eax,%ebx
not    %ebx
jmp    139f <bpf_semi_rand_get+0x20f>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <bpf_rand_u24@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <bpf_rand_u32@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bpf_rand_u40@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    10a0 <bpf_rand_u48@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <bpf_rand_u56@plt>
xor    %edi,%edi
call   1050 <bpf_rand_u8@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1090 <bpf_rand_u64@plt>

LLVM IR (-O0):
define i32 @bpf_semi_rand_get() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 39
switch i32 %3, label %185 [
i32 0, label %4
i32 1, label %9
i32 2, label %14
i32 3, label %19
i32 4, label %24
i32 5, label %29
i32 6, label %34
i32 7, label %39
i32 8, label %44
i32 9, label %49
i32 10, label %54
i32 11, label %59
i32 12, label %64
i32 13, label %69
i32 14, label %74
i32 15, label %79
i32 16, label %84
i32 17, label %89
i32 18, label %94
i32 19, label %99
i32 20, label %104
i32 21, label %109
i32 22, label %117
i32 23, label %125
i32 24, label %132
i32 25, label %139
i32 26, label %146
i32 27, label %153
i32 28, label %154
i32 29, label %155
i32 30, label %156
i32 31, label %157
i32 32, label %161
i32 33, label %165
i32 34, label %169
i32 35, label %173
i32 36, label %177
i32 37, label %181
]
4: ; preds = %0
%5 = call i32 @bpf_rand_u8(i32 0)
%6 = sext i32 %5 to i64
%7 = or i64 1095216660480, %6
%8 = trunc i64 %7 to i32
store i32 %8, i32* %1
br label %187
9: ; preds = %0
%10 = call i32 @bpf_rand_u16(i32 0)
%11 = sext i32 %10 to i64
%12 = or i64 -4294967296, %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %1
br label %187
14: ; preds = %0
%15 = call i32 @bpf_rand_u16(i32 0)
%16 = sext i32 %15 to i64
%17 = or i64 4294901760, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %1
br label %187
19: ; preds = %0
%20 = call i32 @bpf_rand_u32(i32 0)
%21 = sext i32 %20 to i64
%22 = or i64 -9223372036854775808, %21
%23 = trunc i64 %22 to i32
store i32 %23, i32* %1
br label %187
24: ; preds = %0
%25 = call i32 @bpf_rand_u32(i32 0)
%26 = sext i32 %25 to i64
%27 = or i64 4026531840, %26
%28 = trunc i64 %27 to i32
store i32 %28, i32* %1
br label %187
29: ; preds = %0
%30 = call i32 @bpf_rand_u24(i32 0)
%31 = sext i32 %30 to i64
%32 = or i64 4294967296, %31
%33 = trunc i64 %32 to i32
store i32 %33, i32* %1
br label %187
34: ; preds = %0
%35 = call i32 @bpf_rand_u32(i32 0)
%36 = sext i32 %35 to i64
%37 = or i64 -9218886029413449728, %36
%38 = trunc i64 %37 to i32
store i32 %38, i32* %1
br label %187
39: ; preds = %0
%40 = call i32 @bpf_rand_u32(i32 0)
%41 = sext i32 %40 to i64
%42 = or i64 9223372032559808512, %41
%43 = trunc i64 %42 to i32
store i32 %43, i32* %1
br label %187
44: ; preds = %0
%45 = call i32 @bpf_rand_u32(i32 24)
%46 = sext i32 %45 to i64
%47 = xor i64 -256, %46
%48 = trunc i64 %47 to i32
store i32 %48, i32* %1
br label %187
49: ; preds = %0
%50 = call i32 @bpf_rand_u8(i32 0)
%51 = sext i32 %50 to i64
%52 = or i64 -256, %51
%53 = trunc i64 %52 to i32
store i32 %53, i32* %1
br label %187
54: ; preds = %0
%55 = call i32 @bpf_rand_u32(i32 0)
%56 = sext i32 %55 to i64
%57 = or i64 268435456, %56
%58 = trunc i64 %57 to i32
store i32 %58, i32* %1
br label %187
59: ; preds = %0
%60 = call i32 @bpf_rand_u8(i32 0)
%61 = sext i32 %60 to i64
%62 = or i64 -1152921504606846976, %61
%63 = trunc i64 %62 to i32
store i32 %63, i32* %1
br label %187
64: ; preds = %0
%65 = call i32 @bpf_rand_u8(i32 8)
%66 = sext i32 %65 to i64
%67 = or i64 263882790666240, %66
%68 = trunc i64 %67 to i32
store i32 %68, i32* %1
br label %187
69: ; preds = %0
%70 = call i32 @bpf_rand_u8(i32 16)
%71 = sext i32 %70 to i64
%72 = or i64 251658240, %71
%73 = trunc i64 %72 to i32
store i32 %73, i32* %1
br label %187
74: ; preds = %0
%75 = call i32 @bpf_rand_u8(i32 32)
%76 = sext i32 %75 to i64
%77 = or i64 3840, %76
%78 = trunc i64 %77 to i32
store i32 %78, i32* %1
br label %187
79: ; preds = %0
%80 = call i32 @bpf_rand_u8(i32 48)
%81 = sext i32 %80 to i64
%82 = or i64 72040001851887360, %81
%83 = trunc i64 %82 to i32
store i32 %83, i32* %1
br label %187
84: ; preds = %0
%85 = call i32 @bpf_rand_u32(i32 1)
%86 = sext i32 %85 to i64
%87 = xor i64 140737488355327, %86
%88 = trunc i64 %87 to i32
store i32 %88, i32* %1
br label %187
89: ; preds = %0
%90 = call i32 @bpf_rand_u8(i32 4)
%91 = sext i32 %90 to i64
%92 = or i64 -140737488355328, %91
%93 = trunc i64 %92 to i32
store i32 %93, i32* %1
br label %187
94: ; preds = %0
%95 = call i32 @bpf_rand_u8(i32 20)
%96 = sext i32 %95 to i64
%97 = or i64 -140737488355328, %96
%98 = trunc i64 %97 to i32
store i32 %98, i32* %1
br label %187
99: ; preds = %0
%100 = call i32 @bpf_rand_u32(i32 0)
%101 = sext i32 %100 to i64
%102 = or i64 -274877382656, %101
%103 = trunc i64 %102 to i32
store i32 %103, i32* %1
br label %187
104: ; preds = %0
%105 = call i32 @bpf_rand_u32(i32 0)
%106 = sext i32 %105 to i64
%107 = or i64 -274945015808, %106
%108 = trunc i64 %107 to i32
store i32 %108, i32* %1
br label %187
109: ; preds = %0
%110 = call i32 @bpf_rand_u8(i32 55)
%111 = sext i32 %110 to i64
%112 = or i64 0, %111
%113 = call i32 @bpf_rand_u32(i32 20)
%114 = sext i32 %113 to i64
%115 = or i64 %112, %114
%116 = trunc i64 %115 to i32
store i32 %116, i32* %1
br label %187
117: ; preds = %0
%118 = call i32 @bpf_rand_u8(i32 3)
%119 = sext i32 %118 to i64
%120 = xor i64 -1, %119
%121 = call i32 @bpf_rand_u32(i32 40)
%122 = sext i32 %121 to i64
%123 = xor i64 %120, %122
%124 = trunc i64 %123 to i32
store i32 %124, i32* %1
br label %187
125: ; preds = %0
%126 = call i32 @bpf_rand_u8(i32 0)
%127 = srem i32 %126, 64
%128 = call i32 @bpf_rand_u8(i32 %127)
%129 = sext i32 %128 to i64
%130 = or i64 0, %129
%131 = trunc i64 %130 to i32
store i32 %131, i32* %1
br label %187
132: ; preds = %0
%133 = call i32 @bpf_rand_u8(i32 0)
%134 = srem i32 %133, 64
%135 = call i32 @bpf_rand_u16(i32 %134)
%136 = sext i32 %135 to i64
%137 = or i64 0, %136
%138 = trunc i64 %137 to i32
store i32 %138, i32* %1
br label %187
139: ; preds = %0
%140 = call i32 @bpf_rand_u8(i32 0)
%141 = srem i32 %140, 64
%142 = call i32 @bpf_rand_u8(i32 %141)
%143 = sext i32 %142 to i64
%144 = xor i64 -1, %143
%145 = trunc i64 %144 to i32
store i32 %145, i32* %1
br label %187
146: ; preds = %0
%147 = call i32 @bpf_rand_u8(i32 0)
%148 = srem i32 %147, 64
%149 = call i32 @bpf_rand_u40(i32 %148)
%150 = sext i32 %149 to i64
%151 = xor i64 -1, %150
%152 = trunc i64 %151 to i32
store i32 %152, i32* %1
br label %187
153: ; preds = %0
store i32 0, i32* %1
br label %187
154: ; preds = %0
store i32 0, i32* %1
br label %187
155: ; preds = %0
store i32 0, i32* %1
br label %187
156: ; preds = %0
store i32 -1, i32* %1
br label %187
157: ; preds = %0
%158 = call i32 @bpf_rand_u8(i32 0)
%159 = srem i32 %158, 64
%160 = call i32 @bpf_rand_u16(i32 %159)
store i32 %160, i32* %1
br label %187
161: ; preds = %0
%162 = call i32 @bpf_rand_u8(i32 0)
%163 = srem i32 %162, 64
%164 = call i32 @bpf_rand_u24(i32 %163)
store i32 %164, i32* %1
br label %187
165: ; preds = %0
%166 = call i32 @bpf_rand_u8(i32 0)
%167 = srem i32 %166, 64
%168 = call i32 @bpf_rand_u32(i32 %167)
store i32 %168, i32* %1
br label %187
169: ; preds = %0
%170 = call i32 @bpf_rand_u8(i32 0)
%171 = srem i32 %170, 64
%172 = call i32 @bpf_rand_u40(i32 %171)
store i32 %172, i32* %1
br label %187
173: ; preds = %0
%174 = call i32 @bpf_rand_u8(i32 0)
%175 = srem i32 %174, 64
%176 = call i32 @bpf_rand_u48(i32 %175)
store i32 %176, i32* %1
br label %187
177: ; preds = %0
%178 = call i32 @bpf_rand_u8(i32 0)
%179 = srem i32 %178, 64
%180 = call i32 @bpf_rand_u56(i32 %179)
store i32 %180, i32* %1
br label %187
181: ; preds = %0
%182 = call i32 @bpf_rand_u8(i32 0)
%183 = srem i32 %182, 64
%184 = call i32 @bpf_rand_u64(i32 %183)
store i32 %184, i32* %1
br label %187
185: ; preds = %0
%186 = call i32 @bpf_rand_u64(i32 0)
store i32 %186, i32* %1
br label %187
187: ; preds = %185, %181, %177, %173, %169, %165, %161, %157, %156, %155, %154, %153, %146, %139, %132, %125, %117, %109, %104, %99, %94, %89, %84, %79, %74, %69, %64, %59, %54, %49, %44, %39, %34, %29, %24, %19, %14, %9, %4
%188 = load i32, i32* %1
ret i32 %188
}

LLVM IR (-O2):
define i32 @bpf_semi_rand_get() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 39
switch i32 %2, label %112 [
i32 0, label %3
i32 1, label %5
i32 2, label %7
i32 3, label %10
i32 4, label %12
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
i32 9, label %24
i32 10, label %27
i32 11, label %30
i32 12, label %32
i32 13, label %34
i32 14, label %37
i32 15, label %40
i32 16, label %43
i32 17, label %46
i32 18, label %48
i32 19, label %50
i32 20, label %53
i32 21, label %56
i32 22, label %60
i32 23, label %65
i32 24, label %69
i32 25, label %73
i32 26, label %78
i32 27, label %114
i32 28, label %114
i32 29, label %114
i32 30, label %83
i32 31, label %84
i32 32, label %88
i32 33, label %92
i32 34, label %96
i32 35, label %100
i32 36, label %104
i32 37, label %108
]
3: ; preds = %0
%4 = tail call i32 @bpf_rand_u8(i32 0)
br label %114
5: ; preds = %0
%6 = tail call i32 @bpf_rand_u16(i32 0)
br label %114
7: ; preds = %0
%8 = tail call i32 @bpf_rand_u16(i32 0)
%9 = or i32 %8, -65536
br label %114
10: ; preds = %0
%11 = tail call i32 @bpf_rand_u32(i32 0)
br label %114
12: ; preds = %0
%13 = tail call i32 @bpf_rand_u32(i32 0)
%14 = or i32 %13, -268435456
br label %114
15: ; preds = %0
%16 = tail call i32 @bpf_rand_u24(i32 0)
br label %114
17: ; preds = %0
%18 = tail call i32 @bpf_rand_u32(i32 0)
br label %114
19: ; preds = %0
%20 = tail call i32 @bpf_rand_u32(i32 0)
br label %114
21: ; preds = %0
%22 = tail call i32 @bpf_rand_u32(i32 24)
%23 = xor i32 %22, -256
br label %114
24: ; preds = %0
%25 = tail call i32 @bpf_rand_u8(i32 0)
%26 = or i32 %25, -256
br label %114
27: ; preds = %0
%28 = tail call i32 @bpf_rand_u32(i32 0)
%29 = or i32 %28, 268435456
br label %114
30: ; preds = %0
%31 = tail call i32 @bpf_rand_u8(i32 0)
br label %114
32: ; preds = %0
%33 = tail call i32 @bpf_rand_u8(i32 8)
br label %114
34: ; preds = %0
%35 = tail call i32 @bpf_rand_u8(i32 16)
%36 = or i32 %35, 251658240
br label %114
37: ; preds = %0
%38 = tail call i32 @bpf_rand_u8(i32 32)
%39 = or i32 %38, 3840
br label %114
40: ; preds = %0
%41 = tail call i32 @bpf_rand_u8(i32 48)
%42 = or i32 %41, 3840
br label %114
43: ; preds = %0
%44 = tail call i32 @bpf_rand_u32(i32 1)
%45 = xor i32 %44, -1
br label %114
46: ; preds = %0
%47 = tail call i32 @bpf_rand_u8(i32 4)
br label %114
48: ; preds = %0
%49 = tail call i32 @bpf_rand_u8(i32 20)
br label %114
50: ; preds = %0
%51 = tail call i32 @bpf_rand_u32(i32 0)
%52 = or i32 %51, 524288
br label %114
53: ; preds = %0
%54 = tail call i32 @bpf_rand_u32(i32 0)
%55 = or i32 %54, -67108864
br label %114
56: ; preds = %0
%57 = tail call i32 @bpf_rand_u8(i32 55)
%58 = tail call i32 @bpf_rand_u32(i32 20)
%59 = or i32 %58, %57
br label %114
60: ; preds = %0
%61 = tail call i32 @bpf_rand_u8(i32 3)
%62 = tail call i32 @bpf_rand_u32(i32 40)
%63 = xor i32 %61, %62
%64 = xor i32 %63, -1
br label %114
65: ; preds = %0
%66 = tail call i32 @bpf_rand_u8(i32 0)
%67 = srem i32 %66, 64
%68 = tail call i32 @bpf_rand_u8(i32 %67)
br label %114
69: ; preds = %0
%70 = tail call i32 @bpf_rand_u8(i32 0)
%71 = srem i32 %70, 64
%72 = tail call i32 @bpf_rand_u16(i32 %71)
br label %114
73: ; preds = %0
%74 = tail call i32 @bpf_rand_u8(i32 0)
%75 = srem i32 %74, 64
%76 = tail call i32 @bpf_rand_u8(i32 %75)
%77 = xor i32 %76, -1
br label %114
78: ; preds = %0
%79 = tail call i32 @bpf_rand_u8(i32 0)
%80 = srem i32 %79, 64
%81 = tail call i32 @bpf_rand_u40(i32 %80)
%82 = xor i32 %81, -1
br label %114
83: ; preds = %0
br label %114
84: ; preds = %0
%85 = tail call i32 @bpf_rand_u8(i32 0)
%86 = srem i32 %85, 64
%87 = tail call i32 @bpf_rand_u16(i32 %86)
br label %114
88: ; preds = %0
%89 = tail call i32 @bpf_rand_u8(i32 0)
%90 = srem i32 %89, 64
%91 = tail call i32 @bpf_rand_u24(i32 %90)
br label %114
92: ; preds = %0
%93 = tail call i32 @bpf_rand_u8(i32 0)
%94 = srem i32 %93, 64
%95 = tail call i32 @bpf_rand_u32(i32 %94)
br label %114
96: ; preds = %0
%97 = tail call i32 @bpf_rand_u8(i32 0)
%98 = srem i32 %97, 64
%99 = tail call i32 @bpf_rand_u40(i32 %98)
br label %114
100: ; preds = %0
%101 = tail call i32 @bpf_rand_u8(i32 0)
%102 = srem i32 %101, 64
%103 = tail call i32 @bpf_rand_u48(i32 %102)
br label %114
104: ; preds = %0
%105 = tail call i32 @bpf_rand_u8(i32 0)
%106 = srem i32 %105, 64
%107 = tail call i32 @bpf_rand_u56(i32 %106)
br label %114
108: ; preds = %0
%109 = tail call i32 @bpf_rand_u8(i32 0)
%110 = srem i32 %109, 64
%111 = tail call i32 @bpf_rand_u64(i32 %110)
br label %114
112: ; preds = %0
%113 = tail call i32 @bpf_rand_u64(i32 0)
br label %114
114: ; preds = %0, %0, %0, %112, %108, %104, %100, %96, %92, %88, %84, %83, %78, %73, %69, %65, %60, %56, %53, %50, %48, %46, %43, %40, %37, %34, %32, %30, %27, %24, %21, %19, %17, %15, %12, %10, %7, %5, %3
%115 = phi i32 [ %113, %112 ], [ %111, %108 ], [ %107, %104 ], [ %103, %100 ], [ %99, %96 ], [ %95, %92 ], [ %91, %88 ], [ %87, %84 ], [ -1, %83 ], [ %82, %78 ], [ %77, %73 ], [ %72, %69 ], [ %68, %65 ], [ %64, %60 ], [ %59, %56 ], [ %55, %53 ], [ %52, %50 ], [ %49, %48 ], [ %47, %46 ], [ %45, %43 ], [ %42, %40 ], [ %39, %37 ], [ %36, %34 ], [ %33, %32 ], [ %31, %30 ], [ %29, %27 ], [ %26, %24 ], [ %23, %21 ], [ %20, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %12 ], [ %11, %10 ], [ %9, %7 ], [ %6, %5 ], [ %4, %3 ], [ 0, %0 ], [ 0, %0 ], [ 0, %0 ]
ret i32 %115
}