|
| 1 | +; ModuleID = './test14.ll' |
| 2 | +source_filename = "test14.c" |
| 3 | +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" |
| 4 | +target triple = "arm64-apple-macosx14.0.0" |
| 5 | + |
| 6 | +@.str = private unnamed_addr constant [7 x i8] c"abcdef\00", align 1, !dbg !0 |
| 7 | + |
| 8 | +; Function Attrs: noinline nounwind ssp uwtable(sync) |
| 9 | +define i32 @main() #0 !dbg !16 { |
| 10 | +entry: |
| 11 | + %buffer = alloca [10 x i8], align 1 |
| 12 | + call void @llvm.dbg.declare(metadata ptr %buffer, metadata !21, metadata !DIExpression()), !dbg !25 |
| 13 | + call void @llvm.memset.p0.i64(ptr align 1 %buffer, i8 0, i64 10, i1 false), !dbg !25 |
| 14 | + %arraydecay = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 0, !dbg !26 |
| 15 | + call void @mem_insert(ptr noundef %arraydecay, ptr noundef @.str, i32 noundef 3, i32 noundef 5), !dbg !27 |
| 16 | + %arrayidx = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 3, !dbg !28 |
| 17 | + %0 = load i8, ptr %arrayidx, align 1, !dbg !28 |
| 18 | + %conv = sext i8 %0 to i32, !dbg !28 |
| 19 | + %cmp = icmp eq i32 %conv, 97, !dbg !29 |
| 20 | + call void @svf_assert(i1 noundef zeroext %cmp), !dbg !30 |
| 21 | + %arrayidx2 = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 4, !dbg !31 |
| 22 | + %1 = load i8, ptr %arrayidx2, align 1, !dbg !31 |
| 23 | + %conv3 = sext i8 %1 to i32, !dbg !31 |
| 24 | + %cmp4 = icmp eq i32 %conv3, 98, !dbg !32 |
| 25 | + call void @svf_assert(i1 noundef zeroext %cmp4), !dbg !33 |
| 26 | + %arrayidx6 = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 5, !dbg !34 |
| 27 | + %2 = load i8, ptr %arrayidx6, align 1, !dbg !34 |
| 28 | + %conv7 = sext i8 %2 to i32, !dbg !34 |
| 29 | + %cmp8 = icmp eq i32 %conv7, 99, !dbg !35 |
| 30 | + call void @svf_assert(i1 noundef zeroext %cmp8), !dbg !36 |
| 31 | + %arrayidx10 = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 6, !dbg !37 |
| 32 | + %3 = load i8, ptr %arrayidx10, align 1, !dbg !37 |
| 33 | + %conv11 = sext i8 %3 to i32, !dbg !37 |
| 34 | + %cmp12 = icmp eq i32 %conv11, 100, !dbg !38 |
| 35 | + call void @svf_assert(i1 noundef zeroext %cmp12), !dbg !39 |
| 36 | + %arrayidx14 = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 7, !dbg !40 |
| 37 | + %4 = load i8, ptr %arrayidx14, align 1, !dbg !40 |
| 38 | + %conv15 = sext i8 %4 to i32, !dbg !40 |
| 39 | + %cmp16 = icmp eq i32 %conv15, 101, !dbg !41 |
| 40 | + call void @svf_assert(i1 noundef zeroext %cmp16), !dbg !42 |
| 41 | + %arrayidx18 = getelementptr inbounds [10 x i8], ptr %buffer, i64 0, i64 8, !dbg !43 |
| 42 | + %5 = load i8, ptr %arrayidx18, align 1, !dbg !43 |
| 43 | + %conv19 = sext i8 %5 to i32, !dbg !43 |
| 44 | + %cmp20 = icmp ne i32 %conv19, 102, !dbg !44 |
| 45 | + call void @svf_assert(i1 noundef zeroext %cmp20), !dbg !45 |
| 46 | + ret i32 0, !dbg !46 |
| 47 | +} |
| 48 | + |
| 49 | +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) |
| 50 | +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 51 | + |
| 52 | +; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) |
| 53 | +declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 |
| 54 | + |
| 55 | +declare void @mem_insert(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3 |
| 56 | + |
| 57 | +declare void @svf_assert(i1 noundef zeroext) #3 |
| 58 | + |
| 59 | +attributes #0 = { noinline nounwind ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8a,+zcm,+zcz" } |
| 60 | +attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } |
| 61 | +attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) } |
| 62 | +attributes #3 = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+crc,+crypto,+dotprod,+fp-armv8,+fp16fml,+fullfp16,+lse,+neon,+ras,+rcpc,+rdm,+sha2,+sha3,+sm4,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8a,+zcm,+zcz" } |
| 63 | + |
| 64 | +!llvm.dbg.cu = !{!7} |
| 65 | +!llvm.module.flags = !{!9, !10, !11, !12, !13, !14} |
| 66 | +!llvm.ident = !{!15} |
| 67 | + |
| 68 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 69 | +!1 = distinct !DIGlobalVariable(scope: null, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true) |
| 70 | +!2 = !DIFile(filename: "test14.c", directory: "/Users/z5489735/2023/0718/Software-Security-Analysis/Assignment-3/Tests/buf") |
| 71 | +!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 56, elements: !5) |
| 72 | +!4 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) |
| 73 | +!5 = !{!6} |
| 74 | +!6 = !DISubrange(count: 7) |
| 75 | +!7 = distinct !DICompileUnit(language: DW_LANG_C11, file: !2, producer: "Homebrew clang version 16.0.6", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !8, splitDebugInlining: false, nameTableKind: None, sysroot: "/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk", sdk: "MacOSX14.sdk") |
| 76 | +!8 = !{!0} |
| 77 | +!9 = !{i32 7, !"Dwarf Version", i32 4} |
| 78 | +!10 = !{i32 2, !"Debug Info Version", i32 3} |
| 79 | +!11 = !{i32 1, !"wchar_size", i32 4} |
| 80 | +!12 = !{i32 8, !"PIC Level", i32 2} |
| 81 | +!13 = !{i32 7, !"uwtable", i32 1} |
| 82 | +!14 = !{i32 7, !"frame-pointer", i32 1} |
| 83 | +!15 = !{!"Homebrew clang version 16.0.6"} |
| 84 | +!16 = distinct !DISubprogram(name: "main", scope: !2, file: !2, line: 5, type: !17, scopeLine: 5, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !20) |
| 85 | +!17 = !DISubroutineType(types: !18) |
| 86 | +!18 = !{!19} |
| 87 | +!19 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 88 | +!20 = !{} |
| 89 | +!21 = !DILocalVariable(name: "buffer", scope: !16, file: !2, line: 6, type: !22) |
| 90 | +!22 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 80, elements: !23) |
| 91 | +!23 = !{!24} |
| 92 | +!24 = !DISubrange(count: 10) |
| 93 | +!25 = !DILocation(line: 6, column: 7, scope: !16) |
| 94 | +!26 = !DILocation(line: 7, column: 13, scope: !16) |
| 95 | +!27 = !DILocation(line: 7, column: 2, scope: !16) |
| 96 | +!28 = !DILocation(line: 8, column: 16, scope: !16) |
| 97 | +!29 = !DILocation(line: 8, column: 26, scope: !16) |
| 98 | +!30 = !DILocation(line: 8, column: 5, scope: !16) |
| 99 | +!31 = !DILocation(line: 9, column: 16, scope: !16) |
| 100 | +!32 = !DILocation(line: 9, column: 26, scope: !16) |
| 101 | +!33 = !DILocation(line: 9, column: 5, scope: !16) |
| 102 | +!34 = !DILocation(line: 10, column: 16, scope: !16) |
| 103 | +!35 = !DILocation(line: 10, column: 26, scope: !16) |
| 104 | +!36 = !DILocation(line: 10, column: 5, scope: !16) |
| 105 | +!37 = !DILocation(line: 11, column: 16, scope: !16) |
| 106 | +!38 = !DILocation(line: 11, column: 26, scope: !16) |
| 107 | +!39 = !DILocation(line: 11, column: 5, scope: !16) |
| 108 | +!40 = !DILocation(line: 12, column: 16, scope: !16) |
| 109 | +!41 = !DILocation(line: 12, column: 26, scope: !16) |
| 110 | +!42 = !DILocation(line: 12, column: 5, scope: !16) |
| 111 | +!43 = !DILocation(line: 13, column: 16, scope: !16) |
| 112 | +!44 = !DILocation(line: 13, column: 26, scope: !16) |
| 113 | +!45 = !DILocation(line: 13, column: 5, scope: !16) |
| 114 | +!46 = !DILocation(line: 14, column: 5, scope: !16) |
0 commit comments