#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 */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fmul(long double, long double);
long double make(int, int, int, int);
void muls(void) {
  int i, j;
  {
    long double max = make(0, 32766, -1, -1);
    long double min = make(0, 0, 0, 1);
    fmul(max, max);
    fmul(max, min);
    fmul(min, min);
  }
  for (i = 117; i > 0; i--)
    fmul(make(0, 16268, 0x643dcea76edc, 0xe0877a598403627a),
         make(i & 1, i, 0, 0));
  fmul(make(0, 16383, -1, -3), make(0, 16383, 0, 1));
  fmul(make(0, 16383, -1, -2), make(0, 16383, 0, 1));
  fmul(make(0, 1, -1, -1), make(0, 16382, 0, 0));
  for (i = 0; i < 2; i++)
    for (j = 0; j < 112; j++)
      fmul(make(0, 16383, (uint64_t)1 << i, 0),
           make(0, 16383, j < 64 ? 0 : (uint64_t)1 << (j - 64),
                j < 64 ? (uint64_t)1 << j : 0));
}


x86 assembly (clang, -O0):
<muls>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
xor    %edi,%edi
mov    %edi,-0x34(%rbp)
mov    $0x7ffe,%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1040 <make@plt>
mov    -0x34(%rbp),%edx
fstpt  -0x20(%rbp)
mov    $0x1,%ecx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <make@plt>
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fld    %st(0)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
fldt   -0x30(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
movl   $0x75,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    11ed <muls+0xcd>
xor    %edi,%edi
mov    $0x3f8c,%esi
mov    $0xcea76edc,%edx
mov    $0x8403627a,%ecx
call   1040 <make@plt>
fstpt  -0x40(%rbp)
mov    -0x4(%rbp),%edi
and    $0x1,%edi
mov    -0x4(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <make@plt>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <muls+0x78>
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffd,%ecx
call   1040 <make@plt>
fstpt  -0x64(%rbp)
xor    %edx,%edx
mov    $0x3fff,%esi
mov    $0x1,%ecx
mov    %edx,%edi
call   1040 <make@plt>
fldt   -0x64(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffe,%ecx
call   1040 <make@plt>
fstpt  -0x58(%rbp)
xor    %edx,%edx
mov    $0x3fff,%esi
mov    $0x1,%ecx
mov    %edx,%edi
call   1040 <make@plt>
fldt   -0x58(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1040 <make@plt>
fstpt  -0x4c(%rbp)
xor    %ecx,%ecx
mov    $0x3ffe,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <make@plt>
fldt   -0x4c(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1373 <muls+0x253>
movl   $0x0,-0x8(%rbp)
cmpl   $0x70,-0x8(%rbp)
jge    1360 <muls+0x240>
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %ecx,%ecx
mov    $0x3fff,%esi
mov    %ecx,%edi
call   1040 <make@plt>
fstpt  -0x70(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    12f2 <muls+0x1d2>
xor    %eax,%eax
mov    %eax,-0x74(%rbp)
jmp    1302 <muls+0x1e2>
mov    -0x8(%rbp),%ecx
sub    $0x40,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x78(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    1324 <muls+0x204>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x7c(%rbp)
jmp    132e <muls+0x20e>
xor    %eax,%eax
mov    %eax,-0x7c(%rbp)
jmp    132e <muls+0x20e>
mov    -0x78(%rbp),%edx
mov    -0x7c(%rbp),%ecx
xor    %edi,%edi
mov    $0x3fff,%esi
call   1040 <make@plt>
fldt   -0x70(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmul@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b9 <muls+0x199>
jmp    1365 <muls+0x245>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12a8 <muls+0x188>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muls>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
mov    $0x7ffe,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1040 <make@plt>
fstpt  0x2c(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
fldt   0x2c(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
fldt   0x20(%rsp)
fstpt  0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
fldt   0x20(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
mov    $0x76,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%ebx
xor    %edi,%edi
mov    $0x3f8c,%esi
mov    $0xcea76edc,%edx
mov    $0x8403627a,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
mov    %ebx,%edi
and    $0x1,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
cmp    $0x1,%ebx
ja     11a0 <muls+0x80>
xor    %r14d,%r14d
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffd,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
xor    %edi,%edi
mov    $0x3fff,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xfffffffe,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
xor    %edi,%edi
mov    $0x3fff,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
xor    %edi,%edi
mov    $0x3ffe,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x40(%rbx),%ecx
mov    $0x1,%r15d
shl    %cl,%r15d
cmp    $0x40,%ebx
cmovae %r14d,%r15d
mov    $0x1,%ebp
shl    %cl,%ebp
sub    $0x40,%ebx
cmovb  %r14d,%ebp
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
xor    %edi,%edi
mov    $0x3fff,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
add    $0x41,%ebx
cmp    $0x70,%ebx
jne    12a0 <muls+0x180>
xor    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x40(%rbx),%ecx
mov    $0x1,%r15d
shl    %cl,%r15d
cmp    $0x40,%ebx
cmovae %r14d,%r15d
mov    $0x1,%ebp
shl    %cl,%ebp
sub    $0x40,%ebx
cmovb  %r14d,%ebp
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1040 <make@plt>
fstpt  0x20(%rsp)
xor    %edi,%edi
mov    $0x3fff,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <fmul@plt>
add    $0x41,%ebx
cmp    $0x70,%ebx
jne    1310 <muls+0x1f0>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @muls() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = call x86_fp80 @make(i32 0, i32 32766, i32 -1, i32 -1)
store x86_fp80 %5, x86_fp80* %3
%6 = call x86_fp80 @make(i32 0, i32 0, i32 0, i32 1)
store x86_fp80 %6, x86_fp80* %4
%7 = load x86_fp80, x86_fp80* %3
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @fmul(x86_fp80 %7, x86_fp80 %8)
%10 = load x86_fp80, x86_fp80* %3
%11 = load x86_fp80, x86_fp80* %4
%12 = call i32 @fmul(x86_fp80 %10, x86_fp80 %11)
%13 = load x86_fp80, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %4
%15 = call i32 @fmul(x86_fp80 %13, x86_fp80 %14)
store i32 117, i32* %1
br label %16
16: ; preds = %26, %0
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = call x86_fp80 @make(i32 0, i32 16268, i32 -827887908, i32 -2080152966)
%21 = load i32, i32* %1
%22 = and i32 %21, 1
%23 = load i32, i32* %1
%24 = call x86_fp80 @make(i32 %22, i32 %23, i32 0, i32 0)
%25 = call i32 @fmul(x86_fp80 %20, x86_fp80 %24)
br label %26
26: ; preds = %19
%27 = load i32, i32* %1
%28 = add nsw i32 %27, -1
store i32 %28, i32* %1
br label %16
29: ; preds = %16
%30 = call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -3)
%31 = call x86_fp80 @make(i32 0, i32 16383, i32 0, i32 1)
%32 = call i32 @fmul(x86_fp80 %30, x86_fp80 %31)
%33 = call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -2)
%34 = call x86_fp80 @make(i32 0, i32 16383, i32 0, i32 1)
%35 = call i32 @fmul(x86_fp80 %33, x86_fp80 %34)
%36 = call x86_fp80 @make(i32 0, i32 1, i32 -1, i32 -1)
%37 = call x86_fp80 @make(i32 0, i32 16382, i32 0, i32 0)
%38 = call i32 @fmul(x86_fp80 %36, x86_fp80 %37)
store i32 0, i32* %1
br label %39
39: ; preds = %73, %29
%40 = load i32, i32* %1
%41 = icmp slt i32 %40, 2
br i1 %41, label %42, label %76
42: ; preds = %39
store i32 0, i32* %2
br label %43
43: ; preds = %69, %42
%44 = load i32, i32* %2
%45 = icmp slt i32 %44, 112
br i1 %45, label %46, label %72
46: ; preds = %43
%47 = load i32, i32* %1
%48 = shl i32 1, %47
%49 = call x86_fp80 @make(i32 0, i32 16383, i32 %48, i32 0)
%50 = load i32, i32* %2
%51 = icmp slt i32 %50, 64
br i1 %51, label %52, label %53
52: ; preds = %46
br label %57
53: ; preds = %46
%54 = load i32, i32* %2
%55 = sub nsw i32 %54, 64
%56 = shl i32 1, %55
br label %57
57: ; preds = %53, %52
%58 = phi i32 [ 0, %52 ], [ %56, %53 ]
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 64
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = load i32, i32* %2
%63 = shl i32 1, %62
br label %65
64: ; preds = %57
br label %65
65: ; preds = %64, %61
%66 = phi i32 [ %63, %61 ], [ 0, %64 ]
%67 = call x86_fp80 @make(i32 0, i32 16383, i32 %58, i32 %66)
%68 = call i32 @fmul(x86_fp80 %49, x86_fp80 %67)
br label %69
69: ; preds = %65
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %43
72: ; preds = %43
br label %73
73: ; preds = %72
%74 = load i32, i32* %1
%75 = add nsw i32 %74, 1
store i32 %75, i32* %1
br label %39
76: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @muls() {
%1 = tail call x86_fp80 @make(i32 0, i32 32766, i32 -1, i32 -1)
%2 = tail call x86_fp80 @make(i32 0, i32 0, i32 0, i32 1)
%3 = tail call i32 @fmul(x86_fp80 %1, x86_fp80 %1)
%4 = tail call i32 @fmul(x86_fp80 %1, x86_fp80 %2)
%5 = tail call i32 @fmul(x86_fp80 %2, x86_fp80 %2)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 117, %0 ], [ %12, %6 ]
%8 = tail call x86_fp80 @make(i32 0, i32 16268, i32 -827887908, i32 -2080152966)
%9 = and i32 %7, 1
%10 = tail call x86_fp80 @make(i32 %9, i32 %7, i32 0, i32 0)
%11 = tail call i32 @fmul(x86_fp80 %8, x86_fp80 %10)
%12 = add nsw i32 %7, -1
%13 = icmp ugt i32 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6
%15 = tail call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -3)
%16 = tail call x86_fp80 @make(i32 0, i32 16383, i32 0, i32 1)
%17 = tail call i32 @fmul(x86_fp80 %15, x86_fp80 %16)
%18 = tail call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -2)
%19 = tail call x86_fp80 @make(i32 0, i32 16383, i32 0, i32 1)
%20 = tail call i32 @fmul(x86_fp80 %18, x86_fp80 %19)
%21 = tail call x86_fp80 @make(i32 0, i32 1, i32 -1, i32 -1)
%22 = tail call x86_fp80 @make(i32 0, i32 16382, i32 0, i32 0)
%23 = tail call i32 @fmul(x86_fp80 %21, x86_fp80 %22)
br label %24
24: ; preds = %14, %24
%25 = phi i32 [ 0, %14 ], [ %35, %24 ]
%26 = tail call x86_fp80 @make(i32 0, i32 16383, i32 1, i32 0)
%27 = icmp ult i32 %25, 64
%28 = add nsw i32 %25, -64
%29 = shl nuw i32 1, %28
%30 = select i1 %27, i32 0, i32 %29
%31 = shl nuw i32 1, %25
%32 = select i1 %27, i32 %31, i32 0
%33 = tail call x86_fp80 @make(i32 0, i32 16383, i32 %30, i32 %32)
%34 = tail call i32 @fmul(x86_fp80 %26, x86_fp80 %33)
%35 = add nuw nsw i32 %25, 1
%36 = icmp eq i32 %35, 112
br i1 %36, label %37, label %24
37: ; preds = %24, %37
%38 = phi i32 [ %48, %37 ], [ 0, %24 ]
%39 = tail call x86_fp80 @make(i32 0, i32 16383, i32 2, i32 0)
%40 = icmp ult i32 %38, 64
%41 = add nsw i32 %38, -64
%42 = shl nuw i32 1, %41
%43 = select i1 %40, i32 0, i32 %42
%44 = shl nuw i32 1, %38
%45 = select i1 %40, i32 %44, i32 0
%46 = tail call x86_fp80 @make(i32 0, i32 16383, i32 %43, i32 %45)
%47 = tail call i32 @fmul(x86_fp80 %39, x86_fp80 %46)
%48 = add nuw nsw i32 %38, 1
%49 = icmp eq i32 %48, 112
br i1 %49, label %50, label %37
50: ; preds = %37
ret void
}