#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 */

/* Variables and functions */
int /*<<< orphan*/ exp(double);
double pow(int /*<<< orphan*/, double);
scalar_t__ randomMT();
int proposal_mcmc(double newscore, double oldscore, double temp) {
  double randsamp;
  randsamp = (double)(((unsigned long)randomMT()) / 4294967296.);
  if (randsamp < pow(exp(newscore - oldscore), temp)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<proposal_mcmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xor    %eax,%eax
call   1030 <randomMT@plt>
movq   %rax,%xmm0
movaps 0xeb6(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xeba(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
movsd  -0x20(%rbp),%xmm0
call   1050 <pow@plt>
movsd  -0x30(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c6 <proposal_mcmc+0x96>
movl   $0x1,-0x4(%rbp)
jmp    11cd <proposal_mcmc+0x9d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proposal_mcmc>:
sub    $0x38,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <randomMT@plt>
movq   %rax,%xmm0
punpckldq 0xea6(%rip),%xmm0
subpd  0xeae(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xeaa(%rip),%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1040 <exp@plt>
mov    %eax,%edi
movsd  0x18(%rsp),%xmm0
call   1050 <pow@plt>
xor    %eax,%eax
ucomisd 0x20(%rsp),%xmm0
seta   %al
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @proposal_mcmc(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%9 = call i64 (...) @randomMT()
%10 = uitofp i64 %9 to double
%11 = fdiv double %10, 0x41F0000000000000
store double %11, double* %8
%12 = load double, double* %8
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = call i32 @exp(double %15)
%17 = load double, double* %7
%18 = call double @pow(i32 %16, double %17)
%19 = fcmp olt double %12, %18
br i1 %19, label %20, label %21
20: ; preds = %3
store i32 1, i32* %4
br label %22
21: ; preds = %3
store i32 0, i32* %4
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @proposal_mcmc(double %0, double %1, double %2) {
%4 = tail call i64 (...) @randomMT()
%5 = uitofp i64 %4 to double
%6 = fmul double %5, 0x3DF0000000000000
%7 = fsub double %0, %1
%8 = tail call i32 @exp(double %7)
%9 = tail call double @pow(i32 %8, double %2)
%10 = fcmp olt double %6, %9
%11 = zext i1 %10 to i32
ret i32 %11
}