; LLVM IR from vertver/Fresponze-old :: modules/opus/tests (test_opus_projection)

; 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.MappingMatrix = type { i32, i32, i32 }

@__const.test_simple_matrix.simple_matrix_params = external hidden unnamed_addr constant %struct.MappingMatrix, align 4
@__const.test_simple_matrix.simple_matrix_data = external hidden unnamed_addr constant [12 x i16], align 16
@__const.test_simple_matrix.input_int16 = external hidden unnamed_addr constant [30 x i16], align 16
@__const.test_simple_matrix.expected_output_int16 = external hidden unnamed_addr constant [40 x i16], align 16
@.str = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @assert_is_equal(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) #0

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

; 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 dso_local i32 @assert_is_equal_short(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) #0

; Function Attrs: nounwind uwtable
define dso_local void @test_simple_matrix() #0 {
  %1 = alloca %struct.MappingMatrix, align 4
  %2 = alloca [12 x i16], align 16
  %3 = alloca [30 x i16], align 16
  %4 = alloca [40 x i16], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %1, ptr align 4 @__const.test_simple_matrix.simple_matrix_params, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.test_simple_matrix.simple_matrix_data, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 60, ptr %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.test_simple_matrix.input_int16, i64 60, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.test_simple_matrix.expected_output_int16, i64 80, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %12 = call ptr @opus_alloc(i64 noundef 120)
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = call ptr @opus_alloc(i64 noundef 80)
  store ptr %13, ptr %10, align 8, !tbaa !5
  %14 = call ptr @opus_alloc(i64 noundef 160)
  store ptr %14, ptr %9, align 8, !tbaa !5
  %15 = call i32 @mapping_matrix_get_size(i32 noundef 4, i32 noundef 3)
  store i32 %15, ptr %7, align 4, !tbaa !9
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %0
  call void @_test_failed(ptr noundef @.str, i32 noundef 112) #7
  unreachable

19:                                               ; preds = %0
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call ptr @opus_alloc(i64 noundef %21)
  store ptr %22, ptr %11, align 8, !tbaa !5
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = getelementptr inbounds [12 x i16], ptr %2, i64 0, i64 0
  call void @mapping_matrix_init(ptr noundef %23, i32 noundef 4, i32 noundef 3, i32 noundef 0, ptr noundef %24, i32 noundef 24)
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %40, %19
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 30
  br i1 %27, label %28, label %43

28:                                               ; preds = %25
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [30 x i16], ptr %3, i64 0, i64 %30
  %32 = load i16, ptr %31, align 2, !tbaa !11
  %33 = sext i16 %32 to i32
  %34 = sitofp i32 %33 to float
  %35 = fmul float 0x3F00000000000000, %34
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds float, ptr %36, i64 %38
  store float %35, ptr %39, align 4, !tbaa !13
  br label %40

40:                                               ; preds = %28
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %5, align 4, !tbaa !9
  br label %25, !llvm.loop !15

43:                                               ; preds = %25
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %52, %43
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = icmp slt i32 %45, 40
  br i1 %46, label %47, label %55

47:                                               ; preds = %44
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds float, ptr %48, i64 %50
  store float 0.000000e+00, ptr %51, align 4, !tbaa !13
  br label %52

52:                                               ; preds = %47
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !9
  br label %44, !llvm.loop !17

55:                                               ; preds = %44
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %76, %55
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MappingMatrix, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !18
  %61 = icmp slt i32 %57, %60
  br i1 %61, label %62, label %79

62:                                               ; preds = %56
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds [30 x i16], ptr %3, i64 0, i64 0
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.MappingMatrix, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !20
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds float, ptr %68, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MappingMatrix, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 4, !tbaa !18
  call void @mapping_matrix_multiply_channel_in_short(ptr noundef %63, ptr noundef %64, i32 noundef %67, ptr noundef %71, i32 noundef %72, i32 noundef %75, i32 noundef 10)
  br label %76

76:                                               ; preds = %62
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %5, align 4, !tbaa !9
  br label %56, !llvm.loop !21

79:                                               ; preds = %56
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds [40 x i16], ptr %4, i64 0, i64 0
  %82 = call i32 @assert_is_equal(ptr noundef %80, ptr noundef %81, i32 noundef 40, i16 noundef signext 1)
  store i32 %82, ptr %6, align 4, !tbaa !9
  %83 = load i32, ptr %6, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %79
  call void @_test_failed(ptr noundef @.str, i32 noundef 140) #7
  unreachable

86:                                               ; preds = %79
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %95, %86
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = icmp slt i32 %88, 40
  br i1 %89, label %90, label %98

90:                                               ; preds = %87
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i16, ptr %91, i64 %93
  store i16 0, ptr %94, align 2, !tbaa !11
  br label %95

95:                                               ; preds = %90
  %96 = load i32, ptr %5, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %5, align 4, !tbaa !9
  br label %87, !llvm.loop !22

98:                                               ; preds = %87
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %119, %98
  %100 = load i32, ptr %5, align 4, !tbaa !9
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.MappingMatrix, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !20
  %104 = icmp slt i32 %100, %103
  br i1 %104, label %105, label %122

105:                                              ; preds = %99
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load i32, ptr %5, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds float, ptr %107, i64 %109
  %111 = load i32, ptr %5, align 4, !tbaa !9
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.MappingMatrix, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !20
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.MappingMatrix, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !18
  call void @mapping_matrix_multiply_channel_out_short(ptr noundef %106, ptr noundef %110, i32 noundef %111, i32 noundef %114, ptr noundef %115, i32 noundef %118, i32 noundef 10)
  br label %119

119:                                              ; preds = %105
  %120 = load i32, ptr %5, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %5, align 4, !tbaa !9
  br label %99, !llvm.loop !23

122:                                              ; preds = %99
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds [40 x i16], ptr %4, i64 0, i64 0
  %125 = call i32 @assert_is_equal_short(ptr noundef %123, ptr noundef %124, i32 noundef 40, i16 noundef signext 1)
  store i32 %125, ptr %6, align 4, !tbaa !9
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %122
  call void @_test_failed(ptr noundef @.str, i32 noundef 153) #7
  unreachable

129:                                              ; preds = %122
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %138, %129
  %131 = load i32, ptr %5, align 4, !tbaa !9
  %132 = icmp slt i32 %131, 40
  br i1 %132, label %133, label %141

133:                                              ; preds = %130
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = load i32, ptr %5, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds float, ptr %134, i64 %136
  store float 0.000000e+00, ptr %137, align 4, !tbaa !13
  br label %138

138:                                              ; preds = %133
  %139 = load i32, ptr %5, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %5, align 4, !tbaa !9
  br label %130, !llvm.loop !24

141:                                              ; preds = %130
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %162, %141
  %143 = load i32, ptr %5, align 4, !tbaa !9
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.MappingMatrix, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !18
  %147 = icmp slt i32 %143, %146
  br i1 %147, label %148, label %165

148:                                              ; preds = %142
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MappingMatrix, ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !20
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = load i32, ptr %5, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds float, ptr %154, i64 %156
  %158 = load i32, ptr %5, align 4, !tbaa !9
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.MappingMatrix, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !18
  call void @mapping_matrix_multiply_channel_in_float(ptr noundef %149, ptr noundef %150, i32 noundef %153, ptr noundef %157, i32 noundef %158, i32 noundef %161, i32 noundef 10)
  br label %162

162:                                              ; preds = %148
  %163 = load i32, ptr %5, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %5, align 4, !tbaa !9
  br label %142, !llvm.loop !25

165:                                              ; preds = %142
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = getelementptr inbounds [40 x i16], ptr %4, i64 0, i64 0
  %168 = call i32 @assert_is_equal(ptr noundef %166, ptr noundef %167, i32 noundef 40, i16 noundef signext 1)
  store i32 %168, ptr %6, align 4, !tbaa !9
  %169 = load i32, ptr %6, align 4, !tbaa !9
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %172

171:                                              ; preds = %165
  call void @_test_failed(ptr noundef @.str, i32 noundef 167) #7
  unreachable

172:                                              ; preds = %165
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %181, %172
  %174 = load i32, ptr %5, align 4, !tbaa !9
  %175 = icmp slt i32 %174, 40
  br i1 %175, label %176, label %184

176:                                              ; preds = %173
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load i32, ptr %5, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds float, ptr %177, i64 %179
  store float 0.000000e+00, ptr %180, align 4, !tbaa !13
  br label %181

181:                                              ; preds = %176
  %182 = load i32, ptr %5, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %5, align 4, !tbaa !9
  br label %173, !llvm.loop !26

184:                                              ; preds = %173
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %205, %184
  %186 = load i32, ptr %5, align 4, !tbaa !9
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.MappingMatrix, ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 4, !tbaa !20
  %190 = icmp slt i32 %186, %189
  br i1 %190, label %191, label %208

191:                                              ; preds = %185
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = load i32, ptr %5, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds float, ptr %193, i64 %195
  %197 = load i32, ptr %5, align 4, !tbaa !9
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.MappingMatrix, ptr %198, i32 0, i32 1
  %200 = load i32, ptr %199, align 4, !tbaa !20
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = load ptr, ptr %11, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.MappingMatrix, ptr %202, i32 0, i32 0
  %204 = load i32, ptr %203, align 4, !tbaa !18
  call void @mapping_matrix_multiply_channel_out_float(ptr noundef %192, ptr noundef %196, i32 noundef %197, i32 noundef %200, ptr noundef %201, i32 noundef %204, i32 noundef 10)
  br label %205

205:                                              ; preds = %191
  %206 = load i32, ptr %5, align 4, !tbaa !9
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %5, align 4, !tbaa !9
  br label %185, !llvm.loop !27

208:                                              ; preds = %185
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds [40 x i16], ptr %4, i64 0, i64 0
  %211 = call i32 @assert_is_equal(ptr noundef %209, ptr noundef %210, i32 noundef 40, i16 noundef signext 1)
  store i32 %211, ptr %6, align 4, !tbaa !9
  %212 = load i32, ptr %6, align 4, !tbaa !9
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %215

214:                                              ; preds = %208
  call void @_test_failed(ptr noundef @.str, i32 noundef 180) #7
  unreachable

215:                                              ; preds = %208
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  call void @opus_free(ptr noundef %216)
  %217 = load ptr, ptr %10, align 8, !tbaa !5
  call void @opus_free(ptr noundef %217)
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  call void @opus_free(ptr noundef %218)
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  call void @opus_free(ptr noundef %219)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %1) #6
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @opus_alloc(i64 noundef) #3

declare i32 @mapping_matrix_get_size(i32 noundef, i32 noundef) #4

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @_test_failed(ptr noundef, i32 noundef) #5

