; LLVM IR from jingweizhanghuai/Morn :: src/wave (morn_WAV_file)

; 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.MWAVHeader = type { i16, i16, i32, i32, i16, i16 }
%struct.MWAVInfo = type { ptr, i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@__FUNCTION__.WAVInfo = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @WAVInfo(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.MWAVHeader, align 4
  %4 = alloca [5 x i8], align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 5, ptr %4) #4
  %21 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 4
  store i8 0, ptr %21, align 1, !tbaa !9
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MWAVInfo, ptr %22, i32 0, i32 1
  store i32 0, ptr %23, align 8, !tbaa !10
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.MWAVInfo, ptr %24, i32 0, i32 2
  store i32 0, ptr %25, align 4, !tbaa !13
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.MWAVInfo, ptr %26, i32 0, i32 3
  store i32 0, ptr %27, align 8, !tbaa !14
  br label %28

28:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %29 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.MWAVInfo, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %33 = call i64 @fread(ptr noundef %29, i64 noundef 4, i64 noundef 1, ptr noundef %32)
  %34 = icmp ne i64 %33, 1
  %35 = zext i1 %34 to i32
  store i32 %35, ptr %5, align 4, !tbaa !16
  %36 = load i32, ptr %5, align 4, !tbaa !16
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %28
  %39 = load i32, ptr %5, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %39, i32 noundef -1, ptr noundef @.str, i32 noundef 40, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %40

40:                                               ; preds = %38, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %44 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %45 = call i32 @memcmp(ptr noundef %44, ptr noundef @.str.2, i64 noundef 4) #5
  %46 = icmp ne i32 %45, 0
  %47 = zext i1 %46 to i32
  store i32 %47, ptr %6, align 4, !tbaa !16
  %48 = load i32, ptr %6, align 4, !tbaa !16
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %43
  %51 = load i32, ptr %6, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %51, i32 noundef -1, ptr noundef @.str, i32 noundef 41, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.3)
  br label %52

52:                                               ; preds = %50, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  br label %55

55:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.MWAVInfo, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = call i64 @fread(ptr noundef %7, i64 noundef 4, i64 noundef 1, ptr noundef %58)
  %60 = icmp ne i64 %59, 1
  %61 = zext i1 %60 to i32
  store i32 %61, ptr %8, align 4, !tbaa !16
  %62 = load i32, ptr %8, align 4, !tbaa !16
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %55
  %65 = load i32, ptr %8, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %65, i32 noundef -1, ptr noundef @.str, i32 noundef 44, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %66

66:                                               ; preds = %64, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %7, align 4, !tbaa !16
  %70 = add nsw i32 %69, 8
  store i32 %70, ptr %7, align 4, !tbaa !16
  br label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %72 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MWAVInfo, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !15
  %76 = call i64 @fread(ptr noundef %72, i64 noundef 4, i64 noundef 1, ptr noundef %75)
  %77 = icmp ne i64 %76, 1
  %78 = zext i1 %77 to i32
  store i32 %78, ptr %9, align 4, !tbaa !16
  %79 = load i32, ptr %9, align 4, !tbaa !16
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %71
  %82 = load i32, ptr %9, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %82, i32 noundef -1, ptr noundef @.str, i32 noundef 47, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %83

83:                                               ; preds = %81, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %87 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %88 = call i32 @memcmp(ptr noundef %87, ptr noundef @.str.4, i64 noundef 4) #5
  %89 = icmp ne i32 %88, 0
  %90 = zext i1 %89 to i32
  store i32 %90, ptr %10, align 4, !tbaa !16
  %91 = load i32, ptr %10, align 4, !tbaa !16
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %95

93:                                               ; preds = %86
  %94 = load i32, ptr %10, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %94, i32 noundef -1, ptr noundef @.str, i32 noundef 48, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.5)
  br label %95

95:                                               ; preds = %93, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.MWAVInfo, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !15
  %101 = call i64 @ftell(ptr noundef %100)
  %102 = trunc i64 %101 to i32
  store i32 %102, ptr %11, align 4, !tbaa !16
  br label %103

103:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %104 = load i32, ptr %7, align 4, !tbaa !16
  %105 = load i32, ptr %11, align 4, !tbaa !16
  %106 = sub nsw i32 %104, %105
  %107 = icmp slt i32 %106, 8
  %108 = zext i1 %107 to i32
  store i32 %108, ptr %12, align 4, !tbaa !16
  %109 = load i32, ptr %12, align 4, !tbaa !16
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %103
  %112 = load i32, ptr %12, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %112, i32 noundef -1, ptr noundef @.str, i32 noundef 51, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.5)
  br label %113

113:                                              ; preds = %111, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %269, %115
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %119 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.MWAVInfo, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !15
  %123 = call i64 @fread(ptr noundef %119, i64 noundef 4, i64 noundef 1, ptr noundef %122)
  %124 = icmp ne i64 %123, 1
  %125 = zext i1 %124 to i32
  store i32 %125, ptr %13, align 4, !tbaa !16
  %126 = load i32, ptr %13, align 4, !tbaa !16
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %130

128:                                              ; preds = %118
  %129 = load i32, ptr %13, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %129, i32 noundef -1, ptr noundef @.str, i32 noundef 55, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %130

130:                                              ; preds = %128, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  br label %133

133:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.MWAVInfo, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !15
  %137 = call i64 @fread(ptr noundef %14, i64 noundef 4, i64 noundef 1, ptr noundef %136)
  %138 = icmp ne i64 %137, 1
  %139 = zext i1 %138 to i32
  store i32 %139, ptr %15, align 4, !tbaa !16
  %140 = load i32, ptr %15, align 4, !tbaa !16
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %133
  %143 = load i32, ptr %15, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %143, i32 noundef -1, ptr noundef @.str, i32 noundef 57, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %144

144:                                              ; preds = %142, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %11, align 4, !tbaa !16
  %148 = add nsw i32 %147, 8
  store i32 %148, ptr %11, align 4, !tbaa !16
  br label %149

149:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %150 = load i32, ptr %7, align 4, !tbaa !16
  %151 = load i32, ptr %11, align 4, !tbaa !16
  %152 = sub nsw i32 %150, %151
  %153 = load i32, ptr %14, align 4, !tbaa !16
  %154 = icmp slt i32 %152, %153
  %155 = zext i1 %154 to i32
  store i32 %155, ptr %16, align 4, !tbaa !16
  %156 = load i32, ptr %16, align 4, !tbaa !16
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %160

158:                                              ; preds = %149
  %159 = load i32, ptr %16, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %159, i32 noundef -1, ptr noundef @.str, i32 noundef 60, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.6)
  br label %160

160:                                              ; preds = %158, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  %163 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %164 = call i32 @memcmp(ptr noundef %163, ptr noundef @.str.7, i64 noundef 4) #5
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %166, label %235

166:                                              ; preds = %162
  br label %167

167:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %168 = load i32, ptr %14, align 4, !tbaa !16
  %169 = sext i32 %168 to i64
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.MWAVInfo, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !15
  %173 = call i64 @fread(ptr noundef %3, i64 noundef %169, i64 noundef 1, ptr noundef %172)
  %174 = icmp ne i64 %173, 1
  %175 = zext i1 %174 to i32
  store i32 %175, ptr %17, align 4, !tbaa !16
  %176 = load i32, ptr %17, align 4, !tbaa !16
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %180

178:                                              ; preds = %167
  %179 = load i32, ptr %17, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %179, i32 noundef -1, ptr noundef @.str, i32 noundef 64, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.1)
  br label %180

180:                                              ; preds = %178, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %184 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 1
  %185 = load i16, ptr %184, align 2, !tbaa !17
  %186 = sext i16 %185 to i32
  %187 = icmp sle i32 %186, 0
  br i1 %187, label %193, label %188

188:                                              ; preds = %183
  %189 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 1
  %190 = load i16, ptr %189, align 2, !tbaa !17
  %191 = sext i16 %190 to i32
  %192 = icmp sgt i32 %191, 2
  br label %193

193:                                              ; preds = %188, %183
  %194 = phi i1 [ true, %183 ], [ %192, %188 ]
  %195 = zext i1 %194 to i32
  store i32 %195, ptr %18, align 4, !tbaa !16
  %196 = load i32, ptr %18, align 4, !tbaa !16
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %200

