#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 atan(double);
double pow(double, int);
double sin(int);
void g08(double *x, double *f, double *g, double *h, int nx, int nf, int ng,
         int nh) {
  double pi = 4.0 * atan(1.0);
  f[0] = pow(sin(2 * pi * x[0]), 3) * sin(2 * pi * x[1]) /
         (pow(x[0], 3) * (x[0] + x[1]));
  f[0] = -f[0];
  g[0] = x[0] * x[0] - x[1] + 1.0;
  g[1] = 1.0 - x[0] + (x[1] - 4.0) * (x[1] - 4.0);
}


x86 assembly (clang, -O0):
<g08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movsd  0xeaa(%rip),%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe92(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe91(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    $0x3,%edi
call   1050 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe64(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd92(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xd7a(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xd5d(%rip),%xmm2
subsd  %xmm2,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  0xd48(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g08>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0xeb6(%rip),%xmm0
call   1040 <atan@plt>
movsd  (%rbx),%xmm0
mulsd  0xead(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    $0x3,%edi
call   1050 <pow@plt>
movapd %xmm0,0x10(%rsp)
movsd  0xe8c(%rip),%xmm0
mulsd  0x8(%rbx),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mov    $0x3,%edi
call   1050 <pow@plt>
movsd  (%rbx),%xmm1
addsd  0x8(%rbx),%xmm1
movapd 0x10(%rsp),%xmm2
xorpd  0xe6b(%rip),%xmm2
mulsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%r15)
movsd  (%rbx),%xmm0
mulsd  %xmm0,%xmm0
subsd  0x8(%rbx),%xmm0
movsd  0xe23(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
subsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm0
addsd  0xe19(%rip),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @g08(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%18 = call double @atan(double 1.000000e+00)
%19 = fmul double 4.000000e+00, %18
store double %19, double* %17
%20 = load double, double* %17
%21 = fmul double 2.000000e+00, %20
%22 = load double*, double** %9
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = fptosi double %25 to i32
%27 = call double @sin(i32 %26)
%28 = call double @pow(double %27, i32 3)
%29 = load double, double* %17
%30 = fmul double 2.000000e+00, %29
%31 = load double*, double** %9
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = fmul double %30, %33
%35 = fptosi double %34 to i32
%36 = call double @sin(i32 %35)
%37 = fmul double %28, %36
%38 = load double*, double** %9
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = call double @pow(double %40, i32 3)
%42 = load double*, double** %9
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load double*, double** %9
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = fadd double %44, %47
%49 = fmul double %41, %48
%50 = fdiv double %37, %49
%51 = load double*, double** %10
%52 = getelementptr inbounds double, double* %51, i64 0
store double %50, double* %52
%53 = load double*, double** %10
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
%56 = fneg double %55
%57 = load double*, double** %10
%58 = getelementptr inbounds double, double* %57, i64 0
store double %56, double* %58
%59 = load double*, double** %9
%60 = getelementptr inbounds double, double* %59, i64 0
%61 = load double, double* %60
%62 = load double*, double** %9
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
%65 = load double*, double** %9
%66 = getelementptr inbounds double, double* %65, i64 1
%67 = load double, double* %66
%68 = fneg double %67
%69 = call double @llvm.fmuladd.f64(double %61, double %64, double %68)
%70 = fadd double %69, 1.000000e+00
%71 = load double*, double** %11
%72 = getelementptr inbounds double, double* %71, i64 0
store double %70, double* %72
%73 = load double*, double** %9
%74 = getelementptr inbounds double, double* %73, i64 0
%75 = load double, double* %74
%76 = fsub double 1.000000e+00, %75
%77 = load double*, double** %9
%78 = getelementptr inbounds double, double* %77, i64 1
%79 = load double, double* %78
%80 = fsub double %79, 4.000000e+00
%81 = load double*, double** %9
%82 = getelementptr inbounds double, double* %81, i64 1
%83 = load double, double* %82
%84 = fsub double %83, 4.000000e+00
%85 = call double @llvm.fmuladd.f64(double %80, double %84, double %76)
%86 = load double*, double** %11
%87 = getelementptr inbounds double, double* %86, i64 1
store double %85, double* %87
ret void
}

LLVM IR (-O2):
define void @g08(double* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture readnone %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call double @atan(double 1.000000e+00)
%10 = load double, double* %0
%11 = fmul double %10, 0x401921FB54442D18
%12 = fptosi double %11 to i32
%13 = tail call double @sin(i32 %12)
%14 = tail call double @pow(double %13, i32 3)
%15 = getelementptr inbounds double, double* %0, i64 1
%16 = load double, double* %15
%17 = fmul double %16, 0x401921FB54442D18
%18 = fptosi double %17 to i32
%19 = tail call double @sin(i32 %18)
%20 = load double, double* %0
%21 = tail call double @pow(double %20, i32 3)
%22 = load double, double* %0
%23 = load double, double* %15
%24 = fadd double %22, %23
%25 = fmul double %21, %24
%26 = fneg double %14
%27 = fmul double %19, %26
%28 = fdiv double %27, %25
store double %28, double* %1
%29 = load double, double* %0
%30 = load double, double* %15
%31 = fneg double %30
%32 = tail call double @llvm.fmuladd.f64(double %29, double %29, double %31)
%33 = fadd double %32, 1.000000e+00
store double %33, double* %2
%34 = load double, double* %0
%35 = fsub double 1.000000e+00, %34
%36 = load double, double* %15
%37 = fadd double %36, -4.000000e+00
%38 = tail call double @llvm.fmuladd.f64(double %37, double %37, double %35)
%39 = getelementptr inbounds double, double* %2, i64 1
store double %38, double* %39
ret void
}