; LLVM IR from q191201771/libchef :: test/chef_base_test (chef_filelock_test)

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

%"class.chef::check_log" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.chef::filelock" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.chef::check_log", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca %"class.chef::filelock", 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 32, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %14 unwind label %26

14:                                               ; preds = %2
  invoke void @_ZN4chef9check_logC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %15 unwind label %30

15:                                               ; preds = %14
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #9
  invoke void @_ZL7examplev()
          to label %16 unwind label %35

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #9
  store i8 1, ptr %11, align 1, !tbaa !11
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 2
  br i1 %18, label %19, label %39

19:                                               ; preds = %16
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call i32 @strcmp(ptr noundef %22, ptr noundef @.str.1) #10
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %39

25:                                               ; preds = %19
  store i8 0, ptr %11, align 1, !tbaa !11
  br label %39

26:                                               ; preds = %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %9, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %10, align 4
  br label %34

30:                                               ; preds = %14
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %9, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  br label %34

34:                                               ; preds = %30, %26
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #9
  br label %160

35:                                               ; preds = %15
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  br label %159

39:                                               ; preds = %25, %19, %16
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #9
  invoke void @_ZN4chef8filelockC2Ev(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %40 unwind label %56

40:                                               ; preds = %39
  %41 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %42 unwind label %60

42:                                               ; preds = %40
  %43 = invoke noundef zeroext i1 @_ZN4chef8filelock6attachEPKc(ptr noundef nonnull align 8 dereferenceable(36) %13, ptr noundef @.str.3)
          to label %44 unwind label %60

44:                                               ; preds = %42
  %45 = zext i1 %43 to i8
  store i8 %45, ptr %12, align 1, !tbaa !11
  %46 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %47 = trunc i8 %46 to i1
  %48 = zext i1 %47 to i32
  %49 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %48)
          to label %50 unwind label %60

50:                                               ; preds = %44
  %51 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %52 = trunc i8 %51 to i1
  br i1 %52, label %64, label %53

53:                                               ; preds = %50
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str, i32 noundef 26) #9
  call void @exit(i32 noundef -1) #11
  unreachable

56:                                               ; preds = %39
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  br label %158

60:                                               ; preds = %151, %142, %140, %138, %136, %134, %129, %120, %118, %113, %104, %102, %97, %88, %86, %81, %66, %64, %44, %42, %40
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %9, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %10, align 4
  call void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %13) #9
  br label %158

64:                                               ; preds = %50
  %65 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7)
          to label %66 unwind label %60

66:                                               ; preds = %64
  %67 = invoke noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %68 unwind label %60

68:                                               ; preds = %66
  %69 = zext i1 %67 to i8
  store i8 %69, ptr %12, align 1, !tbaa !11
  %70 = load i8, ptr %11, align 1, !tbaa !11, !range !13, !noundef !14
  %71 = trunc i8 %70 to i1
  br i1 %71, label %72, label %75

72:                                               ; preds = %68
  %73 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %74 = trunc i8 %73 to i1
  br i1 %74, label %81, label %78

75:                                               ; preds = %68
  %76 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %77 = trunc i8 %76 to i1
  br i1 %77, label %78, label %81

78:                                               ; preds = %75, %72
  %79 = load ptr, ptr @stderr, align 8, !tbaa !9
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.5, ptr noundef @.str.8, ptr noundef @.str, i32 noundef 42) #9
  call void @exit(i32 noundef -1) #11
  unreachable

81:                                               ; preds = %75, %72
  %82 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %83 = trunc i8 %82 to i1
  %84 = zext i1 %83 to i32
  %85 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %84)
          to label %86 unwind label %60

86:                                               ; preds = %81
  %87 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.10)
          to label %88 unwind label %60

88:                                               ; preds = %86
  %89 = invoke noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %90 unwind label %60

90:                                               ; preds = %88
  %91 = zext i1 %89 to i8
  store i8 %91, ptr %12, align 1, !tbaa !11
  %92 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %93 = trunc i8 %92 to i1
  br i1 %93, label %97, label %94

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, ptr noundef @.str.6, ptr noundef @.str, i32 noundef 47) #9
  call void @exit(i32 noundef -1) #11
  unreachable

97:                                               ; preds = %90
  %98 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %99 = trunc i8 %98 to i1
  %100 = zext i1 %99 to i32
  %101 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %100)
          to label %102 unwind label %60

102:                                              ; preds = %97
  %103 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.10)
          to label %104 unwind label %60

104:                                              ; preds = %102
  %105 = invoke noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %106 unwind label %60

106:                                              ; preds = %104
  %107 = zext i1 %105 to i8
  store i8 %107, ptr %12, align 1, !tbaa !11
  %108 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %109 = trunc i8 %108 to i1
  br i1 %109, label %113, label %110

110:                                              ; preds = %106
  %111 = load ptr, ptr @stderr, align 8, !tbaa !9
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str, i32 noundef 53) #9
  call void @exit(i32 noundef -1) #11
  unreachable

113:                                              ; preds = %106
  %114 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %115 = trunc i8 %114 to i1
  %116 = zext i1 %115 to i32
  %117 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %116)
          to label %118 unwind label %60

118:                                              ; preds = %113
  %119 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.7)
          to label %120 unwind label %60

120:                                              ; preds = %118
  %121 = invoke noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %122 unwind label %60

122:                                              ; preds = %120
  %123 = zext i1 %121 to i8
  store i8 %123, ptr %12, align 1, !tbaa !11
  %124 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %125 = trunc i8 %124 to i1
  br i1 %125, label %129, label %126

126:                                              ; preds = %122
  %127 = load ptr, ptr @stderr, align 8, !tbaa !9
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str, i32 noundef 58) #9
  call void @exit(i32 noundef -1) #11
  unreachable

129:                                              ; preds = %122
  %130 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %131 = trunc i8 %130 to i1
  %132 = zext i1 %131 to i32
  %133 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %132)
          to label %134 unwind label %60

134:                                              ; preds = %129
  %135 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.12)
          to label %136 unwind label %60

136:                                              ; preds = %134
  %137 = invoke i32 @sleep(i32 noundef 3)
          to label %138 unwind label %60

138:                                              ; preds = %136
  %139 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.13)
          to label %140 unwind label %60

140:                                              ; preds = %138
  %141 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.14)
          to label %142 unwind label %60

142:                                              ; preds = %140
  %143 = invoke noundef zeroext i1 @_ZN4chef8filelock6unlockEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
          to label %144 unwind label %60

144:                                              ; preds = %142
  %145 = zext i1 %143 to i8
  store i8 %145, ptr %12, align 1, !tbaa !11
  %146 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %147 = trunc i8 %146 to i1
  br i1 %147, label %151, label %148

148:                                              ; preds = %144
  %149 = load ptr, ptr @stderr, align 8, !tbaa !9
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str, i32 noundef 68) #9
  call void @exit(i32 noundef -1) #11
  unreachable

151:                                              ; preds = %144
  %152 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %153 = trunc i8 %152 to i1
  %154 = zext i1 %153 to i32
  %155 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %154)
          to label %156 unwind label %60

156:                                              ; preds = %151
  store i32 0, ptr %3, align 4
  call void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %13) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  call void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  %157 = load i32, ptr %3, align 4
  ret i32 %157

158:                                              ; preds = %60, %56
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  br label %159

159:                                              ; preds = %158, %35
  call void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  br label %160

160:                                              ; preds = %159, %34
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #9
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %9, align 8
  %163 = load i32, ptr %10, align 4
  %164 = insertvalue { ptr, i32 } poison, ptr %162, 0
  %165 = insertvalue { ptr, i32 } %164, i32 %163, 1
  resume { ptr, i32 } %165
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chef9check_logC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL7examplev() #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef8filelockC2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock6attachEPKc(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef) #6 align 2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36)) #6 align 2

declare i32 @sleep(i32 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock6unlockEv(ptr noundef nonnull align 8 dereferenceable(36)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { mustprogress norecurse 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 = { mustprogress 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 #3 = { mustprogress 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 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 #5 = { "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 = { inlinehint mustprogress 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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

%"class.chef::check_log" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.chef::filelock" = type <{ %"class.std::__cxx11::basic_string", i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.chef::check_log", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.chef::filelock", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #9
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %7 unwind label %15

7:                                                ; preds = %2
  invoke void @_ZN4chef9check_logC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %8 unwind label %17

8:                                                ; preds = %7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  call void @_ZL7examplev()
  %9 = icmp eq i32 %0, 2
  br i1 %9, label %10, label %20

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.1) #10
  %14 = icmp ne i32 %13, 0
  br label %20

15:                                               ; preds = %2
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %19

17:                                               ; preds = %7
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  br label %19

19:                                               ; preds = %17, %15
  %.pn = phi { ptr, i32 } [ %18, %17 ], [ %16, %15 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %78

20:                                               ; preds = %10, %8
  %.0 = phi i1 [ true, %8 ], [ %14, %10 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #9
  call void @_ZN4chef8filelockC2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6)
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %22 = invoke noundef zeroext i1 @_ZN4chef8filelock6attachEPKc(ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef nonnull @.str.3)
          to label %23 unwind label %29

23:                                               ; preds = %20
  %24 = zext i1 %22 to i32
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %24)
  br i1 %22, label %31, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 26) #11
  call void @exit(i32 noundef -1) #12
  unreachable

29:                                               ; preds = %68, %64, %56, %48, %39, %31, %20
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #9
  call void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  br label %78

31:                                               ; preds = %23
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %33 = invoke noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %34 unwind label %29

34:                                               ; preds = %31
  %35 = xor i1 %.0, %33
  br i1 %35, label %36, label %39

36:                                               ; preds = %34
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str, i32 noundef 42) #11
  call void @exit(i32 noundef -1) #12
  unreachable

39:                                               ; preds = %34
  %40 = zext i1 %33 to i32
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %40)
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %43 = invoke noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %44 unwind label %29

44:                                               ; preds = %39
  br i1 %43, label %48, label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 47) #11
  call void @exit(i32 noundef -1) #12
  unreachable

48:                                               ; preds = %44
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef 1)
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %51 = invoke noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %52 unwind label %29

52:                                               ; preds = %48
  br i1 %51, label %56, label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 53) #11
  call void @exit(i32 noundef -1) #12
  unreachable

56:                                               ; preds = %52
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef 1)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %59 = invoke noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %60 unwind label %29

60:                                               ; preds = %56
  br i1 %59, label %64, label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 58) #11
  call void @exit(i32 noundef -1) #12
  unreachable

64:                                               ; preds = %60
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef 1)
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %67 = invoke i32 @sleep(i32 noundef 3)
          to label %68 unwind label %29

68:                                               ; preds = %64
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %71 = invoke noundef zeroext i1 @_ZN4chef8filelock6unlockEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
          to label %72 unwind label %29

72:                                               ; preds = %68
  br i1 %71, label %76, label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str, i32 noundef 68) #11
  call void @exit(i32 noundef -1) #12
  unreachable

76:                                               ; preds = %72
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 1)
  call void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #9
  call void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #9
  ret i32 0

78:                                               ; preds = %29, %19
  %.pn26 = phi { ptr, i32 } [ %30, %29 ], [ %.pn, %19 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn26
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4chef9check_logC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL7examplev() local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef8filelockC2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock6attachEPKc(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef) local_unnamed_addr #6 align 2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock8try_lockEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock4lockEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #6 align 2

declare i32 @sleep(i32 noundef) local_unnamed_addr #8

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4chef8filelock6unlockEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef8filelockD2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4chef9check_logD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { mustprogress 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 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #5 = { 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 #6 = { inlinehint mustprogress 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 #7 = { 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 #8 = { "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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { cold nounwind }
attributes #12 = { 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++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass