#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 fabs(long double);
long double frand(double, double);
long double log(int);
long double _extract_from_dist_laplace(long double mu, long double b) {
  long double p = frand(-0.4999, 0.5);
  return mu - b * (p / fabs(p)) * log(1 - 2 * fabs(p));
}


x86 assembly (clang, -O0):
<_extract_from_dist_laplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  0xeb1(%rip),%xmm1
call   1040 <frand@plt>
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x58(%rbp)
fldt   -0x30(%rbp)
fld    %st(0)
fstpt  -0x64(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabs@plt>
fldt   -0x64(%rbp)
fldt   -0x58(%rbp)
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fdivrp %st,%st(2)
fmulp  %st,%st(1)
fstpt  -0x4c(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabs@plt>
add    %eax,%eax
mov    $0x1,%edi
sub    %eax,%edi
call   1050 <log@plt>
fldt   -0x4c(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fmulp  %st,%st(2)
fsubp  %st,%st(1)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_extract_from_dist_laplace>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
fstpt  0x2c(%rsp)
fldt   0x50(%rsp)
fstpt  0x20(%rsp)
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1040 <frand@plt>
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <fabs@plt>
mov    %eax,0x10(%rsp)
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <fabs@plt>
add    %eax,%eax
mov    $0x1,%edi
sub    %eax,%edi
call   1050 <log@plt>
fldt   0x14(%rsp)
fidivl 0x10(%rsp)
fldt   0x20(%rsp)
fmulp  %st,%st(1)
fmulp  %st,%st(1)
fldt   0x2c(%rsp)
fsubp  %st,%st(1)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @_extract_from_dist_laplace(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = call x86_fp80 @frand(double -4.999000e-01, double 5.000000e-01)
store x86_fp80 %6, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %3
%8 = load x86_fp80, x86_fp80* %4
%9 = load x86_fp80, x86_fp80* %5
%10 = load x86_fp80, x86_fp80* %5
%11 = call i32 @fabs(x86_fp80 %10)
%12 = sitofp i32 %11 to x86_fp80
%13 = fdiv x86_fp80 %9, %12
%14 = fmul x86_fp80 %8, %13
%15 = load x86_fp80, x86_fp80* %5
%16 = call i32 @fabs(x86_fp80 %15)
%17 = mul nsw i32 2, %16
%18 = sub nsw i32 1, %17
%19 = call x86_fp80 @log(i32 %18)
%20 = fneg x86_fp80 %14
%21 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %20, x86_fp80 %19, x86_fp80 %7)
ret x86_fp80 %21
}

LLVM IR (-O2):
define x86_fp80 @_extract_from_dist_laplace(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @frand(double -4.999000e-01, double 5.000000e-01)
%4 = tail call i32 @fabs(x86_fp80 %3)
%5 = sitofp i32 %4 to x86_fp80
%6 = tail call i32 @fabs(x86_fp80 %3)
%7 = mul i32 %6, -2
%8 = or i32 %7, 1
%9 = tail call x86_fp80 @log(i32 %8)
%10 = fneg x86_fp80 %3
%11 = fdiv x86_fp80 %10, %5
%12 = fmul x86_fp80 %11, %1
%13 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %12, x86_fp80 %9, x86_fp80 %0)
ret x86_fp80 %13
}