1 ; RUN: llvm-as < %s | llc -mtriple=armv6-apple-darwin9 -mattr=+vfp2
4 %struct.ggBRDF = type { i32 (...)** }
5 %struct.ggPoint2 = type { [2 x double] }
6 %struct.ggPoint3 = type { [3 x double] }
7 %struct.ggSpectrum = type { [8 x float] }
8 %struct.ggSphere = type { %struct.ggPoint3, double }
9 %struct.mrDiffuseAreaSphereLuminaire = type { %struct.mrSphere, %struct.ggSpectrum }
10 %struct.mrDiffuseCosineSphereLuminaire = type { %struct.mrDiffuseAreaSphereLuminaire }
11 %struct.mrSphere = type { %struct.ggBRDF, %struct.ggSphere }
13 declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
15 declare double @llvm.sqrt.f64(double) nounwind readonly
17 declare double @sin(double) nounwind readonly
19 declare double @acos(double) nounwind readonly
21 define i32 @_ZNK34mrDiffuseSolidAngleSphereLuminaire18selectVisiblePointERK8ggPoint3RK9ggVector3RK8ggPoint2dRS0_Rd(%struct.mrDiffuseCosineSphereLuminaire* nocapture %this, %struct.ggPoint3* nocapture %x, %struct.ggPoint3* nocapture %unnamed_arg, %struct.ggPoint2* nocapture %uv, double %unnamed_arg2, %struct.ggPoint3* nocapture %on_light, double* nocapture %invProb) nounwind {
23 %0 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; <double> [#uses=4]
24 %1 = fcmp ult double 0.000000e+00, %0 ; <i1> [#uses=1]
25 br i1 %1, label %bb3, label %bb7
28 %2 = fdiv double 1.000000e+00, 0.000000e+00 ; <double> [#uses=1]
29 %3 = mul double 0.000000e+00, %2 ; <double> [#uses=2]
30 %4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
31 %5 = fdiv double 1.000000e+00, %4 ; <double> [#uses=2]
32 %6 = mul double %3, %5 ; <double> [#uses=2]
33 %7 = mul double 0.000000e+00, %5 ; <double> [#uses=2]
34 %8 = mul double %3, %7 ; <double> [#uses=1]
35 %9 = sub double %8, 0.000000e+00 ; <double> [#uses=1]
36 %10 = mul double 0.000000e+00, %6 ; <double> [#uses=1]
37 %11 = sub double 0.000000e+00, %10 ; <double> [#uses=1]
38 %12 = sub double -0.000000e+00, %11 ; <double> [#uses=1]
39 %13 = mul double %0, %0 ; <double> [#uses=2]
40 %14 = sub double %13, 0.000000e+00 ; <double> [#uses=1]
41 %15 = call double @llvm.sqrt.f64(double %14) ; <double> [#uses=1]
42 %16 = mul double 0.000000e+00, %15 ; <double> [#uses=1]
43 %17 = fdiv double %16, %0 ; <double> [#uses=1]
44 %18 = add double 0.000000e+00, %17 ; <double> [#uses=1]
45 %19 = call double @acos(double %18) nounwind readonly ; <double> [#uses=1]
46 %20 = load double* null, align 4 ; <double> [#uses=1]
47 %21 = mul double %20, 0x401921FB54442D18 ; <double> [#uses=1]
48 %22 = call double @sin(double %19) nounwind readonly ; <double> [#uses=2]
49 %23 = mul double %22, 0.000000e+00 ; <double> [#uses=2]
50 %24 = mul double %6, %23 ; <double> [#uses=1]
51 %25 = mul double %7, %23 ; <double> [#uses=1]
52 %26 = call double @sin(double %21) nounwind readonly ; <double> [#uses=1]
53 %27 = mul double %22, %26 ; <double> [#uses=2]
54 %28 = mul double %9, %27 ; <double> [#uses=1]
55 %29 = mul double %27, %12 ; <double> [#uses=1]
56 %30 = add double %24, %28 ; <double> [#uses=1]
57 %31 = add double 0.000000e+00, %29 ; <double> [#uses=1]
58 %32 = add double %25, 0.000000e+00 ; <double> [#uses=1]
59 %33 = add double %30, 0.000000e+00 ; <double> [#uses=1]
60 %34 = add double %31, 0.000000e+00 ; <double> [#uses=1]
61 %35 = add double %32, 0.000000e+00 ; <double> [#uses=1]
62 %36 = bitcast %struct.ggPoint3* %x to i8* ; <i8*> [#uses=1]
63 call void @llvm.memcpy.i32(i8* null, i8* %36, i32 24, i32 4) nounwind
64 store double %33, double* null, align 8
65 br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i
67 bb5.i.i.i: ; preds = %bb3
70 _Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3
71 %37 = sub double %13, 0.000000e+00 ; <double> [#uses=0]
72 %38 = sub double -0.000000e+00, %34 ; <double> [#uses=0]
73 %39 = sub double -0.000000e+00, %35 ; <double> [#uses=0]