; 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
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__.test_huffman_decode_same_weight = external hidden unnamed_addr constant [39 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1

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

declare ptr @huffman_heap_new(...) #1

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

declare ptr @huffman_tree_from(ptr noundef) #1

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

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

declare void @huffman_tree_free(ptr noundef) #1

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

declare ptr @text_from(ptr noundef) #1

declare ptr @huffman_encode(ptr noundef, ptr noundef) #1

declare void @bitmap_free(ptr noundef) #1

declare void @text_free(ptr noundef) #1

declare ptr @huffman_decode(ptr noundef, ptr noundef) #1

declare i32 @text_compare(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @test_huffman_tree_to_hash_table(ptr noundef) #3

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

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

48:                                               ; preds = %29
  br label %50

49:                                               ; preds = %29
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 153, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

50:                                               ; preds = %48
  br label %51

51:                                               ; preds = %50, %0
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._HuffmanTree, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct._HuffmanNode, ptr %54, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds %struct._HuffmanNode, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds %struct._HuffmanNode, ptr %58, i32 0, i32 0
  %60 = load i8, ptr %59, align 8, !tbaa !14
  %61 = sext i8 %60 to i32
  %62 = icmp ne i32 %61, 98
  br i1 %62, label %63, label %89

63:                                               ; preds = %51
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._HuffmanTree, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct._HuffmanNode, ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = getelementptr inbounds %struct._HuffmanNode, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct._HuffmanNode, ptr %70, i32 0, i32 0
  %72 = load i8, ptr %71, align 8, !tbaa !14
  %73 = sext i8 %72 to i32
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %73, i32 noundef 98)
  %75 = load ptr, ptr %3, 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 !15
  %80 = getelementptr inbounds %struct._HuffmanNode, ptr %79, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct._HuffmanNode, ptr %81, i32 0, i32 0
  %83 = load i8, ptr %82, align 8, !tbaa !14
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 98
  br i1 %85, label %86, label %87

86:                                               ; preds = %63
  br label %88

87:                                               ; preds = %63
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.2, i32 noundef 154, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %88, %51
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._HuffmanTree, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct._HuffmanNode, ptr %92, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds %struct._HuffmanNode, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  %97 = getelementptr inbounds %struct._HuffmanNode, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct._HuffmanNode, ptr %98, i32 0, i32 0
  %100 = load i8, ptr %99, align 8, !tbaa !14
  %101 = sext i8 %100 to i32
  %102 = icmp ne i32 %101, 99
  br i1 %102, label %103, label %133

103:                                              ; preds = %89
  %104 = load ptr, ptr %3, 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 !15
  %109 = getelementptr inbounds %struct._HuffmanNode, ptr %108, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !15
  %111 = getelementptr inbounds %struct._HuffmanNode, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  %113 = getelementptr inbounds %struct._HuffmanNode, ptr %112, i32 0, i32 0
  %114 = load i8, ptr %113, align 8, !tbaa !14
  %115 = sext i8 %114 to i32
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %115, i32 noundef 99)
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._HuffmanTree, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct._HuffmanNode, ptr %119, i32 0, i32 3
  %121 = load ptr, ptr %120, align 8, !tbaa !15
  %122 = getelementptr inbounds %struct._HuffmanNode, ptr %121, i32 0, i32 3
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %124 = getelementptr inbounds %struct._HuffmanNode, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds %struct._HuffmanNode, ptr %125, i32 0, i32 0
  %127 = load i8, ptr %126, align 8, !tbaa !14
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 99
  br i1 %129, label %130, label %131

130:                                              ; preds = %103
  br label %132

131:                                              ; preds = %103
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 155, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

132:                                              ; preds = %130
  br label %133

133:                                              ; preds = %132, %89
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._HuffmanTree, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct._HuffmanNode, ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !15
  %139 = getelementptr inbounds %struct._HuffmanNode, ptr %138, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !15
  %141 = getelementptr inbounds %struct._HuffmanNode, ptr %140, i32 0, i32 3
  %142 = load ptr, ptr %141, align 8, !tbaa !15
  %143 = getelementptr inbounds %struct._HuffmanNode, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  %145 = getelementptr inbounds %struct._HuffmanNode, ptr %144, i32 0, i32 0
  %146 = load i8, ptr %145, align 8, !tbaa !14
  %147 = sext i8 %146 to i32
  %148 = icmp ne i32 %147, 100
  br i1 %148, label %149, label %183

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

180:                                              ; preds = %149
  br label %182

181:                                              ; preds = %149
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.2, i32 noundef 156, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

182:                                              ; preds = %180
  br label %183

183:                                              ; preds = %182, %133
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._HuffmanTree, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct._HuffmanNode, ptr %186, i32 0, i32 3
  %188 = load ptr, ptr %187, align 8, !tbaa !15
  %189 = getelementptr inbounds %struct._HuffmanNode, ptr %188, i32 0, i32 3
  %190 = load ptr, ptr %189, align 8, !tbaa !15
  %191 = getelementptr inbounds %struct._HuffmanNode, ptr %190, i32 0, i32 3
  %192 = load ptr, ptr %191, align 8, !tbaa !15
  %193 = getelementptr inbounds %struct._HuffmanNode, ptr %192, i32 0, i32 3
  %194 = load ptr, ptr %193, align 8, !tbaa !15
  %195 = getelementptr inbounds %struct._HuffmanNode, ptr %194, i32 0, i32 0
  %196 = load i8, ptr %195, align 8, !tbaa !14
  %197 = sext i8 %196 to i32
  %198 = icmp ne i32 %197, 101
  br i1 %198, label %199, label %233

199:                                              ; preds = %183
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._HuffmanTree, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !9
  %203 = getelementptr inbounds %struct._HuffmanNode, ptr %202, i32 0, i32 3
  %204 = load ptr, ptr %203, align 8, !tbaa !15
  %205 = getelementptr inbounds %struct._HuffmanNode, ptr %204, i32 0, i32 3
  %206 = load ptr, ptr %205, align 8, !tbaa !15
  %207 = getelementptr inbounds %struct._HuffmanNode, ptr %206, i32 0, i32 3
  %208 = load ptr, ptr %207, align 8, !tbaa !15
  %209 = getelementptr inbounds %struct._HuffmanNode, ptr %208, i32 0, i32 3
  %210 = load ptr, ptr %209, align 8, !tbaa !15
  %211 = getelementptr inbounds %struct._HuffmanNode, ptr %210, i32 0, i32 0
  %212 = load i8, ptr %211, align 8, !tbaa !14
  %213 = sext i8 %212 to i32
  %214 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %213, i32 noundef 101)
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct._HuffmanTree, ptr %215, i32 0, i32 0
  %217 = load ptr, ptr %216, align 8, !tbaa !9
  %218 = getelementptr inbounds %struct._HuffmanNode, ptr %217, i32 0, i32 3
  %219 = load ptr, ptr %218, align 8, !tbaa !15
  %220 = getelementptr inbounds %struct._HuffmanNode, ptr %219, i32 0, i32 3
  %221 = load ptr, ptr %220, align 8, !tbaa !15
  %222 = getelementptr inbounds %struct._HuffmanNode, ptr %221, i32 0, i32 3
  %223 = load ptr, ptr %222, align 8, !tbaa !15
  %224 = getelementptr inbounds %struct._HuffmanNode, ptr %223, i32 0, i32 3
  %225 = load ptr, ptr %224, align 8, !tbaa !15
  %226 = getelementptr inbounds %struct._HuffmanNode, ptr %225, i32 0, i32 0
  %227 = load i8, ptr %226, align 8, !tbaa !14
  %228 = sext i8 %227 to i32
  %229 = icmp eq i32 %228, 101
  br i1 %229, label %230, label %231

230:                                              ; preds = %199
  br label %232

231:                                              ; preds = %199
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.2, i32 noundef 157, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

232:                                              ; preds = %230
  br label %233

233:                                              ; preds = %232, %183
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  call void @test_huffman_tree_to_hash_table(ptr noundef %234)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %235 = load ptr, ptr %3, align 8, !tbaa !5
  %236 = load ptr, ptr %1, align 8, !tbaa !5
  %237 = call ptr @huffman_encode(ptr noundef %235, ptr noundef %236)
  store ptr %237, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = call ptr @huffman_decode(ptr noundef %238, ptr noundef %239)
  store ptr %240, ptr %5, align 8, !tbaa !5
  %241 = load ptr, ptr %1, align 8, !tbaa !5
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  %243 = call i32 @text_compare(ptr noundef %241, ptr noundef %242)
  %244 = icmp ne i32 %243, 0
  br i1 %244, label %245, label %257

245:                                              ; preds = %233
  %246 = load ptr, ptr %1, align 8, !tbaa !5
  %247 = load ptr, ptr %5, align 8, !tbaa !5
  %248 = call i32 @text_compare(ptr noundef %246, ptr noundef %247)
  %249 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %248, i32 noundef 0)
  %250 = load ptr, ptr %1, align 8, !tbaa !5
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = call i32 @text_compare(ptr noundef %250, ptr noundef %251)
  %253 = icmp eq i32 %252, 0
  br i1 %253, label %254, label %255

254:                                              ; preds = %245
  br label %256

255:                                              ; preds = %245
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.2, i32 noundef 165, ptr noundef @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

256:                                              ; preds = %254
  br label %257

257:                                              ; preds = %256, %233
  %258 = load ptr, ptr %4, align 8, !tbaa !5
  call void @bitmap_free(ptr noundef %258)
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  call void @text_free(ptr noundef %259)
  %260 = load ptr, ptr %1, align 8, !tbaa !5
  call void @text_free(ptr noundef %260)
  %261 = load ptr, ptr %3, align 8, !tbaa !5
  call void @huffman_tree_free(ptr noundef %261)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 = { 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, !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
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__.test_huffman_decode_same_weight = external hidden unnamed_addr constant [39 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1

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

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

declare ptr @huffman_tree_from(ptr noundef) local_unnamed_addr #0

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

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

declare void @huffman_tree_free(ptr noundef) local_unnamed_addr #0

declare ptr @text_from(ptr noundef) local_unnamed_addr #0

declare ptr @huffman_encode(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @bitmap_free(ptr noundef) local_unnamed_addr #0

declare void @text_free(ptr noundef) local_unnamed_addr #0

declare ptr @huffman_decode(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @text_compare(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @test_huffman_tree_to_hash_table(ptr noundef) local_unnamed_addr #3

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

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

21:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 153, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

22:                                               ; preds = %13, %0
  %23 = phi ptr [ %16, %13 ], [ %9, %0 ]
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !10
  %28 = load i8, ptr %27, align 8, !tbaa !13
  %.not40 = icmp eq i8 %28, 98
  br i1 %.not40, label %40, label %29

29:                                               ; preds = %22
  %30 = sext i8 %28 to i32
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %30, i32 noundef 98)
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !10
  %37 = load i8, ptr %36, align 8, !tbaa !13
  %38 = icmp eq i8 %37, 98
  br i1 %38, label %40, label %39

39:                                               ; preds = %29
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.2, i32 noundef 154, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

40:                                               ; preds = %29, %22
  %41 = phi ptr [ %34, %29 ], [ %25, %22 ]
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !10
  %46 = load i8, ptr %45, align 8, !tbaa !13
  %.not41 = icmp eq i8 %46, 99
  br i1 %.not41, label %60, label %47

47:                                               ; preds = %40
  %48 = sext i8 %46 to i32
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %48, i32 noundef 99)
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !10
  %57 = load i8, ptr %56, align 8, !tbaa !13
  %58 = icmp eq i8 %57, 99
  br i1 %58, label %60, label %59

59:                                               ; preds = %47
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 155, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

60:                                               ; preds = %47, %40
  %61 = phi ptr [ %54, %47 ], [ %43, %40 ]
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !10
  %66 = load i8, ptr %65, align 8, !tbaa !13
  %.not42 = icmp eq i8 %66, 100
  br i1 %.not42, label %82, label %67

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

81:                                               ; preds = %67
  tail call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.2, i32 noundef 156, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

82:                                               ; preds = %67, %60
  %83 = phi ptr [ %76, %67 ], [ %63, %60 ]
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %85 = load ptr, ptr %84, align 8, !tbaa !14
  %86 = load i8, ptr %85, align 8, !tbaa !13
  %.not43 = icmp eq i8 %86, 101
  br i1 %.not43, label %102, label %87

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

101:                                              ; preds = %87
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.2, i32 noundef 157, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

102:                                              ; preds = %87, %82
  tail call void @test_huffman_tree_to_hash_table(ptr noundef nonnull %8)
  %103 = tail call ptr @huffman_encode(ptr noundef nonnull %8, ptr noundef %1) #4
  %104 = tail call ptr @huffman_decode(ptr noundef nonnull %8, ptr noundef %103) #4
  %105 = tail call i32 @text_compare(ptr noundef %1, ptr noundef %104) #4
  %.not44 = icmp eq i32 %105, 0
  br i1 %.not44, label %112, label %106

106:                                              ; preds = %102
  %107 = tail call i32 @text_compare(ptr noundef %1, ptr noundef %104) #4
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %107, i32 noundef 0)
  %109 = tail call i32 @text_compare(ptr noundef %1, ptr noundef %104) #4
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %112, label %111

111:                                              ; preds = %106
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.2, i32 noundef 165, ptr noundef nonnull @__PRETTY_FUNCTION__.test_huffman_decode_same_weight) #5
  unreachable

112:                                              ; preds = %106, %102
  tail call void @bitmap_free(ptr noundef %103) #4
  tail call void @text_free(ptr noundef %104) #4
  tail call void @text_free(ptr noundef %1) #4
  tail call void @huffman_tree_free(ptr noundef nonnull %8) #4
  ret void
}

attributes #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 = { 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 #2 = { 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 #3 = { 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 = { 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, !7, i64 16}


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