198:                                              ; preds = %193
  %199 = load i32, ptr %18, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %199, i32 noundef -1, ptr noundef @.str, i32 noundef 71, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.8)
  br label %200

200:                                              ; preds = %198, %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %204 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 4
  %205 = load i16, ptr %204, align 4, !tbaa !20
  %206 = sext i16 %205 to i32
  %207 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 2
  %208 = load i32, ptr %207, align 4, !tbaa !21
  %209 = mul nsw i32 %206, %208
  %210 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 3
  %211 = load i32, ptr %210, align 4, !tbaa !22
  %212 = icmp ne i32 %209, %211
  %213 = zext i1 %212 to i32
  store i32 %213, ptr %19, align 4, !tbaa !16
  %214 = load i32, ptr %19, align 4, !tbaa !16
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %218

216:                                              ; preds = %203
  %217 = load i32, ptr %19, align 4, !tbaa !16
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %217, i32 noundef -1, ptr noundef @.str, i32 noundef 72, ptr noundef @__FUNCTION__.WAVInfo, ptr noundef @.str.6)
  br label %218

218:                                              ; preds = %216, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 1
  %222 = load i16, ptr %221, align 2, !tbaa !17
  %223 = sext i16 %222 to i32
  %224 = load ptr, ptr %2, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.MWAVInfo, ptr %224, i32 0, i32 2
  store i32 %223, ptr %225, align 4, !tbaa !13
  %226 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 2
  %227 = load i32, ptr %226, align 4, !tbaa !21
  %228 = load ptr, ptr %2, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.MWAVInfo, ptr %228, i32 0, i32 1
  store i32 %227, ptr %229, align 8, !tbaa !10
  %230 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 5
  %231 = load i16, ptr %230, align 2, !tbaa !23
  %232 = sext i16 %231 to i32
  %233 = load ptr, ptr %2, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.MWAVInfo, ptr %233, i32 0, i32 4
  store i32 %232, ptr %234, align 4, !tbaa !24
  br label %255

235:                                              ; preds = %162
  %236 = getelementptr inbounds [5 x i8], ptr %4, i64 0, i64 0
  %237 = call i32 @memcmp(ptr noundef %236, ptr noundef @.str.9, i64 noundef 4) #5
  %238 = icmp eq i32 %237, 0
  br i1 %238, label %239, label %247

239:                                              ; preds = %235
  %240 = load i32, ptr %14, align 4, !tbaa !16
  %241 = getelementptr inbounds %struct.MWAVHeader, ptr %3, i32 0, i32 4
  %242 = load i16, ptr %241, align 4, !tbaa !20
  %243 = sext i16 %242 to i32
  %244 = sdiv i32 %240, %243
  %245 = load ptr, ptr %2, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.MWAVInfo, ptr %245, i32 0, i32 3
  store i32 %244, ptr %246, align 8, !tbaa !14
  store i32 1, ptr %20, align 4
  br label %267

247:                                              ; preds = %235
  %248 = load ptr, ptr %2, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.MWAVInfo, ptr %248, i32 0, i32 0
  %250 = load ptr, ptr %249, align 8, !tbaa !15
  %251 = load i32, ptr %14, align 4, !tbaa !16
  %252 = sext i32 %251 to i64
  %253 = call i32 @fseek(ptr noundef %250, i64 noundef %252, i32 noundef 1)
  br label %254

254:                                              ; preds = %247
  br label %255

255:                                              ; preds = %254, %220
  %256 = load ptr, ptr %2, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.MWAVInfo, ptr %256, i32 0, i32 0
  %258 = load ptr, ptr %257, align 8, !tbaa !15
  %259 = call i64 @ftell(ptr noundef %258)
  %260 = trunc i64 %259 to i32
  store i32 %260, ptr %11, align 4, !tbaa !16
  %261 = load i32, ptr %7, align 4, !tbaa !16
  %262 = load i32, ptr %11, align 4, !tbaa !16
  %263 = sub nsw i32 %261, %262
  %264 = icmp slt i32 %263, 8
  br i1 %264, label %265, label %266

265:                                              ; preds = %255
  store i32 15, ptr %20, align 4
  br label %267

266:                                              ; preds = %255
  store i32 0, ptr %20, align 4
  br label %267

