#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 */
struct KIrand {
  int dummy;
};

/* Variables and functions */
int KIrand_genrand_int32(struct KIrand *);
double KIrand_genrand_res53(struct KIrand *r) {
  unsigned long a = KIrand_genrand_int32(r) >> 5,
                b = KIrand_genrand_int32(r) >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<KIrand_genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <KIrand_genrand_int32@plt>
sar    $0x5,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <KIrand_genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x18(%rbp)
movaps 0xec9(%rip),%xmm3
movq   -0x10(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec8(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x18(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe81(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIrand_genrand_res53>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <KIrand_genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%r14
mov    %rbx,%rdi
call   1030 <KIrand_genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %r14,%xmm1
movdqa 0xec4(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xec8(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeab(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea3(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_res53(%struct.KIrand* %0) {
%2 = alloca %struct.KIrand*
%3 = alloca i64
%4 = alloca i64
store %struct.KIrand* %0, %struct.KIrand** %2
%5 = load %struct.KIrand*, %struct.KIrand** %2
%6 = call i32 @KIrand_genrand_int32(%struct.KIrand* %5)
%7 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load %struct.KIrand*, %struct.KIrand** %2
%10 = call i32 @KIrand_genrand_int32(%struct.KIrand* %9)
%11 = ashr i32 %10, 6
%12 = sext i32 %11 to i64
store i64 %12, i64* %4
%13 = load i64, i64* %3
%14 = uitofp i64 %13 to double
%15 = load i64, i64* %4
%16 = uitofp i64 %15 to double
%17 = call double @llvm.fmuladd.f64(double %14, double 0x4190000000000000, double %16)
%18 = fmul double %17, 0x3CA0000000000000
ret double %18
}

LLVM IR (-O2):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_res53(%struct.KIrand* %0) {
%2 = tail call i32 @KIrand_genrand_int32(%struct.KIrand* %0)
%3 = ashr i32 %2, 5
%4 = sext i32 %3 to i64
%5 = tail call i32 @KIrand_genrand_int32(%struct.KIrand* %0)
%6 = ashr i32 %5, 6
%7 = sext i32 %6 to i64
%8 = uitofp i64 %4 to double
%9 = uitofp i64 %7 to double
%10 = tail call double @llvm.fmuladd.f64(double %8, double 0x4190000000000000, double %9)
%11 = fmul double %10, 0x3CA0000000000000
ret double %11
}