declare void @mapping_matrix_init(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #4

declare void @mapping_matrix_multiply_channel_in_short(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

declare void @mapping_matrix_multiply_channel_out_short(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #4

declare void @mapping_matrix_multiply_channel_in_float(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

declare void @mapping_matrix_multiply_channel_out_float(ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @opus_free(ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { inlinehint noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !10, i64 0}
!19 = !{!"MappingMatrix", !10, i64 0, !10, i64 4, !10, i64 8}
!20 = !{!19, !10, i64 4}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16}
!27 = distinct !{!27, !16}


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

@__const.test_simple_matrix.simple_matrix_data = external hidden unnamed_addr constant [12 x i16], align 16
@__const.test_simple_matrix.input_int16 = external hidden unnamed_addr constant [30 x i16], align 16
@__const.test_simple_matrix.expected_output_int16 = external hidden unnamed_addr constant [40 x i16], align 16
@.str = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @assert_is_equal(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) local_unnamed_addr #0

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

; 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 dso_local i32 @assert_is_equal_short(ptr noundef, ptr noundef, i32 noundef, i16 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @test_simple_matrix() local_unnamed_addr #0 {
  %1 = alloca [12 x i16], align 16
  %2 = alloca [30 x i16], align 16
  %3 = alloca [40 x i16], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %1, ptr noundef nonnull align 16 dereferenceable(24) @__const.test_simple_matrix.simple_matrix_data, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %2, ptr noundef nonnull align 16 dereferenceable(60) @__const.test_simple_matrix.input_int16, i64 60, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %3, ptr noundef nonnull align 16 dereferenceable(80) @__const.test_simple_matrix.expected_output_int16, i64 80, i1 false)
  %4 = tail call ptr @opus_alloc(i64 noundef 120)
  %5 = tail call ptr @opus_alloc(i64 noundef 80)
  %6 = tail call ptr @opus_alloc(i64 noundef 160)
  %7 = tail call i32 @mapping_matrix_get_size(i32 noundef 4, i32 noundef 3) #7
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %8, label %.preheader89.preheader

8:                                                ; preds = %0
  tail call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 112) #8
  unreachable

.preheader89.preheader:                           ; preds = %0
  %9 = sext i32 %7 to i64
  %10 = tail call ptr @opus_alloc(i64 noundef %9)
  call void @mapping_matrix_init(ptr noundef %10, i32 noundef 4, i32 noundef 3, i32 noundef 0, ptr noundef nonnull %1, i32 noundef 24) #7
  %11 = load <4 x i16>, ptr %2, align 16, !tbaa !5
  %12 = sitofp <4 x i16> %11 to <4 x float>
  %13 = fmul <4 x float> %12, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %13, ptr %4, align 4, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  %16 = load <4 x i16>, ptr %14, align 8, !tbaa !5
  %17 = sitofp <4 x i16> %16 to <4 x float>
  %18 = fmul <4 x float> %17, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %18, ptr %15, align 4, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = getelementptr inbounds i8, ptr %4, i64 32
  %21 = load <4 x i16>, ptr %19, align 16, !tbaa !5
  %22 = sitofp <4 x i16> %21 to <4 x float>
  %23 = fmul <4 x float> %22, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %23, ptr %20, align 4, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %2, i64 24
  %25 = getelementptr inbounds i8, ptr %4, i64 48
  %26 = load <4 x i16>, ptr %24, align 8, !tbaa !5
  %27 = sitofp <4 x i16> %26 to <4 x float>
  %28 = fmul <4 x float> %27, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %28, ptr %25, align 4, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %2, i64 32
  %30 = getelementptr inbounds i8, ptr %4, i64 64
  %31 = load <4 x i16>, ptr %29, align 16, !tbaa !5
  %32 = sitofp <4 x i16> %31 to <4 x float>
  %33 = fmul <4 x float> %32, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %33, ptr %30, align 4, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %2, i64 40
  %35 = getelementptr inbounds i8, ptr %4, i64 80
  %36 = load <4 x i16>, ptr %34, align 8, !tbaa !5
  %37 = sitofp <4 x i16> %36 to <4 x float>
  %38 = fmul <4 x float> %37, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %38, ptr %35, align 4, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %2, i64 48
  %40 = getelementptr inbounds i8, ptr %4, i64 96
  %41 = load <4 x i16>, ptr %39, align 16, !tbaa !5
  %42 = sitofp <4 x i16> %41 to <4 x float>
  %43 = fmul <4 x float> %42, <float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000, float 0x3F00000000000000>
  store <4 x float> %43, ptr %40, align 4, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %2, i64 56
  %45 = getelementptr inbounds i8, ptr %4, i64 112
  %46 = load <2 x i16>, ptr %44, align 8, !tbaa !5
  %47 = sitofp <2 x i16> %46 to <2 x float>
  %48 = fmul <2 x float> %47, <float 0x3F00000000000000, float 0x3F00000000000000>
  store <2 x float> %48, ptr %45, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(160) %6, i8 0, i64 160, i1 false), !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader89.preheader
  %51 = getelementptr inbounds i8, ptr %10, i64 4
  br label %52

52:                                               ; preds = %.lr.ph, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %53 = phi i32 [ %49, %.lr.ph ], [ %57, %52 ]
  %54 = load i32, ptr %51, align 4, !tbaa !14
  %55 = getelementptr inbounds float, ptr %6, i64 %indvars.iv
  %56 = trunc nuw nsw i64 %indvars.iv to i32
  call void @mapping_matrix_multiply_channel_in_short(ptr noundef nonnull %10, ptr noundef nonnull %2, i32 noundef %54, ptr noundef %55, i32 noundef %56, i32 noundef %53, i32 noundef 10) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %57 = load i32, ptr %10, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next, %58
  br i1 %59, label %52, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %52, %.preheader89.preheader
  %60 = call i32 @assert_is_equal(ptr noundef %6, ptr noundef nonnull %3, i32 noundef 40, i16 noundef signext 1)
  %.not79 = icmp eq i32 %60, 0
  br i1 %.not79, label %.preheader87.preheader, label %64

.preheader87.preheader:                           ; preds = %._crit_edge
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(80) %5, i8 0, i64 80, i1 false), !tbaa !5
  %61 = getelementptr inbounds i8, ptr %10, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !14
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %.lr.ph95, label %._crit_edge96

64:                                               ; preds = %._crit_edge
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 140) #8
  unreachable

.lr.ph95:                                         ; preds = %.preheader87.preheader, %.lr.ph95
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.lr.ph95 ], [ 0, %.preheader87.preheader ]
  %65 = phi i32 [ %69, %.lr.ph95 ], [ %62, %.preheader87.preheader ]
  %66 = getelementptr inbounds float, ptr %4, i64 %indvars.iv111
  %67 = load i32, ptr %10, align 4, !tbaa !11
  %68 = trunc nuw nsw i64 %indvars.iv111 to i32
  call void @mapping_matrix_multiply_channel_out_short(ptr noundef nonnull %10, ptr noundef nonnull %66, i32 noundef %68, i32 noundef %65, ptr noundef %5, i32 noundef %67, i32 noundef 10) #7
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %69 = load i32, ptr %61, align 4, !tbaa !14
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next112, %70
  br i1 %71, label %.lr.ph95, label %._crit_edge96, !llvm.loop !17

._crit_edge96:                                    ; preds = %.lr.ph95, %.preheader87.preheader
  %72 = call i32 @assert_is_equal_short(ptr noundef %5, ptr noundef nonnull %3, i32 noundef 40, i16 noundef signext 1)
  %.not80 = icmp eq i32 %72, 0
  br i1 %.not80, label %.preheader85.preheader, label %75

.preheader85.preheader:                           ; preds = %._crit_edge96
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(160) %6, i8 0, i64 160, i1 false), !tbaa !9
  %73 = load i32, ptr %10, align 4, !tbaa !11
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.lr.ph99, label %._crit_edge100

75:                                               ; preds = %._crit_edge96
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 153) #8
  unreachable

.lr.ph99:                                         ; preds = %.preheader85.preheader, %.lr.ph99
  %indvars.iv117 = phi i64 [ %indvars.iv.next118, %.lr.ph99 ], [ 0, %.preheader85.preheader ]
  %76 = phi i32 [ %80, %.lr.ph99 ], [ %73, %.preheader85.preheader ]
  %77 = load i32, ptr %61, align 4, !tbaa !14
  %78 = getelementptr inbounds float, ptr %6, i64 %indvars.iv117
  %79 = trunc nuw nsw i64 %indvars.iv117 to i32
  call void @mapping_matrix_multiply_channel_in_float(ptr noundef nonnull %10, ptr noundef nonnull %4, i32 noundef %77, ptr noundef %78, i32 noundef %79, i32 noundef %76, i32 noundef 10) #7
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %80 = load i32, ptr %10, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next118, %81
  br i1 %82, label %.lr.ph99, label %._crit_edge100, !llvm.loop !18

._crit_edge100:                                   ; preds = %.lr.ph99, %.preheader85.preheader
  %83 = call i32 @assert_is_equal(ptr noundef %6, ptr noundef nonnull %3, i32 noundef 40, i16 noundef signext 1)
  %.not81 = icmp eq i32 %83, 0
  br i1 %.not81, label %.preheader83.preheader, label %86

.preheader83.preheader:                           ; preds = %._crit_edge100
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(160) %6, i8 0, i64 160, i1 false), !tbaa !9
  %84 = load i32, ptr %61, align 4, !tbaa !14
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph103, label %._crit_edge104

86:                                               ; preds = %._crit_edge100
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 167) #8
  unreachable

.lr.ph103:                                        ; preds = %.preheader83.preheader, %.lr.ph103
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %.lr.ph103 ], [ 0, %.preheader83.preheader ]
  %87 = phi i32 [ %91, %.lr.ph103 ], [ %84, %.preheader83.preheader ]
  %88 = getelementptr inbounds float, ptr %4, i64 %indvars.iv123
  %89 = load i32, ptr %10, align 4, !tbaa !11
  %90 = trunc nuw nsw i64 %indvars.iv123 to i32
  call void @mapping_matrix_multiply_channel_out_float(ptr noundef nonnull %10, ptr noundef nonnull %88, i32 noundef %90, i32 noundef %87, ptr noundef %6, i32 noundef %89, i32 noundef 10) #7
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %91 = load i32, ptr %61, align 4, !tbaa !14
  %92 = sext i32 %91 to i64
  %93 = icmp slt i64 %indvars.iv.next124, %92
  br i1 %93, label %.lr.ph103, label %._crit_edge104, !llvm.loop !19

._crit_edge104:                                   ; preds = %.lr.ph103, %.preheader83.preheader
  %94 = call i32 @assert_is_equal(ptr noundef %6, ptr noundef nonnull %3, i32 noundef 40, i16 noundef signext 1)
  %.not82 = icmp eq i32 %94, 0
  br i1 %.not82, label %96, label %95

95:                                               ; preds = %._crit_edge104
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 180) #8
  unreachable

96:                                               ; preds = %._crit_edge104
  call void @opus_free(ptr noundef nonnull %4)
  call void @opus_free(ptr noundef %5)
  call void @opus_free(ptr noundef %6)
  call void @opus_free(ptr noundef nonnull %10)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @opus_alloc(i64 noundef) local_unnamed_addr #3

declare i32 @mapping_matrix_get_size(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @_test_failed(ptr noundef, i32 noundef) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @opus_free(ptr noundef) local_unnamed_addr #3

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { inlinehint noreturn 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"MappingMatrix", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass