#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*/ pd_fast_renorm(double, double, double, double, double,
                                  double, double *, double *, double *,
                                  double *, double *);
int /*<<< orphan*/ pd_mul_pd_d(double const *, double, double *);
int /*<<< orphan*/ pd_sub(double const *, double *, double *);
void pd_div(const double *a, const double *b, double *c) {
  double acc[5];
  double q0, q1, q2, q3, q4, q5;
  q0 = a[0] / b[0];
  pd_mul_pd_d(b, q0, acc);
  pd_sub(a, acc, c);
  q1 = c[0] / b[0];
  pd_mul_pd_d(b, q1, acc);
  pd_sub(c, acc, c);
  q2 = c[0] / b[0];
  pd_mul_pd_d(b, q2, acc);
  pd_sub(c, acc, c);
  q3 = c[0] / b[0];
  pd_mul_pd_d(b, q3, acc);
  pd_sub(c, acc, c);
  q4 = c[0] / b[0];
  pd_mul_pd_d(b, q4, acc);
  pd_sub(c, acc, c);
  q5 = c[0] / b[0];
  pd_fast_renorm(q0, q1, q2, q3, q4, q5, &c[0], &c[1], &c[2], &c[3], &c[4]);
}


x86 assembly (clang, -O0):
<pd_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <pd_mul_pd_d@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_sub@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x50(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <pd_mul_pd_d@plt>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_sub@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x58(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <pd_mul_pd_d@plt>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_sub@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x60(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <pd_mul_pd_d@plt>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_sub@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x68(%rbp),%xmm0
lea    -0x40(%rbp),%rsi
call   1040 <pd_mul_pd_d@plt>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pd_sub@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x70(%rbp),%xmm5
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x10,%rdx
mov    -0x18(%rbp),%rcx
add    $0x18,%rcx
mov    -0x18(%rbp),%r8
add    $0x20,%r8
call   1050 <pd_fast_renorm@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_div>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r12
movsd  (%rdi),%xmm0
divsd  (%rsi),%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0x30(%rsp),%r15
mov    %rsi,%rdi
mov    %r15,%rsi
call   1040 <pd_mul_pd_d@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <pd_sub@plt>
movsd  (%rbx),%xmm0
divsd  (%r14),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <pd_mul_pd_d@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <pd_sub@plt>
movsd  (%rbx),%xmm0
divsd  (%r14),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <pd_mul_pd_d@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <pd_sub@plt>
movsd  (%rbx),%xmm0
divsd  (%r14),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <pd_mul_pd_d@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <pd_sub@plt>
movsd  (%rbx),%xmm0
divsd  (%r14),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <pd_mul_pd_d@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <pd_sub@plt>
movsd  (%rbx),%xmm5
divsd  (%r14),%xmm5
lea    0x8(%rbx),%rsi
lea    0x10(%rbx),%rdx
lea    0x18(%rbx),%rcx
lea    0x20(%rbx),%r8
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    %rbx,%rdi
call   1050 <pd_fast_renorm@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pd_div(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [5 x double]
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fdiv double %16, %19
store double %20, double* %8
%21 = load double*, double** %5
%22 = load double, double* %8
%23 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%24 = call i32 @pd_mul_pd_d(double* %21, double %22, double* %23)
%25 = load double*, double** %4
%26 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%27 = load double*, double** %6
%28 = call i32 @pd_sub(double* %25, double* %26, double* %27)
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fdiv double %31, %34
store double %35, double* %9
%36 = load double*, double** %5
%37 = load double, double* %9
%38 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%39 = call i32 @pd_mul_pd_d(double* %36, double %37, double* %38)
%40 = load double*, double** %6
%41 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%42 = load double*, double** %6
%43 = call i32 @pd_sub(double* %40, double* %41, double* %42)
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 0
%46 = load double, double* %45
%47 = load double*, double** %5
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
%50 = fdiv double %46, %49
store double %50, double* %10
%51 = load double*, double** %5
%52 = load double, double* %10
%53 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%54 = call i32 @pd_mul_pd_d(double* %51, double %52, double* %53)
%55 = load double*, double** %6
%56 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%57 = load double*, double** %6
%58 = call i32 @pd_sub(double* %55, double* %56, double* %57)
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
%65 = fdiv double %61, %64
store double %65, double* %11
%66 = load double*, double** %5
%67 = load double, double* %11
%68 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%69 = call i32 @pd_mul_pd_d(double* %66, double %67, double* %68)
%70 = load double*, double** %6
%71 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%72 = load double*, double** %6
%73 = call i32 @pd_sub(double* %70, double* %71, double* %72)
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 0
%76 = load double, double* %75
%77 = load double*, double** %5
%78 = getelementptr inbounds double, double* %77, i64 0
%79 = load double, double* %78
%80 = fdiv double %76, %79
store double %80, double* %12
%81 = load double*, double** %5
%82 = load double, double* %12
%83 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%84 = call i32 @pd_mul_pd_d(double* %81, double %82, double* %83)
%85 = load double*, double** %6
%86 = getelementptr inbounds [5 x double], [5 x double]* %7, i64 0, i64 0
%87 = load double*, double** %6
%88 = call i32 @pd_sub(double* %85, double* %86, double* %87)
%89 = load double*, double** %6
%90 = getelementptr inbounds double, double* %89, i64 0
%91 = load double, double* %90
%92 = load double*, double** %5
%93 = getelementptr inbounds double, double* %92, i64 0
%94 = load double, double* %93
%95 = fdiv double %91, %94
store double %95, double* %13
%96 = load double, double* %8
%97 = load double, double* %9
%98 = load double, double* %10
%99 = load double, double* %11
%100 = load double, double* %12
%101 = load double, double* %13
%102 = load double*, double** %6
%103 = getelementptr inbounds double, double* %102, i64 0
%104 = load double*, double** %6
%105 = getelementptr inbounds double, double* %104, i64 1
%106 = load double*, double** %6
%107 = getelementptr inbounds double, double* %106, i64 2
%108 = load double*, double** %6
%109 = getelementptr inbounds double, double* %108, i64 3
%110 = load double*, double** %6
%111 = getelementptr inbounds double, double* %110, i64 4
%112 = call i32 @pd_fast_renorm(double %96, double %97, double %98, double %99, double %100, double %101, double* %103, double* %105, double* %107, double* %109, double* %111)
ret void
}

LLVM IR (-O2):
define void @pd_div(double* %0, double* %1, double* %2) {
%4 = alloca [5 x double]
%5 = bitcast [5 x double]* %4 to i8*
%6 = load double, double* %0
%7 = load double, double* %1
%8 = fdiv double %6, %7
%9 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%10 = call i32 @pd_mul_pd_d(double* %1, double %8, double* %9)
%11 = call i32 @pd_sub(double* %0, double* %9, double* %2)
%12 = load double, double* %2
%13 = load double, double* %1
%14 = fdiv double %12, %13
%15 = call i32 @pd_mul_pd_d(double* %1, double %14, double* %9)
%16 = call i32 @pd_sub(double* %2, double* %9, double* %2)
%17 = load double, double* %2
%18 = load double, double* %1
%19 = fdiv double %17, %18
%20 = call i32 @pd_mul_pd_d(double* %1, double %19, double* %9)
%21 = call i32 @pd_sub(double* %2, double* %9, double* %2)
%22 = load double, double* %2
%23 = load double, double* %1
%24 = fdiv double %22, %23
%25 = call i32 @pd_mul_pd_d(double* %1, double %24, double* %9)
%26 = call i32 @pd_sub(double* %2, double* %9, double* %2)
%27 = load double, double* %2
%28 = load double, double* %1
%29 = fdiv double %27, %28
%30 = call i32 @pd_mul_pd_d(double* %1, double %29, double* %9)
%31 = call i32 @pd_sub(double* %2, double* %9, double* %2)
%32 = load double, double* %2
%33 = load double, double* %1
%34 = fdiv double %32, %33
%35 = getelementptr inbounds double, double* %2, i64 1
%36 = getelementptr inbounds double, double* %2, i64 2
%37 = getelementptr inbounds double, double* %2, i64 3
%38 = getelementptr inbounds double, double* %2, i64 4
%39 = call i32 @pd_fast_renorm(double %8, double %14, double %19, double %24, double %29, double %34, double* %2, double* %35, double* %36, double* %37, double* %38)
ret void
}