#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 */
double sin(double);
double sinth0(double *X0, double *X, void (*vofx)(double *, double *)) {
  double V0[(4)];
  double Vc0[(4)];
  double Xc0[(4)];
  int j;
  for (j = 0; j < (4); j++)
    Xc0[j] = X[j];
  Xc0[2] = X0[2];
  vofx(Xc0, Vc0);
  vofx(X0, V0);
  return (V0[1] * sin(V0[2]) / Vc0[1]);
}


x86 assembly (clang, -O0):
<sinth0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x84(%rbp)
cmpl   $0x4,-0x84(%rbp)
jge    116f <sinth0+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x84(%rbp),%rax
movsd  %xmm0,-0x80(%rbp,%rax,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1131 <sinth0+0x21>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
lea    -0x80(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   *%rax
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   *%rax
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
divsd  -0x58(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinth0>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
movups (%rsi),%xmm0
movups 0x10(%rsi),%xmm1
movaps %xmm1,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0x10(%rsp),%rdi
lea    0x50(%rsp),%rsi
call   *%rdx
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   *%r14
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
divsd  0x58(%rsp),%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @sinth0(double* %0, double* %1, void (double*, double*)* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca void (double*, double*)*
%7 = alloca [4 x double]
%8 = alloca [4 x double]
%9 = alloca [4 x double]
%10 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store void (double*, double*)* %2, void (double*, double*)** %6
store i32 0, i32* %10
br label %11
11: ; preds = %23, %3
%12 = load i32, i32* %10
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load double*, double** %5
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 %21
store double %19, double* %22
br label %23
23: ; preds = %14
%24 = load i32, i32* %10
%25 = add nsw i32 %24, 1
store i32 %25, i32* %10
br label %11
26: ; preds = %11
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 2
store double %29, double* %30
%31 = load void (double*, double*)*, void (double*, double*)** %6
%32 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%33 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%34 = load void (double*, double*)*, void (double*, double*)** %6
%35 = load double*, double** %4
%36 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%37 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 1
%38 = load double, double* %37
%39 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 2
%40 = load double, double* %39
%41 = call double @sin(double %40)
%42 = fmul double %38, %41
%43 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 1
%44 = load double, double* %43
%45 = fdiv double %42, %44
ret double %45
}

LLVM IR (-O2):
define double @sinth0(double* %0, double* nocapture %1, void (double*, double*)* nocapture %2) {
%4 = bitcast double* %1 to i8*
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = alloca [4 x double]
%8 = bitcast [4 x double]* %7 to i8*
%9 = bitcast [4 x double]* %5 to i8*
%10 = bitcast [4 x double]* %6 to i8*
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 2
store double %12, double* %13
%14 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%15 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%16 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%17 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%18 = load double, double* %17
%19 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
%20 = load double, double* %19
%21 = call double @sin(double %20)
%22 = fmul double %18, %21
%23 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 1
%24 = load double, double* %23
%25 = fdiv double %22, %24
ret double %25
}