#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 /*<<< orphan*/ qdran64(int *, int *);
void qdran64_2d(double *rand1, double *rand2) {
  union {
    double x;
    uint64_t i;
  } re, im;
  uint64_t *ranlow = &re.i;
  uint64_t *ranhigh = &im.i;
  re.x = (*rand1);
  im.x = (*rand2);
  qdran64(ranlow, ranhigh);
  (*ranlow) &= 0x000fffffffffffffULL;
  (*ranlow) |= 0x3ff0000000000000ULL;
  (*ranhigh) &= 0x000fffffffffffffULL;
  (*ranhigh) |= 0x3ff0000000000000ULL;
  *rand1 = re.x;
  *rand2 = im.x;
}


x86 assembly (clang, -O0):
<qdran64_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <qdran64@plt>
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
movabs $0xfffffffffffff,%rdx
and    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
movabs $0x3ff0000000000000,%rdx
or     %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
movslq (%rax),%rcx
movabs $0xfffffffffffff,%rdx
and    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
movslq (%rax),%rcx
movabs $0x3ff0000000000000,%rdx
or     %rdx,%rcx
mov    %ecx,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qdran64_2d>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <qdran64@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { double }
define void @qdran64_2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca %union.anon
%6 = alloca %union.anon
%7 = alloca i32*
%8 = alloca i32*
store double* %0, double** %3
store double* %1, double** %4
%9 = bitcast %union.anon* %5 to i32*
store i32* %9, i32** %7
%10 = bitcast %union.anon* %6 to i32*
store i32* %10, i32** %8
%11 = load double*, double** %3
%12 = load double, double* %11
%13 = bitcast %union.anon* %5 to double*
store double %12, double* %13
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = bitcast %union.anon* %6 to double*
store double %15, double* %16
%17 = load i32*, i32** %7
%18 = load i32*, i32** %8
%19 = call i32 @qdran64(i32* %17, i32* %18)
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = and i64 %22, 4503599627370495
%24 = trunc i64 %23 to i32
store i32 %24, i32* %20
%25 = load i32*, i32** %7
%26 = load i32, i32* %25
%27 = sext i32 %26 to i64
%28 = or i64 %27, 4607182418800017408
%29 = trunc i64 %28 to i32
store i32 %29, i32* %25
%30 = load i32*, i32** %8
%31 = load i32, i32* %30
%32 = sext i32 %31 to i64
%33 = and i64 %32, 4503599627370495
%34 = trunc i64 %33 to i32
store i32 %34, i32* %30
%35 = load i32*, i32** %8
%36 = load i32, i32* %35
%37 = sext i32 %36 to i64
%38 = or i64 %37, 4607182418800017408
%39 = trunc i64 %38 to i32
store i32 %39, i32* %35
%40 = bitcast %union.anon* %5 to double*
%41 = load double, double* %40
%42 = load double*, double** %3
store double %41, double* %42
%43 = bitcast %union.anon* %6 to double*
%44 = load double, double* %43
%45 = load double*, double** %4
store double %44, double* %45
ret void
}

LLVM IR (-O2):
%union.anon = type { double }
define void @qdran64_2d(double* nocapture %0, double* nocapture %1) {
%3 = alloca %union.anon
%4 = alloca %union.anon
%5 = bitcast %union.anon* %3 to i8*
%6 = bitcast %union.anon* %4 to i8*
%7 = bitcast %union.anon* %3 to i32*
%8 = bitcast %union.anon* %4 to i32*
%9 = load double, double* %0
%10 = getelementptr inbounds %union.anon, %union.anon* %3, i64 0, i32 0
store double %9, double* %10
%11 = load double, double* %1
%12 = getelementptr inbounds %union.anon, %union.anon* %4, i64 0, i32 0
store double %11, double* %12
%13 = call i32 @qdran64(i32* %7, i32* %8)
%14 = load double, double* %10
store double %14, double* %0
%15 = load double, double* %12
store double %15, double* %1
ret void
}