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


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

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

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

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