267:                                              ; preds = %266, %265, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %268 = load i32, ptr %20, align 4
  switch i32 %268, label %271 [
    i32 0, label %269
    i32 15, label %270
  ]

269:                                              ; preds = %267
  br label %116

270:                                              ; preds = %267
  store i32 0, ptr %20, align 4
  br label %271

271:                                              ; preds = %270, %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  %272 = load i32, ptr %20, align 4
  switch i32 %272, label %274 [
    i32 0, label %273
    i32 1, label %273
  ]

273:                                              ; preds = %271, %271
  ret void

274:                                              ; preds = %271
  unreachable
}

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 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 willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #3

declare i64 @ftell(ptr noundef) #2

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

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 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 8}
!11 = !{!"MWAVInfo", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !6, i64 24}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !12, i64 12}
!14 = !{!11, !12, i64 16}
!15 = !{!11, !6, i64 0}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !19, i64 2}
!18 = !{!"MWAVHeader", !19, i64 0, !19, i64 2, !12, i64 4, !12, i64 8, !19, i64 12, !19, i64 14}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !19, i64 12}
!21 = !{!18, !12, i64 4}
!22 = !{!18, !12, i64 8}
!23 = !{!18, !19, i64 14}
!24 = !{!11, !12, i64 20}


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

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@__FUNCTION__.WAVInfo = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @WAVInfo(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.MWAVHeader, align 4
  %3 = alloca [5 x i8], align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %3) #5
  %6 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 0, ptr %6, align 1, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %7, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 0, ptr %8, align 4, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %9, align 8, !tbaa !13
  %10 = load ptr, ptr %0, align 8, !tbaa !14
  %11 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef %10)
  %.not = icmp eq i64 %11, 1
  br i1 %.not, label %13, label %12

12:                                               ; preds = %1
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 40, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %13

13:                                               ; preds = %12, %1
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %3, ptr noundef nonnull dereferenceable(4) @.str.2, i64 4)
  %.not51 = icmp eq i32 %bcmp, 0
  br i1 %.not51, label %15, label %14

14:                                               ; preds = %13
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 41, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.3) #5
  br label %15

15:                                               ; preds = %14, %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %16 = load ptr, ptr %0, align 8, !tbaa !14
  %17 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %.not52 = icmp eq i64 %17, 1
  br i1 %.not52, label %19, label %18

18:                                               ; preds = %15
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 44, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %19

19:                                               ; preds = %18, %15
  %20 = load i32, ptr %4, align 4, !tbaa !15
  %21 = add nsw i32 %20, 8
  %22 = load ptr, ptr %0, align 8, !tbaa !14
  %23 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef %22)
  %.not53 = icmp eq i64 %23, 1
  br i1 %.not53, label %25, label %24

24:                                               ; preds = %19
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 47, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %25

25:                                               ; preds = %24, %19
  %bcmp45 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %3, ptr noundef nonnull dereferenceable(4) @.str.4, i64 4)
  %.not54 = icmp eq i32 %bcmp45, 0
  br i1 %.not54, label %27, label %26

26:                                               ; preds = %25
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 48, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.5) #5
  br label %27

27:                                               ; preds = %26, %25
  %28 = load ptr, ptr %0, align 8, !tbaa !14
  %29 = tail call i64 @ftell(ptr noundef %28)
  %30 = trunc i64 %29 to i32
  %31 = sub nsw i32 %21, %30
  %32 = icmp slt i32 %31, 8
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 51, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.5) #5
  br label %34

34:                                               ; preds = %33, %27
  %35 = getelementptr inbounds i8, ptr %2, i64 2
  %36 = getelementptr inbounds i8, ptr %2, i64 12
  %37 = getelementptr inbounds i8, ptr %2, i64 4
  %38 = getelementptr inbounds i8, ptr %2, i64 8
  %39 = getelementptr inbounds i8, ptr %2, i64 14
  %40 = getelementptr inbounds i8, ptr %0, i64 20
  br label %41

41:                                               ; preds = %93, %34
  %42 = phi i16 [ undef, %34 ], [ %88, %93 ]
  %.044 = phi i32 [ %30, %34 ], [ %91, %93 ]
  %43 = load ptr, ptr %0, align 8, !tbaa !14
  %44 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef %43)
  %.not55 = icmp eq i64 %44, 1
  br i1 %.not55, label %46, label %45

45:                                               ; preds = %41
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 55, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %46

46:                                               ; preds = %45, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %47 = load ptr, ptr %0, align 8, !tbaa !14
  %48 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %47)
  %.not56 = icmp eq i64 %48, 1
  br i1 %.not56, label %50, label %49

49:                                               ; preds = %46
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 57, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %50

50:                                               ; preds = %49, %46
  %51 = sub i32 %20, %.044
  %52 = load i32, ptr %5, align 4, !tbaa !15
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 60, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.6) #5
  br label %55

55:                                               ; preds = %54, %50
  %bcmp46 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %3, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4)
  %56 = icmp eq i32 %bcmp46, 0
  br i1 %56, label %57, label %78

57:                                               ; preds = %55
  %58 = sext i32 %52 to i64
  %59 = load ptr, ptr %0, align 8, !tbaa !14
  %60 = call i64 @fread(ptr noundef nonnull %2, i64 noundef %58, i64 noundef 1, ptr noundef %59)
  %.not57 = icmp eq i64 %60, 1
  br i1 %.not57, label %62, label %61

61:                                               ; preds = %57
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 64, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.1) #5
  br label %62

62:                                               ; preds = %61, %57
  %63 = load i16, ptr %35, align 2
  %64 = add i16 %63, -3
  %65 = icmp ult i16 %64, -2
  br i1 %65, label %66, label %67

66:                                               ; preds = %62
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 71, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.8) #5
  br label %67

67:                                               ; preds = %66, %62
  %68 = load i16, ptr %36, align 4, !tbaa !16
  %69 = sext i16 %68 to i32
  %70 = load i32, ptr %37, align 4, !tbaa !19
  %71 = mul nsw i32 %70, %69
  %72 = load i32, ptr %38, align 4, !tbaa !20
  %.not58 = icmp eq i32 %71, %72
  br i1 %.not58, label %74, label %73

73:                                               ; preds = %67
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 72, ptr noundef nonnull @__FUNCTION__.WAVInfo, ptr noundef nonnull @.str.6) #5
  br label %74

74:                                               ; preds = %73, %67
  %75 = sext i16 %63 to i32
  store i32 %75, ptr %8, align 4, !tbaa !12
  store i32 %70, ptr %7, align 8, !tbaa !8
  %76 = load i16, ptr %39, align 2, !tbaa !21
  %77 = sext i16 %76 to i32
  store i32 %77, ptr %40, align 4, !tbaa !22
  br label %87

78:                                               ; preds = %55
  %bcmp47 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %3, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4)
  %79 = icmp eq i32 %bcmp47, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %78
  %81 = sext i16 %42 to i32
  %82 = sdiv i32 %52, %81
  store i32 %82, ptr %9, align 8, !tbaa !13
  br label %select.unfold

83:                                               ; preds = %78
  %84 = load ptr, ptr %0, align 8, !tbaa !14
  %85 = sext i32 %52 to i64
  %86 = tail call i32 @fseek(ptr noundef %84, i64 noundef %85, i32 noundef 1)
  br label %87

87:                                               ; preds = %83, %74
  %88 = phi i16 [ %42, %83 ], [ %68, %74 ]
  %89 = load ptr, ptr %0, align 8, !tbaa !14
  %90 = tail call i64 @ftell(ptr noundef %89)
  %91 = trunc i64 %90 to i32
  %92 = icmp slt i32 %20, %91
  br i1 %92, label %select.unfold, label %93

93:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %41

select.unfold:                                    ; preds = %87, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  ret void
}

; 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 noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #3

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

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

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

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 = { "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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !11, i64 8}
!9 = !{!"MWAVInfo", !10, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !10, i64 24}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!9, !11, i64 12}
!13 = !{!9, !11, i64 16}
!14 = !{!9, !10, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !18, i64 12}
!17 = !{!"MWAVHeader", !18, i64 0, !18, i64 2, !11, i64 4, !11, i64 8, !18, i64 12, !18, i64 14}
!18 = !{!"short", !6, i64 0}
!19 = !{!17, !11, i64 4}
!20 = !{!17, !11, i64 8}
!21 = !{!17, !18, i64 14}
!22 = !{!9, !11, i64 20}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass