#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*/ fatalx(char *);
void vvd(double *a, double *b, double *c, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (c[i] == 0.0)
      fatalx("(vvd): zero value in denominator\n");
    a[i] = b[i] / c[i];
  }
}


x86 assembly (clang, -O0):
<vvd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    119b <vvd+0x8b>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1166 <vvd+0x56>
jp     1166 <vvd+0x56>
lea    0xe9f(%rip),%rdi
call   1030 <fatalx@plt>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <vvd+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vvd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
jle    1179 <vvd+0x69>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %ecx,%r13d
xor    %ebp,%ebp
lea    0xed4(%rip),%r12
jmp    1159 <vvd+0x49>
cs nopw 0x0(%rax,%rax,1)
movsd  (%r14,%rbp,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r13
je     1179 <vvd+0x69>
movsd  (%rbx,%rbp,8),%xmm0
ucomisd 0xe9a(%rip),%xmm0
jne    1140 <vvd+0x30>
jp     1140 <vvd+0x30>
mov    %r12,%rdi
call   1030 <fatalx@plt>
movsd  (%rbx,%rbp,8),%xmm0
jmp    1140 <vvd+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"(vvd): zero value in denominator\0A\00"
define void @vvd(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %39, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %8
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %42
14: ; preds = %10
%15 = load double*, double** %7
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fcmp oeq double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = call i32 @fatalx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %14
%24 = load double*, double** %6
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = load double*, double** %7
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
%33 = load double, double* %32
%34 = fdiv double %28, %33
%35 = load double*, double** %5
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
store double %34, double* %38
br label %39
39: ; preds = %23
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
store i32 %41, i32* %9
br label %10
42: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"(vvd): zero value in denominator\0A\00"
define void @vvd(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %24
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %16
%9 = phi i64 [ 0, %6 ], [ %22, %16 ]
%10 = getelementptr inbounds double, double* %2, i64 %9
%11 = load double, double* %10
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = tail call i32 @fatalx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%15 = load double, double* %10
br label %16
16: ; preds = %13, %8
%17 = phi double [ %15, %13 ], [ %11, %8 ]
%18 = getelementptr inbounds double, double* %1, i64 %9
%19 = load double, double* %18
%20 = fdiv double %19, %17
%21 = getelementptr inbounds double, double* %0, i64 %9
store double %20, double* %21
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, %7
br i1 %23, label %24, label %8
24: ; preds = %16, %4
ret void
}