#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*/ fdiv(long double, long double);
long double make(int /*<<< orphan*/, int, int, int);
void divs(void) {
  int i;
  {
    long double max = make(0, 32766, -1, -1);
    long double min = make(0, 0, 0, 1);
    fdiv(max, max);
    fdiv(max, min);
    fdiv(min, max);
    fdiv(min, min);
  }
  for (i = 0; i < 64; i++)
    fdiv(make(0, 16383, -1, -1), make(0, 16383, -1, -(uint64_t)1 << i));
  for (i = 0; i < 48; i++)
    fdiv(make(0, 16383, -1, -1), make(0, 16383, -(uint64_t)1 << i, 0));
}


x86 assembly (clang, -O0):
<divs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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 <fdiv@plt>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiv@plt>
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiv@plt>
fldt   -0x30(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiv@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1205 <divs+0xe5>
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1040 <make@plt>
fstpt  -0x40(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
call   1040 <make@plt>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiv@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a8 <divs+0x88>
movl   $0x0,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jge    1264 <divs+0x144>
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%ecx
mov    %ecx,%edx
call   1040 <make@plt>
fstpt  -0x4c(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    %ecx,%ecx
mov    $0x3fff,%esi
mov    %ecx,%edi
call   1040 <make@plt>
fldt   -0x4c(%rbp)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fdiv@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    120c <divs+0xec>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divs>:
push   %rbx
sub    $0x40,%rsp
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x7ffe,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1040 <make@plt>
fstpt  0x34(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <make@plt>
fstpt  0x28(%rsp)
fldt   0x34(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
fldt   0x34(%rsp)
fstpt  0x10(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
fldt   0x28(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1040 <make@plt>
fstpt  0x28(%rsp)
mov    $0xffffffff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    %eax,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
add    $0x1,%ebx
cmp    $0x40,%ebx
jne    11b0 <divs+0x90>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x3fff,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
call   1040 <make@plt>
fstpt  0x28(%rsp)
mov    $0xffffffff,%edx
mov    %ebx,%ecx
shl    %cl,%edx
xor    %edi,%edi
mov    $0x3fff,%esi
xor    %ecx,%ecx
call   1040 <make@plt>
fstpt  0x10(%rsp)
fldt   0x28(%rsp)
fstpt  (%rsp)
call   1030 <fdiv@plt>
add    $0x1,%ebx
cmp    $0x30,%ebx
jne    1200 <divs+0xe0>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @divs() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = call x86_fp80 @make(i32 0, i32 32766, i32 -1, i32 -1)
store x86_fp80 %4, x86_fp80* %2
%5 = call x86_fp80 @make(i32 0, i32 0, i32 0, i32 1)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %2
%7 = load x86_fp80, x86_fp80* %2
%8 = call i32 @fdiv(x86_fp80 %6, x86_fp80 %7)
%9 = load x86_fp80, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %3
%11 = call i32 @fdiv(x86_fp80 %9, x86_fp80 %10)
%12 = load x86_fp80, x86_fp80* %3
%13 = load x86_fp80, x86_fp80* %2
%14 = call i32 @fdiv(x86_fp80 %12, x86_fp80 %13)
%15 = load x86_fp80, x86_fp80* %3
%16 = load x86_fp80, x86_fp80* %3
%17 = call i32 @fdiv(x86_fp80 %15, x86_fp80 %16)
store i32 0, i32* %1
br label %18
18: ; preds = %27, %0
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 64
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -1)
%23 = load i32, i32* %1
%24 = shl i32 -1, %23
%25 = call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 %24)
%26 = call i32 @fdiv(x86_fp80 %22, x86_fp80 %25)
br label %27
27: ; preds = %21
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %18
30: ; preds = %18
store i32 0, i32* %1
br label %31
31: ; preds = %40, %30
%32 = load i32, i32* %1
%33 = icmp slt i32 %32, 48
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -1)
%36 = load i32, i32* %1
%37 = shl i32 -1, %36
%38 = call x86_fp80 @make(i32 0, i32 16383, i32 %37, i32 0)
%39 = call i32 @fdiv(x86_fp80 %35, x86_fp80 %38)
br label %40
40: ; preds = %34
%41 = load i32, i32* %1
%42 = add nsw i32 %41, 1
store i32 %42, i32* %1
br label %31
43: ; preds = %31
ret void
}

LLVM IR (-O2):
define void @divs() {
%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 @fdiv(x86_fp80 %1, x86_fp80 %1)
%4 = tail call i32 @fdiv(x86_fp80 %1, x86_fp80 %2)
%5 = tail call i32 @fdiv(x86_fp80 %2, x86_fp80 %1)
%6 = tail call i32 @fdiv(x86_fp80 %2, x86_fp80 %2)
br label %7
7: ; preds = %0, %7
%8 = phi i32 [ 0, %0 ], [ %13, %7 ]
%9 = tail call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -1)
%10 = shl nsw i32 -1, %8
%11 = tail call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 %10)
%12 = tail call i32 @fdiv(x86_fp80 %9, x86_fp80 %11)
%13 = add nuw nsw i32 %8, 1
%14 = icmp eq i32 %13, 64
br i1 %14, label %15, label %7
15: ; preds = %7, %15
%16 = phi i32 [ %21, %15 ], [ 0, %7 ]
%17 = tail call x86_fp80 @make(i32 0, i32 16383, i32 -1, i32 -1)
%18 = shl nsw i32 -1, %16
%19 = tail call x86_fp80 @make(i32 0, i32 16383, i32 %18, i32 0)
%20 = tail call i32 @fdiv(x86_fp80 %17, x86_fp80 %19)
%21 = add nuw nsw i32 %16, 1
%22 = icmp eq i32 %21, 48
br i1 %22, label %23, label %15
23: ; preds = %15
ret void
}