; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_BVHParser)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._RcsGraph = type { ptr, [10 x %struct._RcsBody], i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct._RcsBody = type { double, i8, i32, [3 x double], [3 x double], double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.HTr = type { [3 x double], [3 x [3 x double]] }
%struct._RcsJoint = type { ptr, double, double, double, double, double, double, double, i8, i32, i32, i32, i32, ptr, %struct.HTr, double, double, double, double, i32, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@__func__.RcsGraph_createFromBVHFile = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@Rcs_calloc = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @RcsGraph_createFromBVHFile(ptr noundef %0, double noundef %1, i1 noundef zeroext %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca [64 x i8], align 16
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noalias ptr @fopen(ptr noundef %19, ptr noundef @.str)
  store ptr %20, ptr %8, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %44

23:                                               ; preds = %3
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %28(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 415, ptr noundef @.str.2, ptr noundef %29)
  br label %30

30:                                               ; preds = %27, %24
  %31 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %32 = icmp sle i32 1, %31
  br i1 %32, label %33, label %41

33:                                               ; preds = %30
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.3, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 415) #7
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.2, ptr noundef %37) #7
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.4) #7
  br label %41

41:                                               ; preds = %33, %30
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %355

44:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #7
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 0, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !13
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %47 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %45, ptr noundef @.str.5, ptr noundef %46)
  store i32 %47, ptr %12, align 4, !tbaa !13
  %48 = load i32, ptr %12, align 4, !tbaa !13
  %49 = icmp slt i32 %48, 1
  br i1 %49, label %50, label %71

50:                                               ; preds = %44
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %56

54:                                               ; preds = %51
  %55 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %55(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 428, ptr noundef @.str.6)
  br label %56

56:                                               ; preds = %54, %51
  %57 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %58 = icmp sle i32 1, %57
  br i1 %58, label %59, label %66

59:                                               ; preds = %56
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.3, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 428) #7
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.6) #7
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.4) #7
  br label %66

66:                                               ; preds = %59, %56
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = call i32 @fclose(ptr noundef %69)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %354

71:                                               ; preds = %44
  %72 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %73 = call i32 @strcasecmp(ptr noundef %72, ptr noundef @.str.7) #8
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %96, label %75

75:                                               ; preds = %71
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %81

79:                                               ; preds = %76
  %80 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %80(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 435, ptr noundef @.str.8)
  br label %81

81:                                               ; preds = %79, %76
  %82 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %83 = icmp sle i32 1, %82
  br i1 %83, label %84, label %91

84:                                               ; preds = %81
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.3, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 435) #7
  %87 = load ptr, ptr @stderr, align 8, !tbaa !5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.8) #7
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.4) #7
  br label %91

91:                                               ; preds = %84, %81
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = call i32 @fclose(ptr noundef %94)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %354

96:                                               ; preds = %71
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %99 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %97, ptr noundef @.str.5, ptr noundef %98)
  store i32 %99, ptr %12, align 4, !tbaa !13
  %100 = load i32, ptr %12, align 4, !tbaa !13
  %101 = icmp slt i32 %100, 1
  br i1 %101, label %102, label %123

102:                                              ; preds = %96
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %108

106:                                              ; preds = %103
  %107 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %107(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 445, ptr noundef @.str.9)
  br label %108

108:                                              ; preds = %106, %103
  %109 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %110 = icmp sle i32 1, %109
  br i1 %110, label %111, label %118

111:                                              ; preds = %108
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.3, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 445) #7
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.9) #7
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.4) #7
  br label %118

118:                                              ; preds = %111, %108
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call i32 @fclose(ptr noundef %121)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %354

123:                                              ; preds = %96
  %124 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %125 = call i32 @strcasecmp(ptr noundef %124, ptr noundef @.str.10) #8
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %148, label %127

127:                                              ; preds = %123
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %133

131:                                              ; preds = %128
  %132 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %132(i32 noundef 1, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 452, ptr noundef @.str.11)
  br label %133

133:                                              ; preds = %131, %128
  %134 = load i32, ptr @RcsLogLevel, align 4, !tbaa !13
  %135 = icmp sle i32 1, %134
  br i1 %135, label %136, label %143

136:                                              ; preds = %133
  %137 = load ptr, ptr @stderr, align 8, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.3, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 452) #7
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.11) #7
  %141 = load ptr, ptr @stderr, align 8, !tbaa !5
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.4) #7
  br label %143

143:                                              ; preds = %136, %133
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = call i32 @fclose(ptr noundef %146)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %354

148:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %149 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %150 = call ptr %149(i64 noundef 1, i64 noundef 1896)
  store ptr %150, ptr %13, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %148
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = icmp ne ptr %152, null
  br i1 %153, label %157, label %154

154:                                              ; preds = %151
  %155 = load ptr, ptr @stderr, align 8, !tbaa !5
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.12, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 460, ptr noundef @.str.13) #7
  call void @print_trace()
  call void @abort() #9
  unreachable

157:                                              ; preds = %151
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = call ptr @String_clone(ptr noundef %160)
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._RcsGraph, ptr %162, i32 0, i32 6
  store ptr %161, ptr %163, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._RcsGraph, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !17
  store ptr %166, ptr %14, align 8, !tbaa !5
  %167 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %168 = trunc i8 %167 to i1
  %169 = zext i1 %168 to i32
  %170 = icmp eq i32 %169, 1
  br i1 %170, label %171, label %201

171:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %172 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %173 = call ptr %172(i64 noundef 1, i64 noundef 184)
  store ptr %173, ptr %15, align 8, !tbaa !5
  %174 = call ptr @HTr_create()
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._RcsBody, ptr %175, i32 0, i32 10
  store ptr %174, ptr %176, align 8, !tbaa !20
  %177 = call ptr @String_clone(ptr noundef @.str.14)
  %178 = load ptr, ptr %15, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct._RcsBody, ptr %178, i32 0, i32 6
  store ptr %177, ptr %179, align 8, !tbaa !22
  %180 = call ptr @HTr_create()
  %181 = load ptr, ptr %15, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct._RcsBody, ptr %181, i32 0, i32 11
  store ptr %180, ptr %182, align 8, !tbaa !23
  %183 = call ptr @HTr_create()
  %184 = load ptr, ptr %15, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._RcsBody, ptr %184, i32 0, i32 9
  store ptr %183, ptr %185, align 8, !tbaa !24
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._RcsBody, ptr %186, i32 0, i32 9
  %188 = load ptr, ptr %187, align 8, !tbaa !24
  %189 = getelementptr inbounds %struct.HTr, ptr %188, i32 0, i32 1
  %190 = getelementptr inbounds [3 x [3 x double]], ptr %189, i64 0, i64 0
  call void @Mat3d_fromEulerAngles2(ptr noundef %190, double noundef 0x3FF921FB54442D18, double noundef 0x3FF921FB54442D18, double noundef 0.000000e+00)
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._RcsBody, ptr %191, i32 0, i32 11
  %193 = load ptr, ptr %192, align 8, !tbaa !23
  %194 = getelementptr inbounds %struct.HTr, ptr %193, i32 0, i32 1
  %195 = getelementptr inbounds [3 x [3 x double]], ptr %194, i64 0, i64 0
  call void @Mat3d_setZero(ptr noundef %195)
  %196 = load ptr, ptr %15, align 8, !tbaa !5
  %197 = call ptr @createFrameShape(double noundef 1.000000e+00)
  call void @RcsBody_addShape(ptr noundef %196, ptr noundef %197)
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  call void @RcsGraph_insertBody(ptr noundef %198, ptr noundef null, ptr noundef %199)
  %200 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %200, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %201

201:                                              ; preds = %171, %159
  %202 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = load ptr, ptr %14, align 8, !tbaa !5
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = call ptr (...) @Vec3d_zeroVec()
  %207 = load double, ptr %6, align 8, !tbaa !9
  %208 = load i8, ptr %7, align 1, !tbaa !11, !range !18, !noundef !19
  %209 = trunc i8 %208 to i1
  %210 = call zeroext i1 @parseRecursive(ptr noundef %202, ptr noundef %203, ptr noundef %204, ptr noundef %205, ptr noundef %206, double noundef %207, i1 noundef zeroext %209)
  %211 = zext i1 %210 to i8
  store i8 %211, ptr %11, align 1, !tbaa !11
  br label %212

212:                                              ; preds = %201
  %213 = load i8, ptr %11, align 1, !tbaa !11, !range !18, !noundef !19
  %214 = trunc i8 %213 to i1
  br i1 %214, label %218, label %215

215:                                              ; preds = %212
  %216 = load ptr, ptr @stderr, align 8, !tbaa !5
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.12, ptr noundef @.str.1, ptr noundef @__func__.RcsGraph_createFromBVHFile, i32 noundef 481, ptr noundef @.str.15) #7
  call void @print_trace()
  call void @abort() #9
  unreachable

218:                                              ; preds = %212
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = call i32 @fclose(ptr noundef %221)
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  %224 = call zeroext i1 @RcsGraph_setState(ptr noundef %223, ptr noundef null, ptr noundef null)
  %225 = load ptr, ptr %13, align 8, !tbaa !5
  call void @addGeometry(ptr noundef %225)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %226 = load ptr, ptr %13, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct._RcsGraph, ptr %226, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8, !tbaa !17
  store ptr %228, ptr %16, align 8, !tbaa !5
  br label %229

229:                                              ; preds = %338, %220
  %230 = load ptr, ptr %16, align 8, !tbaa !5
  %231 = icmp ne ptr %230, null
  br i1 %231, label %233, label %232

232:                                              ; preds = %229
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %341

233:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct._RcsBody, ptr %234, i32 0, i32 18
  %236 = load ptr, ptr %235, align 8, !tbaa !25
  store ptr %236, ptr %17, align 8, !tbaa !5
  br label %237

237:                                              ; preds = %333, %233
  %238 = load ptr, ptr %17, align 8, !tbaa !5
  %239 = icmp ne ptr %238, null
  br i1 %239, label %241, label %240

240:                                              ; preds = %237
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %337

241:                                              ; preds = %237
  %242 = load ptr, ptr %16, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct._RcsBody, ptr %242, i32 0, i32 18
  %244 = load ptr, ptr %243, align 8, !tbaa !25
  %245 = getelementptr inbounds %struct._RcsJoint, ptr %244, i32 0, i32 13
  %246 = load ptr, ptr %245, align 8, !tbaa !26
  %247 = icmp eq ptr %246, null
  br i1 %247, label %248, label %249

248:                                              ; preds = %241
  br label %333

249:                                              ; preds = %241
  %250 = load ptr, ptr %17, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct._RcsJoint, ptr %250, i32 0, i32 9
  %252 = load i32, ptr %251, align 4, !tbaa !29
  %253 = icmp eq i32 %252, 3
  br i1 %253, label %254, label %276

254:                                              ; preds = %249
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct._RcsGraph, ptr %255, i32 0, i32 4
  %257 = load ptr, ptr %256, align 8, !tbaa !30
  %258 = load ptr, ptr %17, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct._RcsJoint, ptr %258, i32 0, i32 11
  %260 = load i32, ptr %259, align 4, !tbaa !31
  %261 = load ptr, ptr %16, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._RcsBody, ptr %261, i32 0, i32 18
  %263 = load ptr, ptr %262, align 8, !tbaa !25
  %264 = getelementptr inbounds %struct._RcsJoint, ptr %263, i32 0, i32 13
  %265 = load ptr, ptr %264, align 8, !tbaa !26
  %266 = getelementptr inbounds %struct.HTr, ptr %265, i32 0, i32 0
  %267 = getelementptr inbounds [3 x double], ptr %266, i64 0, i64 0
  %268 = load double, ptr %267, align 8, !tbaa !9
  call void @MatNd_set(ptr noundef %257, i32 noundef %260, i32 noundef 0, double noundef %268)
  %269 = load ptr, ptr %16, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct._RcsBody, ptr %269, i32 0, i32 18
  %271 = load ptr, ptr %270, align 8, !tbaa !25
  %272 = getelementptr inbounds %struct._RcsJoint, ptr %271, i32 0, i32 13
  %273 = load ptr, ptr %272, align 8, !tbaa !26
  %274 = getelementptr inbounds %struct.HTr, ptr %273, i32 0, i32 0
  %275 = getelementptr inbounds [3 x double], ptr %274, i64 0, i64 0
  store double 0.000000e+00, ptr %275, align 8, !tbaa !9
  br label %332

276:                                              ; preds = %249
  %277 = load ptr, ptr %17, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._RcsJoint, ptr %277, i32 0, i32 9
  %279 = load i32, ptr %278, align 4, !tbaa !29
  %280 = icmp eq i32 %279, 4
  br i1 %280, label %281, label %303

281:                                              ; preds = %276
  %282 = load ptr, ptr %13, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct._RcsGraph, ptr %282, i32 0, i32 4
  %284 = load ptr, ptr %283, align 8, !tbaa !30
  %285 = load ptr, ptr %17, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct._RcsJoint, ptr %285, i32 0, i32 11
  %287 = load i32, ptr %286, align 4, !tbaa !31
  %288 = load ptr, ptr %16, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct._RcsBody, ptr %288, i32 0, i32 18
  %290 = load ptr, ptr %289, align 8, !tbaa !25
  %291 = getelementptr inbounds %struct._RcsJoint, ptr %290, i32 0, i32 13
  %292 = load ptr, ptr %291, align 8, !tbaa !26
  %293 = getelementptr inbounds %struct.HTr, ptr %292, i32 0, i32 0
  %294 = getelementptr inbounds [3 x double], ptr %293, i64 0, i64 1
  %295 = load double, ptr %294, align 8, !tbaa !9
  call void @MatNd_set(ptr noundef %284, i32 noundef %287, i32 noundef 0, double noundef %295)
  %296 = load ptr, ptr %16, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct._RcsBody, ptr %296, i32 0, i32 18
  %298 = load ptr, ptr %297, align 8, !tbaa !25
  %299 = getelementptr inbounds %struct._RcsJoint, ptr %298, i32 0, i32 13
  %300 = load ptr, ptr %299, align 8, !tbaa !26
  %301 = getelementptr inbounds %struct.HTr, ptr %300, i32 0, i32 0
  %302 = getelementptr inbounds [3 x double], ptr %301, i64 0, i64 1
  store double 0.000000e+00, ptr %302, align 8, !tbaa !9
  br label %331

303:                                              ; preds = %276
  %304 = load ptr, ptr %17, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct._RcsJoint, ptr %304, i32 0, i32 9
  %306 = load i32, ptr %305, align 4, !tbaa !29
  %307 = icmp eq i32 %306, 5
  br i1 %307, label %308, label %330

308:                                              ; preds = %303
  %309 = load ptr, ptr %13, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct._RcsGraph, ptr %309, i32 0, i32 4
  %311 = load ptr, ptr %310, align 8, !tbaa !30
  %312 = load ptr, ptr %17, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct._RcsJoint, ptr %312, i32 0, i32 11
  %314 = load i32, ptr %313, align 4, !tbaa !31
  %315 = load ptr, ptr %16, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct._RcsBody, ptr %315, i32 0, i32 18
  %317 = load ptr, ptr %316, align 8, !tbaa !25
  %318 = getelementptr inbounds %struct._RcsJoint, ptr %317, i32 0, i32 13
  %319 = load ptr, ptr %318, align 8, !tbaa !26
  %320 = getelementptr inbounds %struct.HTr, ptr %319, i32 0, i32 0
  %321 = getelementptr inbounds [3 x double], ptr %320, i64 0, i64 2
  %322 = load double, ptr %321, align 8, !tbaa !9
  call void @MatNd_set(ptr noundef %311, i32 noundef %314, i32 noundef 0, double noundef %322)
  %323 = load ptr, ptr %16, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct._RcsBody, ptr %323, i32 0, i32 18
  %325 = load ptr, ptr %324, align 8, !tbaa !25
  %326 = getelementptr inbounds %struct._RcsJoint, ptr %325, i32 0, i32 13
  %327 = load ptr, ptr %326, align 8, !tbaa !26
  %328 = getelementptr inbounds %struct.HTr, ptr %327, i32 0, i32 0
  %329 = getelementptr inbounds [3 x double], ptr %328, i64 0, i64 2
  store double 0.000000e+00, ptr %329, align 8, !tbaa !9
  br label %330

330:                                              ; preds = %308, %303
  br label %331

331:                                              ; preds = %330, %281
  br label %332

332:                                              ; preds = %331, %254
  br label %333

333:                                              ; preds = %332, %248
  %334 = load ptr, ptr %17, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct._RcsJoint, ptr %334, i32 0, i32 23
  %336 = load ptr, ptr %335, align 8, !tbaa !32
  store ptr %336, ptr %17, align 8, !tbaa !5
  br label %237, !llvm.loop !33

337:                                              ; preds = %240
  br label %338

338:                                              ; preds = %337
  %339 = load ptr, ptr %16, align 8, !tbaa !5
  %340 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef %339)
  store ptr %340, ptr %16, align 8, !tbaa !5
  br label %229, !llvm.loop !35

341:                                              ; preds = %232
  %342 = load ptr, ptr %13, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct._RcsGraph, ptr %342, i32 0, i32 2
  %344 = load i32, ptr %343, align 8, !tbaa !36
  %345 = call ptr @MatNd_create(i32 noundef %344, i32 noundef 1)
  %346 = load ptr, ptr %13, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct._RcsGraph, ptr %346, i32 0, i32 5
  store ptr %345, ptr %347, align 8, !tbaa !37
  %348 = load ptr, ptr %13, align 8, !tbaa !5
  %349 = load double, ptr %6, align 8, !tbaa !9
  %350 = call zeroext i1 @RcsGraph_beautifyHumanModelBVH(ptr noundef %348, double noundef %349)
  %351 = load ptr, ptr %13, align 8, !tbaa !5
  %352 = call zeroext i1 @RcsGraph_setState(ptr noundef %351, ptr noundef null, ptr noundef null)
  %353 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %353, ptr %4, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %354

354:                                              ; preds = %341, %145, %120, %93, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #7
  br label %355

355:                                              ; preds = %354, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %356 = load ptr, ptr %4, align 8
  ret ptr %356
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr noundef, ptr noundef) #5

declare void @print_trace() #2

; Function Attrs: noreturn nounwind
declare void @abort() #6

declare ptr @String_clone(ptr noundef) #2

declare ptr @HTr_create() #2

declare void @Mat3d_fromEulerAngles2(ptr noundef, double noundef, double noundef, double noundef) #2

declare void @Mat3d_setZero(ptr noundef) #2

declare void @RcsBody_addShape(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @createFrameShape(double noundef) #0

declare void @RcsGraph_insertBody(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @parseRecursive(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, i1 noundef zeroext) #0

declare ptr @Vec3d_zeroVec(...) #2

declare zeroext i1 @RcsGraph_setState(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @addGeometry(ptr noundef) #0

declare void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) #2

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) #2

declare ptr @MatNd_create(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @RcsGraph_beautifyHumanModelBVH(ptr noundef, double noundef) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 1872}
!16 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !14, i64 1848, !14, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!17 = !{!16, !6, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !6, i64 104}
!21 = !{!"_RcsBody", !10, i64 0, !12, i64 8, !14, i64 12, !7, i64 16, !7, i64 40, !10, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!22 = !{!21, !6, i64 72}
!23 = !{!21, !6, i64 112}
!24 = !{!21, !6, i64 96}
!25 = !{!21, !6, i64 168}
!26 = !{!27, !6, i64 88}
!27 = !{!"_RcsJoint", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !12, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !6, i64 88, !28, i64 96, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !14, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!28 = !{!"", !7, i64 0, !7, i64 24}
!29 = !{!27, !14, i64 68}
!30 = !{!16, !6, i64 1856}
!31 = !{!27, !14, i64 76}
!32 = !{!27, !6, i64 256}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{!16, !14, i64 1848}
!37 = !{!16, !6, i64 1864}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@__func__.RcsGraph_createFromBVHFile = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@Rcs_calloc = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @RcsGraph_createFromBVHFile(ptr noundef %0, double noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca [64 x i8], align 16
  %5 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %20

7:                                                ; preds = %3
  %8 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not82 = icmp eq ptr %8, null
  br i1 %.not82, label %10, label %9

9:                                                ; preds = %7
  tail call void (i32, ptr, ptr, i32, ptr, ...) %8(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 415, ptr noundef nonnull @.str.2, ptr noundef %0) #7
  br label %10

10:                                               ; preds = %9, %7
  %11 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %13, label %178

13:                                               ; preds = %10
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 415) #8
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.2, ptr noundef %0) #8
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.4) #8
  br label %178

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %4, i8 0, i64 64, i1 false)
  %21 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %5, ptr noundef nonnull @.str.5, ptr noundef nonnull %4) #7
  %22 = icmp slt i32 %21, 1
  br i1 %22, label %23, label %38

23:                                               ; preds = %20
  %24 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not81 = icmp eq ptr %24, null
  br i1 %.not81, label %26, label %25

25:                                               ; preds = %23
  call void (i32, ptr, ptr, i32, ptr, ...) %24(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 428, ptr noundef nonnull @.str.6) #7
  br label %26

26:                                               ; preds = %25, %23
  %27 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %36

29:                                               ; preds = %26
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 428) #8
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.6) #8
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.4) #8
  br label %36

36:                                               ; preds = %29, %26
  %37 = call i32 @fclose(ptr noundef nonnull %5)
  br label %177

38:                                               ; preds = %20
  %39 = call i32 @strcasecmp(ptr noundef nonnull %4, ptr noundef nonnull @.str.7) #9
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %56, label %41

41:                                               ; preds = %38
  %42 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not = icmp eq ptr %42, null
  br i1 %.not, label %44, label %43

43:                                               ; preds = %41
  call void (i32, ptr, ptr, i32, ptr, ...) %42(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 435, ptr noundef nonnull @.str.8) #7
  br label %44

44:                                               ; preds = %43, %41
  %45 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %54

47:                                               ; preds = %44
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 435) #8
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.8) #8
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.4) #8
  br label %54

54:                                               ; preds = %47, %44
  %55 = call i32 @fclose(ptr noundef nonnull %5)
  br label %177

56:                                               ; preds = %38
  %57 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %5, ptr noundef nonnull @.str.5, ptr noundef nonnull %4) #7
  %58 = icmp slt i32 %57, 1
  br i1 %58, label %59, label %74

59:                                               ; preds = %56
  %60 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not80 = icmp eq ptr %60, null
  br i1 %.not80, label %62, label %61

61:                                               ; preds = %59
  call void (i32, ptr, ptr, i32, ptr, ...) %60(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 445, ptr noundef nonnull @.str.9) #7
  br label %62

62:                                               ; preds = %61, %59
  %63 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %65, label %72

65:                                               ; preds = %62
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 445) #8
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.9) #8
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.4) #8
  br label %72

72:                                               ; preds = %65, %62
  %73 = call i32 @fclose(ptr noundef nonnull %5)
  br label %177

74:                                               ; preds = %56
  %75 = call i32 @strcasecmp(ptr noundef nonnull %4, ptr noundef nonnull @.str.10) #9
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %92, label %77

77:                                               ; preds = %74
  %78 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not76 = icmp eq ptr %78, null
  br i1 %.not76, label %80, label %79

79:                                               ; preds = %77
  call void (i32, ptr, ptr, i32, ptr, ...) %78(i32 noundef 1, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 452, ptr noundef nonnull @.str.11) #7
  br label %80

80:                                               ; preds = %79, %77
  %81 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 452) #8
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.11) #8
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.4) #8
  br label %90

90:                                               ; preds = %83, %80
  %91 = call i32 @fclose(ptr noundef nonnull %5)
  br label %177

92:                                               ; preds = %74
  %93 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %94 = call ptr %93(i64 noundef 1, i64 noundef 1896) #7
  %.not77 = icmp eq ptr %94, null
  br i1 %.not77, label %95, label %98

95:                                               ; preds = %92
  %96 = load ptr, ptr @stderr, align 8, !tbaa !5
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 460, ptr noundef nonnull @.str.13) #8
  call void @print_trace() #7
  call void @abort() #10
  unreachable

98:                                               ; preds = %92
  %99 = call ptr @String_clone(ptr noundef %0) #7
  %100 = getelementptr inbounds i8, ptr %94, i64 1872
  store ptr %99, ptr %100, align 8, !tbaa !11
  %101 = load ptr, ptr %94, align 8, !tbaa !13
  br i1 %2, label %102, label %117

102:                                              ; preds = %98
  %103 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %104 = call ptr %103(i64 noundef 1, i64 noundef 184) #7
  %105 = call ptr @HTr_create() #7
  %106 = getelementptr inbounds i8, ptr %104, i64 104
  store ptr %105, ptr %106, align 8, !tbaa !14
  %107 = call ptr @String_clone(ptr noundef nonnull @.str.14) #7
  %108 = getelementptr inbounds i8, ptr %104, i64 72
  store ptr %107, ptr %108, align 8, !tbaa !18
  %109 = call ptr @HTr_create() #7
  %110 = getelementptr inbounds i8, ptr %104, i64 112
  store ptr %109, ptr %110, align 8, !tbaa !19
  %111 = call ptr @HTr_create() #7
  %112 = getelementptr inbounds i8, ptr %104, i64 96
  store ptr %111, ptr %112, align 8, !tbaa !20
  %113 = getelementptr inbounds i8, ptr %111, i64 24
  call void @Mat3d_fromEulerAngles2(ptr noundef nonnull %113, double noundef 0x3FF921FB54442D18, double noundef 0x3FF921FB54442D18, double noundef 0.000000e+00) #7
  %114 = load ptr, ptr %110, align 8, !tbaa !19
  %115 = getelementptr inbounds i8, ptr %114, i64 24
  call void @Mat3d_setZero(ptr noundef nonnull %115) #7
  %116 = call ptr @createFrameShape(double noundef 1.000000e+00)
  call void @RcsBody_addShape(ptr noundef %104, ptr noundef %116) #7
  call void @RcsGraph_insertBody(ptr noundef nonnull %94, ptr noundef null, ptr noundef %104) #7
  br label %117

117:                                              ; preds = %102, %98
  %.066 = phi ptr [ %104, %102 ], [ %101, %98 ]
  %118 = call ptr (...) @Vec3d_zeroVec() #7
  %119 = call zeroext i1 @parseRecursive(ptr noundef nonnull %4, ptr noundef nonnull %94, ptr noundef %.066, ptr noundef nonnull %5, ptr noundef %118, double noundef %1, i1 noundef zeroext %2)
  br i1 %119, label %123, label %120

120:                                              ; preds = %117
  %121 = load ptr, ptr @stderr, align 8, !tbaa !5
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.RcsGraph_createFromBVHFile, i32 noundef 481, ptr noundef nonnull @.str.15) #8
  call void @print_trace() #7
  call void @abort() #10
  unreachable

123:                                              ; preds = %117
  %124 = call i32 @fclose(ptr noundef nonnull %5)
  %125 = call zeroext i1 @RcsGraph_setState(ptr noundef nonnull %94, ptr noundef null, ptr noundef null) #7
  call void @addGeometry(ptr noundef nonnull %94)
  %126 = load ptr, ptr %94, align 8, !tbaa !13
  %.not7886 = icmp eq ptr %126, null
  br i1 %.not7886, label %._crit_edge90, label %.lr.ph89

.lr.ph89:                                         ; preds = %123
  %127 = getelementptr inbounds i8, ptr %94, i64 1856
  br label %134

._crit_edge90:                                    ; preds = %._crit_edge, %123
  %128 = getelementptr inbounds i8, ptr %94, i64 1848
  %129 = load i32, ptr %128, align 8, !tbaa !21
  %130 = call ptr @MatNd_create(i32 noundef %129, i32 noundef 1) #7
  %131 = getelementptr inbounds i8, ptr %94, i64 1864
  store ptr %130, ptr %131, align 8, !tbaa !22
  %132 = call zeroext i1 @RcsGraph_beautifyHumanModelBVH(ptr noundef nonnull %94, double noundef %1)
  %133 = call zeroext i1 @RcsGraph_setState(ptr noundef nonnull %94, ptr noundef null, ptr noundef null) #7
  br label %177

134:                                              ; preds = %.lr.ph89, %._crit_edge
  %.06487 = phi ptr [ %126, %.lr.ph89 ], [ %139, %._crit_edge ]
  %135 = getelementptr inbounds i8, ptr %.06487, i64 168
  %.083 = load ptr, ptr %135, align 8, !tbaa !5
  %.not7984 = icmp eq ptr %.083, null
  br i1 %.not7984, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %134
  %136 = getelementptr inbounds i8, ptr %.083, i64 88
  %137 = load ptr, ptr %136, align 8, !tbaa !23
  %138 = icmp eq ptr %137, null
  br i1 %138, label %._crit_edge, label %.lr.ph.split

._crit_edge:                                      ; preds = %175, %.lr.ph, %134
  %139 = call ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef nonnull %.06487) #7
  %.not78 = icmp eq ptr %139, null
  br i1 %.not78, label %._crit_edge90, label %134, !llvm.loop !26

.lr.ph.split:                                     ; preds = %.lr.ph, %175
  %.085 = phi ptr [ %.0, %175 ], [ %.083, %.lr.ph ]
  %140 = load ptr, ptr %135, align 8, !tbaa !28
  %141 = getelementptr inbounds i8, ptr %140, i64 88
  %142 = load ptr, ptr %141, align 8, !tbaa !23
  %143 = icmp eq ptr %142, null
  br i1 %143, label %175, label %144

144:                                              ; preds = %.lr.ph.split
  %145 = getelementptr inbounds i8, ptr %.085, i64 68
  %146 = load i32, ptr %145, align 4, !tbaa !29
  switch i32 %146, label %175 [
    i32 3, label %147
    i32 4, label %155
    i32 5, label %165
  ]

147:                                              ; preds = %144
  %148 = load ptr, ptr %127, align 8, !tbaa !30
  %149 = getelementptr inbounds i8, ptr %.085, i64 76
  %150 = load i32, ptr %149, align 4, !tbaa !31
  %151 = load double, ptr %142, align 8, !tbaa !32
  call void @MatNd_set(ptr noundef %148, i32 noundef %150, i32 noundef 0, double noundef %151) #7
  %152 = load ptr, ptr %135, align 8, !tbaa !28
  %153 = getelementptr inbounds i8, ptr %152, i64 88
  %154 = load ptr, ptr %153, align 8, !tbaa !23
  br label %.sink.split

155:                                              ; preds = %144
  %156 = load ptr, ptr %127, align 8, !tbaa !30
  %157 = getelementptr inbounds i8, ptr %.085, i64 76
  %158 = load i32, ptr %157, align 4, !tbaa !31
  %159 = getelementptr inbounds i8, ptr %142, i64 8
  %160 = load double, ptr %159, align 8, !tbaa !32
  call void @MatNd_set(ptr noundef %156, i32 noundef %158, i32 noundef 0, double noundef %160) #7
  %161 = load ptr, ptr %135, align 8, !tbaa !28
  %162 = getelementptr inbounds i8, ptr %161, i64 88
  %163 = load ptr, ptr %162, align 8, !tbaa !23
  %164 = getelementptr inbounds i8, ptr %163, i64 8
  br label %.sink.split

165:                                              ; preds = %144
  %166 = load ptr, ptr %127, align 8, !tbaa !30
  %167 = getelementptr inbounds i8, ptr %.085, i64 76
  %168 = load i32, ptr %167, align 4, !tbaa !31
  %169 = getelementptr inbounds i8, ptr %142, i64 16
  %170 = load double, ptr %169, align 8, !tbaa !32
  call void @MatNd_set(ptr noundef %166, i32 noundef %168, i32 noundef 0, double noundef %170) #7
  %171 = load ptr, ptr %135, align 8, !tbaa !28
  %172 = getelementptr inbounds i8, ptr %171, i64 88
  %173 = load ptr, ptr %172, align 8, !tbaa !23
  %174 = getelementptr inbounds i8, ptr %173, i64 16
  br label %.sink.split

.sink.split:                                      ; preds = %155, %165, %147
  %.sink = phi ptr [ %154, %147 ], [ %174, %165 ], [ %164, %155 ]
  store double 0.000000e+00, ptr %.sink, align 8, !tbaa !32
  br label %175

175:                                              ; preds = %.sink.split, %144, %.lr.ph.split
  %176 = getelementptr inbounds i8, ptr %.085, i64 256
  %.0 = load ptr, ptr %176, align 8, !tbaa !5
  %.not79 = icmp eq ptr %.0, null
  br i1 %.not79, label %._crit_edge, label %.lr.ph.split, !llvm.loop !33

177:                                              ; preds = %._crit_edge90, %90, %72, %54, %36
  %.065 = phi ptr [ null, %36 ], [ null, %72 ], [ %94, %._crit_edge90 ], [ null, %90 ], [ null, %54 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #7
  br label %178

178:                                              ; preds = %10, %13, %177
  %.1 = phi ptr [ %.065, %177 ], [ null, %13 ], [ null, %10 ]
  ret ptr %.1
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

declare void @print_trace() local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

declare ptr @String_clone(ptr noundef) local_unnamed_addr #4

declare ptr @HTr_create() local_unnamed_addr #4

declare void @Mat3d_fromEulerAngles2(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #4

declare void @Mat3d_setZero(ptr noundef) local_unnamed_addr #4

declare void @RcsBody_addShape(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden ptr @createFrameShape(double noundef) local_unnamed_addr #0

declare void @RcsGraph_insertBody(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @parseRecursive(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, i1 noundef zeroext) local_unnamed_addr #0

declare ptr @Vec3d_zeroVec(...) local_unnamed_addr #4

declare zeroext i1 @RcsGraph_setState(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @addGeometry(ptr noundef) local_unnamed_addr #0

declare void @MatNd_set(ptr noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #4

declare ptr @RcsBody_depthFirstTraversalGetNext(ptr noundef) local_unnamed_addr #4

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @RcsGraph_beautifyHumanModelBVH(ptr noundef, double noundef) local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 1872}
!12 = !{!"_RcsGraph", !6, i64 0, !7, i64 8, !10, i64 1848, !10, i64 1852, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888}
!13 = !{!12, !6, i64 0}
!14 = !{!15, !6, i64 104}
!15 = !{!"_RcsBody", !16, i64 0, !17, i64 8, !10, i64 12, !7, i64 16, !7, i64 40, !16, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!15, !6, i64 72}
!19 = !{!15, !6, i64 112}
!20 = !{!15, !6, i64 96}
!21 = !{!12, !10, i64 1848}
!22 = !{!12, !6, i64 1864}
!23 = !{!24, !6, i64 88}
!24 = !{!"_RcsJoint", !6, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !17, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !6, i64 88, !25, i64 96, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !10, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!25 = !{!"", !7, i64 0, !7, i64 24}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!15, !6, i64 168}
!29 = !{!24, !10, i64 68}
!30 = !{!12, !6, i64 1856}
!31 = !{!24, !10, i64 76}
!32 = !{!16, !16, i64 0}
!33 = distinct !{!33, !27, !34}
!34 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass