#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*/ SET_FLOAT_WORD(float, int);
int /*<<< orphan*/ __k_expl(long double, long double *, long double *, int *);
void k_hexpl(long double x, long double *hip, long double *lop) {
  float twopkm1;
  int k;
  __k_expl(x, hip, lop, &k);
  SET_FLOAT_WORD(twopkm1, 0x3f800000 + ((k - 1) << 23));
  *hip *= twopkm1;
  *lop *= twopkm1;
}


x86 assembly (clang, -O0):
<k_hexpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rsp,%rax
fstpt  (%rax)
lea    -0x28(%rbp),%rdx
call   1030 <__k_expl@plt>
movss  -0x24(%rbp),%xmm0
mov    -0x28(%rbp),%edi
shl    $0x17,%edi
add    $0x3f000000,%edi
call   1040 <SET_FLOAT_WORD@plt>
flds   -0x24(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fmulp  %st,%st(1)
fstpt  (%rax)
flds   -0x24(%rbp)
mov    -0x20(%rbp),%rax
fldt   (%rax)
fmulp  %st,%st(1)
fstpt  (%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_hexpl>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
fldt   0x30(%rsp)
fstpt  (%rsp)
lea    0x14(%rsp),%rdx
call   1030 <__k_expl@plt>
mov    0x14(%rsp),%edi
shl    $0x17,%edi
add    $0x3f000000,%edi
call   1040 <SET_FLOAT_WORD@plt>
flds   0xeaa(%rip)
fld    %st(0)
fstpt  (%rbx)
fstpt  (%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @k_hexpl(x86_fp80 %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80*
%6 = alloca x86_fp80*
%7 = alloca float
%8 = alloca i32
store x86_fp80 %0, x86_fp80* %4
store x86_fp80* %1, x86_fp80** %5
store x86_fp80* %2, x86_fp80** %6
%9 = load x86_fp80, x86_fp80* %4
%10 = load x86_fp80*, x86_fp80** %5
%11 = load x86_fp80*, x86_fp80** %6
%12 = call i32 @__k_expl(x86_fp80 %9, x86_fp80* %10, x86_fp80* %11, i32* %8)
%13 = load float, float* %7
%14 = load i32, i32* %8
%15 = sub nsw i32 %14, 1
%16 = shl i32 %15, 23
%17 = add nsw i32 1065353216, %16
%18 = call i32 @SET_FLOAT_WORD(float %13, i32 %17)
%19 = load float, float* %7
%20 = fpext float %19 to x86_fp80
%21 = load x86_fp80*, x86_fp80** %5
%22 = load x86_fp80, x86_fp80* %21
%23 = fmul x86_fp80 %22, %20
store x86_fp80 %23, x86_fp80* %21
%24 = load float, float* %7
%25 = fpext float %24 to x86_fp80
%26 = load x86_fp80*, x86_fp80** %6
%27 = load x86_fp80, x86_fp80* %26
%28 = fmul x86_fp80 %27, %25
store x86_fp80 %28, x86_fp80* %26
ret void
}

LLVM IR (-O2):
define void @k_hexpl(x86_fp80 %0, x86_fp80* %1, x86_fp80* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @__k_expl(x86_fp80 %0, x86_fp80* %1, x86_fp80* %2, i32* %4)
%7 = load i32, i32* %4
%8 = shl i32 %7, 23
%9 = add i32 %8, 1056964608
%10 = call i32 @SET_FLOAT_WORD(float undef, i32 %9)
store x86_fp80 0xK7FFFC000000000000000, x86_fp80* %1
store x86_fp80 0xK7FFFC000000000000000, x86_fp80* %2
ret void
}