; LLVM IR from hutusi/rethink-c :: test (test_huffman)

; 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._HuffmanTree = type { ptr }
%struct._HuffmanNode = type { i8, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.test_huffman_tree = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @test_huffman_tree() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %3 = call ptr (...) @huffman_heap_new()
  store ptr %3, ptr %1, align 8, !tbaa !5
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = call i32 @huffman_heap_insert(ptr noundef %4, i8 noundef signext 97, i32 noundef 7)
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = call i32 @huffman_heap_insert(ptr noundef %6, i8 noundef signext 98, i32 noundef 5)
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = call i32 @huffman_heap_insert(ptr noundef %8, i8 noundef signext 99, i32 noundef 3)
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = call i32 @huffman_heap_insert(ptr noundef %10, i8 noundef signext 100, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = call ptr @huffman_tree_from(ptr noundef %12)
  store ptr %13, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._HuffmanTree, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct._HuffmanNode, ptr %16, i32 0, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct._HuffmanNode, ptr %18, i32 0, i32 0
  %20 = load i8, ptr %19, align 8, !tbaa !14
  %21 = sext i8 %20 to i32
  %22 = icmp ne i32 %21, 97
  br i1 %22, label %23, label %45

23:                                               ; preds = %0
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._HuffmanTree, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct._HuffmanNode, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct._HuffmanNode, ptr %28, i32 0, i32 0
  %30 = load i8, ptr %29, align 8, !tbaa !14
  %31 = sext i8 %30 to i32
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %31, i32 noundef 97)
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._HuffmanTree, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct._HuffmanNode, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct._HuffmanNode, ptr %37, i32 0, i32 0
  %39 = load i8, ptr %38, align 8, !tbaa !14
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 97
  br i1 %41, label %42, label %43

42:                                               ; preds = %23
  br label %44

43:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 27, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

44:                                               ; preds = %42
  br label %45

45:                                               ; preds = %44, %0
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._HuffmanTree, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct._HuffmanNode, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct._HuffmanNode, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !15
  %53 = icmp ne i32 %52, 7
  br i1 %53, label %54, label %74

54:                                               ; preds = %45
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._HuffmanTree, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct._HuffmanNode, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct._HuffmanNode, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !15
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %61, i32 noundef 7)
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._HuffmanTree, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct._HuffmanNode, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds %struct._HuffmanNode, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = icmp eq i32 %69, 7
  br i1 %70, label %71, label %72

71:                                               ; preds = %54
  br label %73

72:                                               ; preds = %54
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 28, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %73, %45
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._HuffmanTree, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct._HuffmanNode, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %80 = getelementptr inbounds %struct._HuffmanNode, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !15
  %82 = icmp ne i32 %81, 9
  br i1 %82, label %83, label %103

83:                                               ; preds = %74
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._HuffmanTree, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct._HuffmanNode, ptr %86, i32 0, i32 3
  %88 = load ptr, ptr %87, align 8, !tbaa !16
  %89 = getelementptr inbounds %struct._HuffmanNode, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %90, i32 noundef 9)
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._HuffmanTree, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct._HuffmanNode, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !16
  %97 = getelementptr inbounds %struct._HuffmanNode, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !15
  %99 = icmp eq i32 %98, 9
  br i1 %99, label %100, label %101

100:                                              ; preds = %83
  br label %102

101:                                              ; preds = %83
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 29, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

102:                                              ; preds = %100
  br label %103

103:                                              ; preds = %102, %74
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._HuffmanTree, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct._HuffmanNode, ptr %106, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = getelementptr inbounds %struct._HuffmanNode, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds %struct._HuffmanNode, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !15
  %113 = icmp ne i32 %112, 4
  br i1 %113, label %114, label %138

114:                                              ; preds = %103
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._HuffmanTree, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct._HuffmanNode, ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !16
  %120 = getelementptr inbounds %struct._HuffmanNode, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !11
  %122 = getelementptr inbounds %struct._HuffmanNode, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !15
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %123, i32 noundef 4)
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._HuffmanTree, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct._HuffmanNode, ptr %127, i32 0, i32 3
  %129 = load ptr, ptr %128, align 8, !tbaa !16
  %130 = getelementptr inbounds %struct._HuffmanNode, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %struct._HuffmanNode, ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !15
  %134 = icmp eq i32 %133, 4
  br i1 %134, label %135, label %136

135:                                              ; preds = %114
  br label %137

136:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 30, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

137:                                              ; preds = %135
  br label %138

138:                                              ; preds = %137, %103
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct._HuffmanTree, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !9
  %142 = getelementptr inbounds %struct._HuffmanNode, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !16
  %144 = getelementptr inbounds %struct._HuffmanNode, ptr %143, i32 0, i32 3
  %145 = load ptr, ptr %144, align 8, !tbaa !16
  %146 = getelementptr inbounds %struct._HuffmanNode, ptr %145, i32 0, i32 0
  %147 = load i8, ptr %146, align 8, !tbaa !14
  %148 = sext i8 %147 to i32
  %149 = icmp ne i32 %148, 98
  br i1 %149, label %150, label %176

150:                                              ; preds = %138
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._HuffmanTree, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct._HuffmanNode, ptr %153, i32 0, i32 3
  %155 = load ptr, ptr %154, align 8, !tbaa !16
  %156 = getelementptr inbounds %struct._HuffmanNode, ptr %155, i32 0, i32 3
  %157 = load ptr, ptr %156, align 8, !tbaa !16
  %158 = getelementptr inbounds %struct._HuffmanNode, ptr %157, i32 0, i32 0
  %159 = load i8, ptr %158, align 8, !tbaa !14
  %160 = sext i8 %159 to i32
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %160, i32 noundef 98)
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct._HuffmanTree, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !9
  %165 = getelementptr inbounds %struct._HuffmanNode, ptr %164, i32 0, i32 3
  %166 = load ptr, ptr %165, align 8, !tbaa !16
  %167 = getelementptr inbounds %struct._HuffmanNode, ptr %166, i32 0, i32 3
  %168 = load ptr, ptr %167, align 8, !tbaa !16
  %169 = getelementptr inbounds %struct._HuffmanNode, ptr %168, i32 0, i32 0
  %170 = load i8, ptr %169, align 8, !tbaa !14
  %171 = sext i8 %170 to i32
  %172 = icmp eq i32 %171, 98
  br i1 %172, label %173, label %174

173:                                              ; preds = %150
  br label %175

174:                                              ; preds = %150
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 31, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

175:                                              ; preds = %173
  br label %176

176:                                              ; preds = %175, %138
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct._HuffmanTree, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = getelementptr inbounds %struct._HuffmanNode, ptr %179, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !16
  %182 = getelementptr inbounds %struct._HuffmanNode, ptr %181, i32 0, i32 2
  %183 = load ptr, ptr %182, align 8, !tbaa !11
  %184 = getelementptr inbounds %struct._HuffmanNode, ptr %183, i32 0, i32 2
  %185 = load ptr, ptr %184, align 8, !tbaa !11
  %186 = getelementptr inbounds %struct._HuffmanNode, ptr %185, i32 0, i32 0
  %187 = load i8, ptr %186, align 8, !tbaa !14
  %188 = sext i8 %187 to i32
  %189 = icmp ne i32 %188, 100
  br i1 %189, label %190, label %220

190:                                              ; preds = %176
  %191 = load ptr, ptr %2, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._HuffmanTree, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct._HuffmanNode, ptr %193, i32 0, i32 3
  %195 = load ptr, ptr %194, align 8, !tbaa !16
  %196 = getelementptr inbounds %struct._HuffmanNode, ptr %195, i32 0, i32 2
  %197 = load ptr, ptr %196, align 8, !tbaa !11
  %198 = getelementptr inbounds %struct._HuffmanNode, ptr %197, i32 0, i32 2
  %199 = load ptr, ptr %198, align 8, !tbaa !11
  %200 = getelementptr inbounds %struct._HuffmanNode, ptr %199, i32 0, i32 0
  %201 = load i8, ptr %200, align 8, !tbaa !14
  %202 = sext i8 %201 to i32
  %203 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %202, i32 noundef 100)
  %204 = load ptr, ptr %2, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._HuffmanTree, ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %205, align 8, !tbaa !9
  %207 = getelementptr inbounds %struct._HuffmanNode, ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !16
  %209 = getelementptr inbounds %struct._HuffmanNode, ptr %208, i32 0, i32 2
  %210 = load ptr, ptr %209, align 8, !tbaa !11
  %211 = getelementptr inbounds %struct._HuffmanNode, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !11
  %213 = getelementptr inbounds %struct._HuffmanNode, ptr %212, i32 0, i32 0
  %214 = load i8, ptr %213, align 8, !tbaa !14
  %215 = sext i8 %214 to i32
  %216 = icmp eq i32 %215, 100
  br i1 %216, label %217, label %218

217:                                              ; preds = %190
  br label %219

218:                                              ; preds = %190
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 32, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

219:                                              ; preds = %217
  br label %220

220:                                              ; preds = %219, %176
  %221 = load ptr, ptr %2, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._HuffmanTree, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !9
  %224 = getelementptr inbounds %struct._HuffmanNode, ptr %223, i32 0, i32 3
  %225 = load ptr, ptr %224, align 8, !tbaa !16
  %226 = getelementptr inbounds %struct._HuffmanNode, ptr %225, i32 0, i32 2
  %227 = load ptr, ptr %226, align 8, !tbaa !11
  %228 = getelementptr inbounds %struct._HuffmanNode, ptr %227, i32 0, i32 3
  %229 = load ptr, ptr %228, align 8, !tbaa !16
  %230 = getelementptr inbounds %struct._HuffmanNode, ptr %229, i32 0, i32 0
  %231 = load i8, ptr %230, align 8, !tbaa !14
  %232 = sext i8 %231 to i32
  %233 = icmp ne i32 %232, 99
  br i1 %233, label %234, label %264

234:                                              ; preds = %220
  %235 = load ptr, ptr %2, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct._HuffmanTree, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  %238 = getelementptr inbounds %struct._HuffmanNode, ptr %237, i32 0, i32 3
  %239 = load ptr, ptr %238, align 8, !tbaa !16
  %240 = getelementptr inbounds %struct._HuffmanNode, ptr %239, i32 0, i32 2
  %241 = load ptr, ptr %240, align 8, !tbaa !11
  %242 = getelementptr inbounds %struct._HuffmanNode, ptr %241, i32 0, i32 3
  %243 = load ptr, ptr %242, align 8, !tbaa !16
  %244 = getelementptr inbounds %struct._HuffmanNode, ptr %243, i32 0, i32 0
  %245 = load i8, ptr %244, align 8, !tbaa !14
  %246 = sext i8 %245 to i32
  %247 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %246, i32 noundef 99)
  %248 = load ptr, ptr %2, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct._HuffmanTree, ptr %248, i32 0, i32 0
  %250 = load ptr, ptr %249, align 8, !tbaa !9
  %251 = getelementptr inbounds %struct._HuffmanNode, ptr %250, i32 0, i32 3
  %252 = load ptr, ptr %251, align 8, !tbaa !16
  %253 = getelementptr inbounds %struct._HuffmanNode, ptr %252, i32 0, i32 2
  %254 = load ptr, ptr %253, align 8, !tbaa !11
  %255 = getelementptr inbounds %struct._HuffmanNode, ptr %254, i32 0, i32 3
  %256 = load ptr, ptr %255, align 8, !tbaa !16
  %257 = getelementptr inbounds %struct._HuffmanNode, ptr %256, i32 0, i32 0
  %258 = load i8, ptr %257, align 8, !tbaa !14
  %259 = sext i8 %258 to i32
  %260 = icmp eq i32 %259, 99
  br i1 %260, label %261, label %262

261:                                              ; preds = %234
  br label %263

262:                                              ; preds = %234
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.2, i32 noundef 33, ptr noundef @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

263:                                              ; preds = %261
  br label %264

264:                                              ; preds = %263, %220
  %265 = load ptr, ptr %2, align 8, !tbaa !5
  call void @huffman_tree_free(ptr noundef %265)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

declare ptr @huffman_heap_new(...) #2

declare i32 @huffman_heap_insert(ptr noundef, i8 noundef signext, i32 noundef) #2

declare ptr @huffman_tree_from(ptr noundef) #2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare void @huffman_tree_free(ptr noundef) #2

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

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_HuffmanTree", !6, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_HuffmanNode", !7, i64 0, !13, i64 4, !6, i64 8, !6, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !7, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!12, !6, i64 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"

@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.test_huffman_tree = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @test_huffman_tree() local_unnamed_addr #0 {
  %1 = tail call ptr (...) @huffman_heap_new() #4
  %2 = tail call i32 @huffman_heap_insert(ptr noundef %1, i8 noundef signext 97, i32 noundef 7) #4
  %3 = tail call i32 @huffman_heap_insert(ptr noundef %1, i8 noundef signext 98, i32 noundef 5) #4
  %4 = tail call i32 @huffman_heap_insert(ptr noundef %1, i8 noundef signext 99, i32 noundef 3) #4
  %5 = tail call i32 @huffman_heap_insert(ptr noundef %1, i8 noundef signext 100, i32 noundef 1) #4
  %6 = tail call ptr @huffman_tree_from(ptr noundef %1) #4
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !10
  %10 = load i8, ptr %9, align 8, !tbaa !13
  %.not = icmp eq i8 %10, 97
  br i1 %.not, label %20, label %11

11:                                               ; preds = %0
  %12 = sext i8 %10 to i32
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12, i32 noundef 97)
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !10
  %17 = load i8, ptr %16, align 8, !tbaa !13
  %18 = icmp eq i8 %17, 97
  br i1 %18, label %20, label %19

19:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 27, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

20:                                               ; preds = %11, %0
  %21 = phi ptr [ %16, %11 ], [ %9, %0 ]
  %22 = phi ptr [ %14, %11 ], [ %7, %0 ]
  %23 = getelementptr inbounds i8, ptr %21, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %.not33 = icmp eq i32 %24, 7
  br i1 %.not33, label %34, label %25

25:                                               ; preds = %20
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %24, i32 noundef 7)
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !10
  %30 = getelementptr inbounds i8, ptr %29, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = icmp eq i32 %31, 7
  br i1 %32, label %34, label %33

33:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 28, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

34:                                               ; preds = %25, %20
  %35 = phi ptr [ %27, %25 ], [ %22, %20 ]
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !14
  %.not34 = icmp eq i32 %39, 9
  br i1 %.not34, label %49, label %40

40:                                               ; preds = %34
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %39, i32 noundef 9)
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = getelementptr inbounds i8, ptr %44, i64 4
  %46 = load i32, ptr %45, align 4, !tbaa !14
  %47 = icmp eq i32 %46, 9
  br i1 %47, label %49, label %48

48:                                               ; preds = %40
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

49:                                               ; preds = %40, %34
  %50 = phi ptr [ %44, %40 ], [ %37, %34 ]
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !10
  %53 = getelementptr inbounds i8, ptr %52, i64 4
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %.not35 = icmp eq i32 %54, 4
  br i1 %.not35, label %66, label %55

55:                                               ; preds = %49
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %54, i32 noundef 4)
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %59 = load ptr, ptr %58, align 8, !tbaa !15
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !10
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !14
  %64 = icmp eq i32 %63, 4
  br i1 %64, label %66, label %65

65:                                               ; preds = %55
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 30, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

66:                                               ; preds = %55, %49
  %67 = phi ptr [ %59, %55 ], [ %50, %49 ]
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  %70 = load i8, ptr %69, align 8, !tbaa !13
  %.not36 = icmp eq i8 %70, 98
  br i1 %.not36, label %82, label %71

71:                                               ; preds = %66
  %72 = sext i8 %70 to i32
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %72, i32 noundef 98)
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = getelementptr inbounds i8, ptr %76, i64 16
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = load i8, ptr %78, align 8, !tbaa !13
  %80 = icmp eq i8 %79, 98
  br i1 %80, label %82, label %81

81:                                               ; preds = %71
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 31, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

82:                                               ; preds = %71, %66
  %83 = phi ptr [ %76, %71 ], [ %67, %66 ]
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = load ptr, ptr %84, align 8, !tbaa !10
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = load ptr, ptr %86, align 8, !tbaa !10
  %88 = load i8, ptr %87, align 8, !tbaa !13
  %.not37 = icmp eq i8 %88, 100
  br i1 %.not37, label %102, label %89

89:                                               ; preds = %82
  %90 = sext i8 %88 to i32
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %90, i32 noundef 100)
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 16
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds i8, ptr %94, i64 8
  %96 = load ptr, ptr %95, align 8, !tbaa !10
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  %98 = load ptr, ptr %97, align 8, !tbaa !10
  %99 = load i8, ptr %98, align 8, !tbaa !13
  %100 = icmp eq i8 %99, 100
  br i1 %100, label %102, label %101

101:                                              ; preds = %89
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 32, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

102:                                              ; preds = %89, %82
  %103 = phi ptr [ %96, %89 ], [ %85, %82 ]
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = load i8, ptr %105, align 8, !tbaa !13
  %.not38 = icmp eq i8 %106, 99
  br i1 %.not38, label %120, label %107

107:                                              ; preds = %102
  %108 = sext i8 %106 to i32
  %109 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %108, i32 noundef 99)
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %110, i64 16
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = getelementptr inbounds i8, ptr %112, i64 8
  %114 = load ptr, ptr %113, align 8, !tbaa !10
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  %116 = load ptr, ptr %115, align 8, !tbaa !15
  %117 = load i8, ptr %116, align 8, !tbaa !13
  %118 = icmp eq i8 %117, 99
  br i1 %118, label %120, label %119

119:                                              ; preds = %107
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.2, i32 noundef 33, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_tree) #5
  unreachable

120:                                              ; preds = %107, %102
  tail call void @huffman_tree_free(ptr noundef nonnull %6) #4
  ret void
}

declare ptr @huffman_heap_new(...) local_unnamed_addr #1

declare i32 @huffman_heap_insert(ptr noundef, i8 noundef signext, i32 noundef) local_unnamed_addr #1

declare ptr @huffman_tree_from(ptr noundef) local_unnamed_addr #1

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

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

declare void @huffman_tree_free(ptr noundef) local_unnamed_addr #1

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 = { "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 = { 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_HuffmanTree", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 8}
!11 = !{!"_HuffmanNode", !8, i64 0, !12, i64 4, !7, i64 8, !7, i64 16}
!12 = !{!"int", !8, i64 0}
!13 = !{!11, !8, i64 0}
!14 = !{!11, !12, i64 4}
!15 = !{!11, !7, i64 16}


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