; LLVM IR from vul337/PrIntFuzz :: config/linux/firmware/carl9170fw/tools/src (fwinfo)

; 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.anon = type { [4 x i8], i8, ptr, i16 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@known_magics = external hidden constant [8 x %struct.anon], align 16
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = icmp ne i32 %11, 2
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i32 -22, ptr %9, align 4, !tbaa !5
  br label %101

14:                                               ; preds = %2
  %15 = load ptr, ptr %5, align 8, !tbaa !9
  %16 = getelementptr inbounds ptr, ptr %15, i64 1
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = call ptr @carlfw_load(ptr noundef %17)
  store ptr %18, ptr %6, align 8, !tbaa !9
  %19 = load ptr, ptr %6, align 8, !tbaa !9
  %20 = call i64 @IS_ERR_OR_NULL(ptr noundef %19)
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %22, label %32

22:                                               ; preds = %14
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = call i64 @PTR_ERR(ptr noundef %23)
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %9, align 4, !tbaa !5
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 1
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str, ptr noundef %29, i32 noundef %30) #5
  br label %101

32:                                               ; preds = %14
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = call ptr @carlfw_get_fw(ptr noundef %33, ptr noundef %10)
  %35 = load ptr, ptr @stdout, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.1) #5
  %37 = load ptr, ptr @stdout, align 8, !tbaa !9
  %38 = load i64, ptr %10, align 8, !tbaa !11
  %39 = trunc i64 %38 to i32
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.2, i32 noundef %39) #5
  %41 = load ptr, ptr @stdout, align 8, !tbaa !9
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = call i32 @carlfw_get_descs_num(ptr noundef %42)
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = call i32 @carlfw_get_descs_size(ptr noundef %44)
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.3, i32 noundef %43, i32 noundef %45) #5
  store ptr null, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr @stdout, align 8, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.4) #5
  br label %49

49:                                               ; preds = %97, %32
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = load ptr, ptr %7, align 8, !tbaa !9
  %52 = call ptr @carlfw_desc_next(ptr noundef %50, ptr noundef %51)
  store ptr %52, ptr %7, align 8, !tbaa !9
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %100

54:                                               ; preds = %49
  %55 = load ptr, ptr %7, align 8, !tbaa !9
  call void @show_desc_head(ptr noundef %55)
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %87, %54
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = zext i32 %57 to i64
  %59 = icmp ult i64 %58, 8
  br i1 %59, label %60, label %90

60:                                               ; preds = %56
  %61 = load ptr, ptr %7, align 8, !tbaa !9
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds [8 x %struct.anon], ptr @known_magics, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.anon, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds [4 x i8], ptr %65, i64 0, i64 0
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds [8 x %struct.anon], ptr @known_magics, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.anon, ptr %69, i32 0, i32 3
  %71 = load i16, ptr %70, align 8, !tbaa !13
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds [8 x %struct.anon], ptr @known_magics, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.anon, ptr %74, i32 0, i32 1
  %76 = load i8, ptr %75, align 4, !tbaa !16
  %77 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef %61, ptr noundef %66, i16 noundef zeroext %71, i8 noundef zeroext %76)
  br i1 %77, label %78, label %86

78:                                               ; preds = %60
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds [8 x %struct.anon], ptr @known_magics, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.anon, ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !17
  %84 = load ptr, ptr %7, align 8, !tbaa !9
  %85 = load ptr, ptr %6, align 8, !tbaa !9
  call void %83(ptr noundef %84, ptr noundef %85)
  br label %90

86:                                               ; preds = %60
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = add i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !5
  br label %56, !llvm.loop !18

90:                                               ; preds = %78, %56
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = zext i32 %91 to i64
  %93 = icmp eq i64 %92, 8
  br i1 %93, label %94, label %97

94:                                               ; preds = %90
  %95 = load ptr, ptr @stderr, align 8, !tbaa !9
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.5) #5
  br label %97

97:                                               ; preds = %94, %90
  %98 = load ptr, ptr @stdout, align 8, !tbaa !9
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.6) #5
  br label %49, !llvm.loop !20

100:                                              ; preds = %49
  br label %101

101:                                              ; preds = %100, %22, %13
  %102 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %102, label %104 [
    i32 0, label %110
    i32 -22, label %103
  ]

103:                                              ; preds = %101
  call void @fwinfo_info()
  br label %110

104:                                              ; preds = %101
  %105 = load ptr, ptr @stderr, align 8, !tbaa !9
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = sub nsw i32 0, %106
  %108 = call ptr @strerror(i32 noundef %107) #5
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.7, ptr noundef %108) #5
  br label %110

110:                                              ; preds = %104, %103, %101
  %111 = load ptr, ptr %6, align 8, !tbaa !9
  call void @carlfw_release(ptr noundef %111)
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, i32 1, i32 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i32 %115
}

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

declare ptr @carlfw_load(ptr noundef) #2

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

declare ptr @carlfw_get_fw(ptr noundef, ptr noundef) #2

declare i32 @carlfw_get_descs_num(ptr noundef) #2

declare i32 @carlfw_get_descs_size(ptr noundef) #2

declare ptr @carlfw_desc_next(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @show_desc_head(ptr noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @carl9170fw_desc_cmp(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext) #3

; Function Attrs: nounwind uwtable
declare hidden void @fwinfo_info() #0

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #4

declare void @carlfw_release(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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 16}
!14 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !15, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !7, i64 4}
!17 = !{!14, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.anon = type { [4 x i8], i8, ptr, i16 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@known_magics = external hidden constant [8 x %struct.anon], align 16
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %4, label %.thread38

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call ptr @carlfw_load(ptr noundef %6) #6
  %8 = tail call i64 @IS_ERR_OR_NULL(ptr noundef %7)
  %.not30 = icmp eq i64 %8, 0
  br i1 %.not30, label %9, label %63

9:                                                ; preds = %4
  %10 = call ptr @carlfw_get_fw(ptr noundef %7, ptr noundef nonnull %3) #6
  %11 = load ptr, ptr @stdout, align 8, !tbaa !5
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1) #6
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  %14 = load i64, ptr %3, align 8, !tbaa !9
  %15 = trunc i64 %14 to i32
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.2, i32 noundef %15) #6
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = call i32 @carlfw_get_descs_num(ptr noundef %7) #6
  %19 = call i32 @carlfw_get_descs_size(ptr noundef %7) #6
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.3, i32 noundef %18, i32 noundef %19) #6
  %21 = load ptr, ptr @stdout, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.4) #6
  %23 = call ptr @carlfw_desc_next(ptr noundef %7, ptr noundef null) #6
  %.not3145 = icmp eq ptr %23, null
  br i1 %.not3145, label %.thread33, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %9
  %.pre = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 16), align 16, !tbaa !11
  %.pre49 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 4), align 4, !tbaa !14
  %24 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 40), align 8
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 28), align 4
  %26 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 64), align 16
  %27 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 52), align 4
  %28 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 88), align 8
  %29 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 76), align 4
  %30 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 112), align 16
  %31 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 100), align 4
  %32 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 136), align 8
  %33 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 124), align 4
  %34 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 160), align 16
  %35 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 148), align 4
  %36 = load i16, ptr getelementptr inbounds (i8, ptr @known_magics, i64 184), align 8
  %37 = load i8, ptr getelementptr inbounds (i8, ptr @known_magics, i64 172), align 4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %59
  %38 = phi ptr [ %62, %59 ], [ %23, %.lr.ph.preheader ]
  call void @show_desc_head(ptr noundef nonnull %38)
  %39 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull @known_magics, i16 noundef zeroext %.pre, i8 noundef zeroext %.pre49)
  br i1 %39, label %.thread, label %42

.thread:                                          ; preds = %54, %52, %50, %48, %46, %44, %42, %.lr.ph
  %.lcssa = phi ptr [ @known_magics, %.lr.ph ], [ getelementptr inbounds (i8, ptr @known_magics, i64 24), %42 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 48), %44 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 72), %46 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 96), %48 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 120), %50 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 144), %52 ], [ getelementptr inbounds (i8, ptr @known_magics, i64 168), %54 ]
  %40 = getelementptr inbounds i8, ptr %.lcssa, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  call void %41(ptr noundef nonnull %38, ptr noundef %7) #6
  br label %59

42:                                               ; preds = %.lr.ph
  %43 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 24), i16 noundef zeroext %24, i8 noundef zeroext %25)
  br i1 %43, label %.thread, label %44

44:                                               ; preds = %42
  %45 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 48), i16 noundef zeroext %26, i8 noundef zeroext %27)
  br i1 %45, label %.thread, label %46

46:                                               ; preds = %44
  %47 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 72), i16 noundef zeroext %28, i8 noundef zeroext %29)
  br i1 %47, label %.thread, label %48

48:                                               ; preds = %46
  %49 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 96), i16 noundef zeroext %30, i8 noundef zeroext %31)
  br i1 %49, label %.thread, label %50

50:                                               ; preds = %48
  %51 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 120), i16 noundef zeroext %32, i8 noundef zeroext %33)
  br i1 %51, label %.thread, label %52

52:                                               ; preds = %50
  %53 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 144), i16 noundef zeroext %34, i8 noundef zeroext %35)
  br i1 %53, label %.thread, label %54

54:                                               ; preds = %52
  %55 = call zeroext i1 @carl9170fw_desc_cmp(ptr noundef nonnull %38, ptr noundef nonnull getelementptr inbounds (i8, ptr @known_magics, i64 168), i16 noundef zeroext %36, i8 noundef zeroext %37)
  br i1 %55, label %.thread, label %56

56:                                               ; preds = %54
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.5) #7
  br label %59

59:                                               ; preds = %.thread, %56
  %60 = load ptr, ptr @stdout, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.6) #6
  %62 = call ptr @carlfw_desc_next(ptr noundef %7, ptr noundef nonnull %38) #6
  %.not31 = icmp eq ptr %62, null
  br i1 %.not31, label %.thread33, label %.lr.ph, !llvm.loop !16

63:                                               ; preds = %4
  %64 = tail call i64 @PTR_ERR(ptr noundef %7)
  %65 = trunc i64 %64 to i32
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str, ptr noundef %67, i32 noundef %65) #7
  switch i32 %65, label %69 [
    i32 0, label %.thread33
    i32 -22, label %.thread38
  ]

.thread38:                                        ; preds = %2, %63
  %.02741 = phi ptr [ %7, %63 ], [ null, %2 ]
  tail call void @fwinfo_info()
  br label %.thread33

69:                                               ; preds = %63
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = sub nsw i32 0, %65
  %72 = tail call ptr @strerror(i32 noundef %71) #6
  %73 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.7, ptr noundef %72) #7
  %74 = icmp ne i32 %65, 0
  %75 = zext i1 %74 to i32
  br label %.thread33

.thread33:                                        ; preds = %59, %9, %69, %.thread38, %63
  %.037 = phi i32 [ %75, %69 ], [ 1, %.thread38 ], [ %65, %63 ], [ 0, %9 ], [ 0, %59 ]
  %.02736 = phi ptr [ %7, %69 ], [ %.02741, %.thread38 ], [ %7, %63 ], [ %7, %9 ], [ %7, %59 ]
  call void @carlfw_release(ptr noundef %.02736) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.037
}

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

declare ptr @carlfw_load(ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @carlfw_get_fw(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @carlfw_get_descs_num(ptr noundef) local_unnamed_addr #2

declare i32 @carlfw_get_descs_size(ptr noundef) local_unnamed_addr #2

declare ptr @carlfw_desc_next(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @show_desc_head(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @carl9170fw_desc_cmp(ptr noundef, ptr noundef, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @fwinfo_info() local_unnamed_addr #0

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #5

declare void @carlfw_release(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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 = { mustprogress 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { cold 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"", !7, i64 0, !7, i64 4, !6, i64 8, !13, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !7, i64 4}
!15 = !{!12, !6, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass