; LLVM IR from interpretml/interpret :: shared/libebm (DetermineLinkFunction)

; 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.ObjectiveWrapper = type { ptr, ptr, ptr, ptr, i32, i32, i32, double, double, double, double, double, double, double, double, i32, i64, i64, i64, i32, ptr }
%struct.Config = type { i64, i32 }

@g_traceLevel = external global i32, align 4
@_ZZ21DetermineLinkFunctionE13LOG__sMessage = external hidden constant [120 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_0 = external hidden constant [68 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_1 = external hidden constant [48 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_2 = external hidden constant [59 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_3 = external hidden constant [52 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_4 = external hidden constant [29 x i8], align 16

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

declare void @InteralLogWithArguments(i32 noundef, ptr noundef, ...) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL35InitializeObjectiveWrapperUnfailingP16ObjectiveWrapper(ptr noundef) #2

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

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL29FreeObjectiveWrapperInternalsP16ObjectiveWrapper(ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN14NAMESPACE_MAINL12IdentifyTaskEi(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local i32 @DetermineLinkFunction(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #5 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %struct.ObjectiveWrapper, align 8
  %19 = alloca %struct.Config, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store i64 %2, ptr %10, align 8, !tbaa !11
  store ptr %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 3, ptr %14, align 4, !tbaa !5
  %28 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %29 = icmp sle i32 3, %28
  br i1 %29, label %30, label %37

30:                                               ; preds = %27
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !9
  %33 = load i64, ptr %10, align 8, !tbaa !11
  %34 = load ptr, ptr %11, align 8, !tbaa !9
  %35 = load ptr, ptr %12, align 8, !tbaa !9
  %36 = load ptr, ptr %13, align 8, !tbaa !9
  call void (i32, ptr, ...) @InteralLogWithArguments(i32 noundef 3, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage, i32 noundef %31, ptr noundef %32, i64 noundef %33, ptr noundef %34, ptr noundef %35, ptr noundef %36)
  br label %37

37:                                               ; preds = %30, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %38

38:                                               ; preds = %37
  %39 = load i64, ptr %10, align 8, !tbaa !11
  %40 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIllEENSt9enable_ifIXaaaaaasr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS2_EE6lowestEclsr3std14numeric_limitsIS3_EE6lowestEleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %39) #7
  br i1 %40, label %41, label %48

41:                                               ; preds = %38
  br label %42

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  %43 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %44 = icmp sle i32 1, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage_0)
  br label %46

46:                                               ; preds = %45, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %47

47:                                               ; preds = %46
  store i32 -3, ptr %7, align 4
  br label %219

48:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %49 = load i64, ptr %10, align 8, !tbaa !11
  store i64 %49, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = and i32 2, %50
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %61

53:                                               ; preds = %48
  %54 = load i64, ptr %16, align 8, !tbaa !11
  %55 = icmp slt i64 %54, 2
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  br label %59

57:                                               ; preds = %53
  %58 = load i64, ptr %16, align 8, !tbaa !11
  br label %59

59:                                               ; preds = %57, %56
  %60 = phi i64 [ 1, %56 ], [ %58, %57 ]
  store i64 %60, ptr %17, align 8, !tbaa !11
  br label %69

61:                                               ; preds = %48
  %62 = load i64, ptr %16, align 8, !tbaa !11
  %63 = icmp sle i64 %62, 2
  br i1 %63, label %64, label %65

64:                                               ; preds = %61
  br label %67

65:                                               ; preds = %61
  %66 = load i64, ptr %16, align 8, !tbaa !11
  br label %67

67:                                               ; preds = %65, %64
  %68 = phi i64 [ 1, %64 ], [ %66, %65 ]
  store i64 %68, ptr %17, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %67, %59
  call void @llvm.lifetime.start.p0(i64 160, ptr %18) #7
  call void @_ZL35InitializeObjectiveWrapperUnfailingP16ObjectiveWrapper(ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %70 = load i64, ptr %17, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.Config, ptr %19, i32 0, i32 0
  store i64 %70, ptr %71, align 8, !tbaa !13
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = and i32 1, %72
  %74 = icmp ne i32 %73, 0
  %75 = zext i1 %74 to i64
  %76 = select i1 %74, i32 1, i32 0
  %77 = getelementptr inbounds %struct.Config, ptr %19, i32 0, i32 1
  store i32 %76, ptr %77, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %78 = load ptr, ptr %9, align 8, !tbaa !9
  %79 = call noundef i32 @_ZN14NAMESPACE_MAIN12GetObjectiveEPK6ConfigPKciP16ObjectiveWrapperS6_(ptr noundef %19, ptr noundef %78, i32 noundef 0, ptr noundef %18, ptr noundef null) #7
  store i32 %79, ptr %20, align 4, !tbaa !5
  %80 = load i32, ptr %20, align 4, !tbaa !5
  %81 = icmp ne i32 0, %80
  br i1 %81, label %82, label %107

82:                                               ; preds = %69
  br label %83

83:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !5
  %84 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %85 = icmp sle i32 1, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %83
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage_1)
  br label %87

87:                                               ; preds = %86, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %11, align 8, !tbaa !9
  %91 = icmp ne ptr null, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %89
  %93 = load ptr, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %93, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %92, %89
  %95 = load ptr, ptr %12, align 8, !tbaa !9
  %96 = icmp ne ptr null, %95
  br i1 %96, label %97, label %99

97:                                               ; preds = %94
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 0, ptr %98, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %97, %94
  %100 = load ptr, ptr %13, align 8, !tbaa !9
  %101 = icmp ne ptr null, %100
  br i1 %101, label %102, label %105

102:                                              ; preds = %99
  %103 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #7
  %104 = load ptr, ptr %13, align 8, !tbaa !9
  store double %103, ptr %104, align 8, !tbaa !16
  br label %105

105:                                              ; preds = %102, %99
  %106 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %106, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %218

107:                                              ; preds = %69
  call void @_ZL29FreeObjectiveWrapperInternalsP16ObjectiveWrapper(ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %108 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %18, i32 0, i32 6
  %109 = load i32, ptr %108, align 8, !tbaa !18
  %110 = call noundef i64 @_ZN14NAMESPACE_MAINL12IdentifyTaskEi(i32 noundef %109) #7
  store i64 %110, ptr %23, align 8, !tbaa !11
  %111 = load i64, ptr %23, align 8, !tbaa !11
  %112 = icmp sle i64 0, %111
  br i1 %112, label %113, label %188

113:                                              ; preds = %107
  %114 = load i64, ptr %16, align 8, !tbaa !11
  %115 = icmp slt i64 %114, 0
  br i1 %115, label %116, label %140

116:                                              ; preds = %113
  br label %117

117:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 1, ptr %24, align 4, !tbaa !5
  %118 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %119 = icmp sle i32 1, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %117
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage_2)
  br label %121

121:                                              ; preds = %120, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %11, align 8, !tbaa !9
  %125 = icmp ne ptr null, %124
  br i1 %125, label %126, label %128

126:                                              ; preds = %123
  %127 = load ptr, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %127, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %126, %123
  %129 = load ptr, ptr %12, align 8, !tbaa !9
  %130 = icmp ne ptr null, %129
  br i1 %130, label %131, label %133

131:                                              ; preds = %128
  %132 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 0, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %131, %128
  %134 = load ptr, ptr %13, align 8, !tbaa !9
  %135 = icmp ne ptr null, %134
  br i1 %135, label %136, label %139

136:                                              ; preds = %133
  %137 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #7
  %138 = load ptr, ptr %13, align 8, !tbaa !9
  store double %137, ptr %138, align 8, !tbaa !16
  br label %139

139:                                              ; preds = %136, %133
  store i32 -3, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %217

140:                                              ; preds = %113
  %141 = load i64, ptr %16, align 8, !tbaa !11
  %142 = icmp eq i64 0, %141
  br i1 %142, label %143, label %167

143:                                              ; preds = %140
  br label %144

144:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 1, ptr %25, align 4, !tbaa !5
  %145 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %146 = icmp sle i32 1, %145
  br i1 %146, label %147, label %148

147:                                              ; preds = %144
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage_3)
  br label %148

148:                                              ; preds = %147, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %11, align 8, !tbaa !9
  %152 = icmp ne ptr null, %151
  br i1 %152, label %153, label %155

153:                                              ; preds = %150
  %154 = load ptr, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %154, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %153, %150
  %156 = load ptr, ptr %12, align 8, !tbaa !9
  %157 = icmp ne ptr null, %156
  br i1 %157, label %158, label %160

158:                                              ; preds = %155
  %159 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 0, ptr %159, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %158, %155
  %161 = load ptr, ptr %13, align 8, !tbaa !9
  %162 = icmp ne ptr null, %161
  br i1 %162, label %163, label %166

163:                                              ; preds = %160
  %164 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #7
  %165 = load ptr, ptr %13, align 8, !tbaa !9
  store double %164, ptr %165, align 8, !tbaa !16
  br label %166

166:                                              ; preds = %163, %160
  store i32 -3, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %217

167:                                              ; preds = %140
  %168 = load i64, ptr %16, align 8, !tbaa !11
  %169 = icmp eq i64 1, %168
  br i1 %169, label %170, label %187

170:                                              ; preds = %167
  %171 = load ptr, ptr %11, align 8, !tbaa !9
  %172 = icmp ne ptr null, %171
  br i1 %172, label %173, label %175

173:                                              ; preds = %170
  %174 = load ptr, ptr %11, align 8, !tbaa !9
  store i32 1, ptr %174, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %173, %170
  %176 = load ptr, ptr %12, align 8, !tbaa !9
  %177 = icmp ne ptr null, %176
  br i1 %177, label %178, label %180

178:                                              ; preds = %175
  %179 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 10, ptr %179, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %178, %175
  %181 = load ptr, ptr %13, align 8, !tbaa !9
  %182 = icmp ne ptr null, %181
  br i1 %182, label %183, label %186

183:                                              ; preds = %180
  %184 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #7
  %185 = load ptr, ptr %13, align 8, !tbaa !9
  store double %184, ptr %185, align 8, !tbaa !16
  br label %186

186:                                              ; preds = %183, %180
  store i32 0, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %217

187:                                              ; preds = %167
  br label %188

188:                                              ; preds = %187, %107
  %189 = load ptr, ptr %11, align 8, !tbaa !9
  %190 = icmp ne ptr null, %189
  br i1 %190, label %191, label %195

191:                                              ; preds = %188
  %192 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %18, i32 0, i32 5
  %193 = load i32, ptr %192, align 4, !tbaa !20
  %194 = load ptr, ptr %11, align 8, !tbaa !9
  store i32 %193, ptr %194, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %191, %188
  %196 = load ptr, ptr %12, align 8, !tbaa !9
  %197 = icmp ne ptr null, %196
  br i1 %197, label %198, label %202

198:                                              ; preds = %195
  %199 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %18, i32 0, i32 6
  %200 = load i32, ptr %199, align 8, !tbaa !18
  %201 = load ptr, ptr %12, align 8, !tbaa !9
  store i32 %200, ptr %201, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %198, %195
  %203 = load ptr, ptr %13, align 8, !tbaa !9
  %204 = icmp ne ptr null, %203
  br i1 %204, label %205, label %209

205:                                              ; preds = %202
  %206 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %18, i32 0, i32 7
  %207 = load double, ptr %206, align 8, !tbaa !21
  %208 = load ptr, ptr %13, align 8, !tbaa !9
  store double %207, ptr %208, align 8, !tbaa !16
  br label %209

209:                                              ; preds = %205, %202
  br label %210

210:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 3, ptr %26, align 4, !tbaa !5
  %211 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %212 = icmp sle i32 3, %211
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef @_ZZ21DetermineLinkFunctionE13LOG__sMessage_4)
  br label %214

214:                                              ; preds = %213, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  store i32 0, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %217

217:                                              ; preds = %216, %186, %166, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %218

218:                                              ; preds = %217, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 160, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %219

219:                                              ; preds = %218, %47
  %220 = load i32, ptr %7, align 4
  ret i32 %220
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIllEENSt9enable_ifIXaaaaaasr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS2_EE6lowestEclsr3std14numeric_limitsIS3_EE6lowestEleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { inlinehint mustprogress 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 #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 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { mustprogress 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 #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS6Config", !12, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!19, !6, i64 40}
!19 = !{!"_ZTS16ObjectiveWrapper", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !17, i64 104, !6, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !6, i64 144, !10, i64 152}
!20 = !{!19, !6, i64 36}
!21 = !{!19, !17, i64 48}


; 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"

%struct.ObjectiveWrapper = type { ptr, ptr, ptr, ptr, i32, i32, i32, double, double, double, double, double, double, double, double, i32, i64, i64, i64, i32, ptr }
%struct.Config = type { i64, i32 }

@g_traceLevel = external local_unnamed_addr global i32, align 4
@_ZZ21DetermineLinkFunctionE13LOG__sMessage = external hidden constant [120 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_0 = external hidden constant [68 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_1 = external hidden constant [48 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_2 = external hidden constant [59 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_3 = external hidden constant [52 x i8], align 16
@_ZZ21DetermineLinkFunctionE13LOG__sMessage_4 = external hidden constant [29 x i8], align 16

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

declare void @InteralLogWithArguments(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL35InitializeObjectiveWrapperUnfailingP16ObjectiveWrapper(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef i32 @_ZN14NAMESPACE_MAIN12GetObjectiveEPK6ConfigPKciP16ObjectiveWrapperS6_(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL29FreeObjectiveWrapperInternalsP16ObjectiveWrapper(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN14NAMESPACE_MAINL12IdentifyTaskEi(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @DetermineLinkFunction(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #5 {
  %7 = alloca %struct.ObjectiveWrapper, align 8
  %8 = alloca %struct.Config, align 8
  %9 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 2
  br i1 %10, label %11, label %12

11:                                               ; preds = %6
  tail call void (i32, ptr, ...) @InteralLogWithArguments(i32 noundef 3, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage, i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  br label %12

12:                                               ; preds = %11, %6
  %13 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIllEENSt9enable_ifIXaaaaaasr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS2_EE6lowestEclsr3std14numeric_limitsIS3_EE6lowestEleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %2) #8
  br i1 %13, label %14, label %18

14:                                               ; preds = %12
  %15 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %17, label %93

17:                                               ; preds = %14
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage_0)
  br label %93

18:                                               ; preds = %12
  %19 = and i32 %0, 2
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %22, label %20

20:                                               ; preds = %18
  %21 = tail call i64 @llvm.smax.i64(i64 %2, i64 1)
  br label %25

22:                                               ; preds = %18
  %23 = icmp slt i64 %2, 3
  %24 = select i1 %23, i64 1, i64 %2
  br label %25

25:                                               ; preds = %22, %20
  %.052 = phi i64 [ %21, %20 ], [ %24, %22 ]
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %7) #8
  call void @_ZL35InitializeObjectiveWrapperUnfailingP16ObjectiveWrapper(ptr noundef nonnull %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  store i64 %.052, ptr %8, align 8, !tbaa !9
  %26 = and i32 %0, 1
  %27 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %26, ptr %27, align 8, !tbaa !12
  %28 = call noundef i32 @_ZN14NAMESPACE_MAIN12GetObjectiveEPK6ConfigPKciP16ObjectiveWrapperS6_(ptr noundef nonnull %8, ptr noundef %1, i32 noundef 0, ptr noundef nonnull %7, ptr noundef null) #8
  %.not69 = icmp eq i32 %28, 0
  br i1 %.not69, label %40, label %29

29:                                               ; preds = %25
  %30 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage_1)
  br label %33

33:                                               ; preds = %32, %29
  %.not82 = icmp eq ptr %3, null
  br i1 %.not82, label %35, label %34

34:                                               ; preds = %33
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %34, %33
  %.not83 = icmp eq ptr %4, null
  br i1 %.not83, label %37, label %36

36:                                               ; preds = %35
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %36, %35
  %.not84 = icmp eq ptr %5, null
  br i1 %.not84, label %92, label %38

38:                                               ; preds = %37
  %39 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #8
  store double %39, ptr %5, align 8, !tbaa !13
  br label %92

40:                                               ; preds = %25
  call void @_ZL29FreeObjectiveWrapperInternalsP16ObjectiveWrapper(ptr noundef nonnull %7)
  %41 = getelementptr inbounds i8, ptr %7, i64 40
  %42 = load i32, ptr %41, align 8, !tbaa !15
  %43 = call noundef i64 @_ZN14NAMESPACE_MAINL12IdentifyTaskEi(i32 noundef %42) #8
  %44 = icmp sgt i64 %43, -1
  br i1 %44, label %45, label %77

45:                                               ; preds = %40
  %46 = icmp slt i64 %2, 0
  br i1 %46, label %47, label %58

47:                                               ; preds = %45
  %48 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage_2)
  br label %51

51:                                               ; preds = %50, %47
  %.not79 = icmp eq ptr %3, null
  br i1 %.not79, label %53, label %52

52:                                               ; preds = %51
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %52, %51
  %.not80 = icmp eq ptr %4, null
  br i1 %.not80, label %55, label %54

54:                                               ; preds = %53
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %54, %53
  %.not81 = icmp eq ptr %5, null
  br i1 %.not81, label %92, label %56

56:                                               ; preds = %55
  %57 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #8
  store double %57, ptr %5, align 8, !tbaa !13
  br label %92

58:                                               ; preds = %45
  switch i64 %2, label %77 [
    i64 0, label %59
    i64 1, label %70
  ]

59:                                               ; preds = %58
  %60 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage_3)
  br label %63

63:                                               ; preds = %62, %59
  %.not76 = icmp eq ptr %3, null
  br i1 %.not76, label %65, label %64

64:                                               ; preds = %63
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %64, %63
  %.not77 = icmp eq ptr %4, null
  br i1 %.not77, label %67, label %66

66:                                               ; preds = %65
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %66, %65
  %.not78 = icmp eq ptr %5, null
  br i1 %.not78, label %92, label %68

68:                                               ; preds = %67
  %69 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #8
  store double %69, ptr %5, align 8, !tbaa !13
  br label %92

70:                                               ; preds = %58
  %.not73 = icmp eq ptr %3, null
  br i1 %.not73, label %72, label %71

71:                                               ; preds = %70
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %71, %70
  %.not74 = icmp eq ptr %4, null
  br i1 %.not74, label %74, label %73

73:                                               ; preds = %72
  store i32 10, ptr %4, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %73, %72
  %.not75 = icmp eq ptr %5, null
  br i1 %.not75, label %92, label %75

75:                                               ; preds = %74
  %76 = call noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() #8
  store double %76, ptr %5, align 8, !tbaa !13
  br label %92

77:                                               ; preds = %58, %40
  %.not70 = icmp eq ptr %3, null
  br i1 %.not70, label %81, label %78

78:                                               ; preds = %77
  %79 = getelementptr inbounds i8, ptr %7, i64 36
  %80 = load i32, ptr %79, align 4, !tbaa !18
  store i32 %80, ptr %3, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %78, %77
  %.not71 = icmp eq ptr %4, null
  br i1 %.not71, label %84, label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %41, align 8, !tbaa !15
  store i32 %83, ptr %4, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %82, %81
  %.not72 = icmp eq ptr %5, null
  br i1 %.not72, label %88, label %85

85:                                               ; preds = %84
  %86 = getelementptr inbounds i8, ptr %7, i64 48
  %87 = load double, ptr %86, align 8, !tbaa !19
  store double %87, ptr %5, align 8, !tbaa !13
  br label %88

88:                                               ; preds = %84, %85
  %89 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 2
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  call void @InteralLogWithoutArguments(i32 noundef 3, ptr noundef nonnull @_ZZ21DetermineLinkFunctionE13LOG__sMessage_4)
  br label %92

92:                                               ; preds = %56, %55, %68, %67, %75, %74, %91, %88, %37, %38
  %.1 = phi i32 [ %28, %38 ], [ %28, %37 ], [ -3, %56 ], [ -3, %55 ], [ -3, %68 ], [ -3, %67 ], [ 0, %75 ], [ 0, %74 ], [ 0, %91 ], [ 0, %88 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %7) #8
  br label %93

93:                                               ; preds = %14, %17, %92
  %.2 = phi i32 [ %.1, %92 ], [ -3, %17 ], [ -3, %14 ]
  ret i32 %.2
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIllEENSt9enable_ifIXaaaaaasr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS2_EE6lowestEclsr3std14numeric_limitsIS3_EE6lowestEleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE9quiet_NaNEv() local_unnamed_addr #6 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { inlinehint mustprogress 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 #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 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { mustprogress 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS6Config", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"_ZTS16ObjectiveWrapper", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !6, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !6, i64 144, !17, i64 152}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!16, !6, i64 36}
!19 = !{!16, !14, i64 48}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass