#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;
typedef scalar_t__ uint16_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
long jrand48(unsigned short xsubi[3]) {
  uint64_t x;
  x = (uint64_t)(uint16_t)xsubi[0] + ((uint64_t)(uint16_t)xsubi[1] << 16) +
      ((uint64_t)(uint16_t)xsubi[2] << 32);
  x = (0x5deece66dULL * x) + 0xb;
  xsubi[0] = (unsigned short)(uint16_t)x;
  xsubi[1] = (unsigned short)(uint16_t)(x >> 16);
  xsubi[2] = (unsigned short)(uint16_t)(x >> 32);
  return (long)(int32_t)(x >> 16);
}


x86 assembly (clang, -O0):
<jrand48>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzwl 0x4(%rcx),%ecx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x5deece66d,%rcx
imul   %rcx,%rax
add    $0xb,%rax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
cltq
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
cltq
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<jrand48>:
ret

LLVM IR (-O0):
define i64 @jrand48(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = zext i16 %6 to i64
%8 = trunc i64 %7 to i32
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = zext i16 %11 to i64
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = add nsw i32 %8, %14
%16 = load i16*, i16** %2
%17 = getelementptr inbounds i16, i16* %16, i64 2
%18 = load i16, i16* %17
%19 = zext i16 %18 to i64
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 32
%22 = add nsw i32 %15, %21
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = mul i64 25214903917, %24
%26 = add i64 %25, 11
%27 = trunc i64 %26 to i32
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = trunc i64 %29 to i16
%31 = load i16*, i16** %2
%32 = getelementptr inbounds i16, i16* %31, i64 0
store i16 %30, i16* %32
%33 = load i32, i32* %3
%34 = ashr i32 %33, 16
%35 = sext i32 %34 to i64
%36 = trunc i64 %35 to i16
%37 = load i16*, i16** %2
%38 = getelementptr inbounds i16, i16* %37, i64 1
store i16 %36, i16* %38
%39 = load i32, i32* %3
%40 = ashr i32 %39, 32
%41 = sext i32 %40 to i64
%42 = trunc i64 %41 to i16
%43 = load i16*, i16** %2
%44 = getelementptr inbounds i16, i16* %43, i64 2
store i16 %42, i16* %44
%45 = load i32, i32* %3
%46 = ashr i32 %45, 16
%47 = sext i32 %46 to i64
ret i64 %47
}

LLVM IR (-O2):
define i64 @jrand48(i16* nocapture readnone %0) {
ret i64 poison
}