#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 */
unsigned long long ULLONG_MAX;
long double expl(unsigned long long);
unsigned long long int
acceptanceProbability(unsigned long long int pathlength,
                      unsigned long long int newpathlength, long double temp) {
  if (newpathlength < pathlength)
    return ULLONG_MAX;
  long double res = expl(newpathlength - pathlength / temp);
  return (unsigned long long int)(ULLONG_MAX * res);
}


x86 assembly (clang, -O0):
<acceptanceProbability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114a <acceptanceProbability+0x3a>
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <acceptanceProbability+0x146>
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
test   %rax,%rax
sets   %al
movzbl %al,%eax
mov    %eax,%ecx
fildll -0x68(%rbp)
lea    0xe99(%rip),%rax
mov    %rax,-0x90(%rbp)
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x60(%rbp)
test   %rcx,%rcx
sets   %cl
movzbl %cl,%ecx
fildll -0x60(%rbp)
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
fsubrp %st,%st(1)
flds   0xe6f(%rip)
fld    %st(0)
fstpt  -0x7c(%rbp)
fxch   %st(1)
fucomi %st(1),%st
fldz
fld    %st(0)
fstpt  -0x88(%rbp)
fcmovnb %st(2),%st
fstp   %st(2)
fsubp  %st,%st(1)
setae  %al
fnstcw -0x6a(%rbp)
movzwl -0x6a(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x6c(%rbp)
fldcw  -0x6c(%rbp)
fistpll -0x58(%rbp)
fldcw  -0x6a(%rbp)
movzbl %al,%eax
shl    $0x3f,%rax
mov    -0x58(%rbp),%rdi
xor    %rax,%rdi
call   1030 <expl@plt>
mov    -0x90(%rbp),%rax
fldt   -0x88(%rbp)
fldt   -0x7c(%rbp)
fxch   %st(2)
fstpt  -0x40(%rbp)
mov    0x2dea(%rip),%rcx
mov    (%rcx),%rcx
mov    %rcx,-0x50(%rbp)
test   %rcx,%rcx
sets   %cl
movzbl %cl,%ecx
fildll -0x50(%rbp)
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fucomi %st(2),%st
fxch   %st(1)
fcmovnb %st(2),%st
fstp   %st(2)
fsubp  %st,%st(1)
setae  %al
fnstcw -0x6e(%rbp)
movzwl -0x6e(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x70(%rbp)
fldcw  -0x70(%rbp)
fistpll -0x48(%rbp)
fldcw  -0x6e(%rbp)
movzbl %al,%eax
mov    %eax,%ecx
shl    $0x3f,%rcx
mov    -0x48(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptanceProbability>:
push   %rbx
sub    $0x50,%rsp
fldt   0x60(%rsp)
cmp    %rdi,%rsi
jae    112f <acceptanceProbability+0x1f>
fstp   %st(0)
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
jmp    1213 <acceptanceProbability+0x103>
mov    %rsi,0x10(%rsp)
xor    %eax,%eax
test   %rsi,%rsi
sets   %al
fildll 0x10(%rsp)
lea    0xeb9(%rip),%rbx
fadds  (%rbx,%rax,4)
mov    %rdi,0x18(%rsp)
xor    %eax,%eax
test   %rdi,%rdi
sets   %al
fildll 0x18(%rsp)
fadds  (%rbx,%rax,4)
fdivp  %st,%st(2)
fsubp  %st,%st(1)
flds   0xea0(%rip)
fld    %st(0)
fstpt  0x38(%rsp)
xor    %edi,%edi
fxch   %st(1)
fucomi %st(1),%st
fldz
fld    %st(0)
fstpt  0x44(%rsp)
fcmovnb %st(2),%st
fstp   %st(2)
fsubp  %st,%st(1)
setae  %dil
fnstcw 0xa(%rsp)
movzwl 0xa(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0xe(%rsp)
fldcw  0xe(%rsp)
fistpll 0x20(%rsp)
fldcw  0xa(%rsp)
shl    $0x3f,%rdi
xor    0x20(%rsp),%rdi
call   1030 <expl@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x28(%rsp)
xor    %ecx,%ecx
test   %rax,%rax
sets   %cl
fildll 0x28(%rsp)
fadds  (%rbx,%rcx,4)
fmulp  %st,%st(1)
xor    %eax,%eax
fldt   0x38(%rsp)
fxch   %st(1)
fucomi %st(1),%st
fldt   0x44(%rsp)
fcmovnb %st(2),%st
fstp   %st(2)
fsubp  %st,%st(1)
setae  %al
fnstcw 0x8(%rsp)
movzwl 0x8(%rsp),%ecx
or     $0xc00,%ecx
mov    %cx,0xc(%rsp)
fldcw  0xc(%rsp)
fistpll 0x30(%rsp)
fldcw  0x8(%rsp)
shl    $0x3f,%rax
xor    0x30(%rsp),%rax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@ULLONG_MAX = global i64 0
define i64 @acceptanceProbability(i64 %0, i64 %1, x86_fp80 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store i64 %0, i64* %5
store i64 %1, i64* %6
store x86_fp80 %2, x86_fp80* %7
%9 = load i64, i64* %6
%10 = load i64, i64* %5
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i64, i64* @ULLONG_MAX
store i64 %13, i64* %4
br label %29
14: ; preds = %3
%15 = load i64, i64* %6
%16 = uitofp i64 %15 to x86_fp80
%17 = load i64, i64* %5
%18 = uitofp i64 %17 to x86_fp80
%19 = load x86_fp80, x86_fp80* %7
%20 = fdiv x86_fp80 %18, %19
%21 = fsub x86_fp80 %16, %20
%22 = fptoui x86_fp80 %21 to i64
%23 = call x86_fp80 @expl(i64 %22)
store x86_fp80 %23, x86_fp80* %8
%24 = load i64, i64* @ULLONG_MAX
%25 = uitofp i64 %24 to x86_fp80
%26 = load x86_fp80, x86_fp80* %8
%27 = fmul x86_fp80 %25, %26
%28 = fptoui x86_fp80 %27 to i64
store i64 %28, i64* %4
br label %29
29: ; preds = %14, %12
%30 = load i64, i64* %4
ret i64 %30
}

LLVM IR (-O2):
@ULLONG_MAX = global i64 0
define i64 @acceptanceProbability(i64 %0, i64 %1, x86_fp80 %2) {
%4 = icmp ult i64 %1, %0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = load i64, i64* @ULLONG_MAX
br label %18
7: ; preds = %3
%8 = uitofp i64 %1 to x86_fp80
%9 = uitofp i64 %0 to x86_fp80
%10 = fdiv x86_fp80 %9, %2
%11 = fsub x86_fp80 %8, %10
%12 = fptoui x86_fp80 %11 to i64
%13 = tail call x86_fp80 @expl(i64 %12)
%14 = load i64, i64* @ULLONG_MAX
%15 = uitofp i64 %14 to x86_fp80
%16 = fmul x86_fp80 %13, %15
%17 = fptoui x86_fp80 %16 to i64
br label %18
18: ; preds = %7, %5
%19 = phi i64 [ %6, %5 ], [ %17, %7 ]
ret i64 %19
}